qplatformbackingstore.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qplatformbackingstore.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6class QPlatformBackingStorePrivate-
7{-
8public:-
9 QPlatformBackingStorePrivate(QWindow *w)-
10 : window(w)-
11-
12 , textureId(0)-
13 , blitter(0)-
14-
15 {-
16 }
never executed: end of block
0
17-
18 ~QPlatformBackingStorePrivate()-
19 {-
20-
21 QOpenGLContext *ctx = QOpenGLContext::currentContext();-
22 if (ctx
ctxDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
23 if (textureId
textureIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 ctx->functions()->glDeleteTextures(1, &textureId);
never executed: ctx->functions()->glDeleteTextures(1, &textureId);
0
25 if (blitter
blitterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
26 blitter->destroy();
never executed: blitter->destroy();
0
27 }
never executed: end of block
else if (textureId
textureIdDescription
TRUEnever evaluated
FALSEnever evaluated
|| blitter
blitterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
28 QMessageLogger(__FILE__, 97, __PRETTY_FUNCTION__).warning("No context current during QPlatformBackingStore destruction, OpenGL resources not released");-
29 }
never executed: end of block
0
30 delete blitter;-
31-
32 }
never executed: end of block
0
33 QWindow *window;-
34-
35 mutable GLuint textureId;-
36 mutable QSize textureSize;-
37 mutable bool needsSwizzle;-
38 mutable bool premultiplied;-
39 QOpenGLTextureBlitter *blitter;-
40-
41};-
42-
43-
44-
45struct QBackingstoreTextureInfo-
46{-
47 void *source;-
48 GLuint textureId;-
49 QRect rect;-
50 QRect clipRect;-
51 QPlatformTextureList::Flags flags;-
52};-
53-
54template<> class QTypeInfo<QBackingstoreTextureInfo > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QBackingstoreTextureInfo)>sizeof(void*)), isPointer = false, isIntegral = QtPrivate::is_integral< QBackingstoreTextureInfo >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QBackingstoreTextureInfo) }; static inline const char *name() { return "QBackingstoreTextureInfo"; } };-
55-
56class QPlatformTextureListPrivate : public QObjectPrivate-
57{-
58public:-
59 QPlatformTextureListPrivate()-
60 : locked(false)-
61 {-
62 }
never executed: end of block
0
63-
64 QVector<QBackingstoreTextureInfo> textures;-
65 bool locked;-
66};-
67-
68QPlatformTextureList::QPlatformTextureList(QObject *parent)-
69: QObject(*new QPlatformTextureListPrivate, parent)-
70{-
71}
never executed: end of block
0
72-
73QPlatformTextureList::~QPlatformTextureList()-
74{-
75}-
76-
77int QPlatformTextureList::count() const-
78{-
79 const QPlatformTextureListPrivate * const d = d_func();-
80 return
never executed: return d->textures.count();
d->textures.count();
never executed: return d->textures.count();
0
81}-
82-
83GLuint QPlatformTextureList::textureId(int index) const-
84{-
85 const QPlatformTextureListPrivate * const d = d_func();-
86 return
never executed: return d->textures.at(index).textureId;
d->textures.at(index).textureId;
never executed: return d->textures.at(index).textureId;
0
87}-
88-
89void *QPlatformTextureList::source(int index)-
90{-
91 const QPlatformTextureListPrivate * const d = d_func();-
92 return
never executed: return d->textures.at(index).source;
d->textures.at(index).source;
never executed: return d->textures.at(index).source;
0
93}-
94-
95QPlatformTextureList::Flags QPlatformTextureList::flags(int index) const-
96{-
97 const QPlatformTextureListPrivate * const d = d_func();-
98 return
never executed: return d->textures.at(index).flags;
d->textures.at(index).flags;
never executed: return d->textures.at(index).flags;
0
99}-
100-
101QRect QPlatformTextureList::geometry(int index) const-
102{-
103 const QPlatformTextureListPrivate * const d = d_func();-
104 return
never executed: return d->textures.at(index).rect;
d->textures.at(index).rect;
never executed: return d->textures.at(index).rect;
0
105}-
106-
107QRect QPlatformTextureList::clipRect(int index) const-
108{-
109 const QPlatformTextureListPrivate * const d = d_func();-
110 return
never executed: return d->textures.at(index).clipRect;
d->textures.at(index).clipRect;
never executed: return d->textures.at(index).clipRect;
0
111}-
112-
113void QPlatformTextureList::lock(bool on)-
114{-
115 QPlatformTextureListPrivate * const d = d_func();-
116 if (on != d->locked
on != d->lockedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
117 d->locked = on;-
118 locked(on);-
119 }
never executed: end of block
0
120}
never executed: end of block
0
121-
122bool QPlatformTextureList::isLocked() const-
123{-
124 const QPlatformTextureListPrivate * const d = d_func();-
125 return
never executed: return d->locked;
d->locked;
never executed: return d->locked;
0
126}-
127-
128void QPlatformTextureList::appendTexture(void *source, GLuint textureId, const QRect &geometry,-
129 const QRect &clipRect, Flags flags)-
130{-
131 QPlatformTextureListPrivate * const d = d_func();-
132 QBackingstoreTextureInfo bi;-
133 bi.source = source;-
134 bi.textureId = textureId;-
135 bi.rect = geometry;-
136 bi.clipRect = clipRect;-
137 bi.flags = flags;-
138 d->textures.append(bi);-
139}
never executed: end of block
0
140-
141void QPlatformTextureList::clear()-
142{-
143 QPlatformTextureListPrivate * const d = d_func();-
144 d->textures.clear();-
145}
never executed: end of block
0
146static inline QRect deviceRect(const QRect &rect, QWindow *window)-
147{-
148 QRect deviceRect(rect.topLeft() * window->devicePixelRatio(),-
149 rect.size() * window->devicePixelRatio());-
150 return
never executed: return deviceRect;
deviceRect;
never executed: return deviceRect;
0
151}-
152-
153static QRegion deviceRegion(const QRegion &region, QWindow *window, const QPoint &offset)-
154{-
155 if (offset.isNull()
offset.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& window->devicePixelRatio() <= 1
window->device...elRatio() <= 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
156 return
never executed: return region;
region;
never executed: return region;
0
157-
158 QVector<QRect> rects;-
159 const QVector<QRect> regionRects = region.rects();-
160 rects.reserve(regionRects.count());-
161 for (const QRect &rect : regionRects)-
162 rects.append(deviceRect(rect.translated(offset), window));
never executed: rects.append(deviceRect(rect.translated(offset), window));
0
163-
164 QRegion deviceRegion;-
165 deviceRegion.setRects(rects.constData(), rects.count());-
166 return
never executed: return deviceRegion;
deviceRegion;
never executed: return deviceRegion;
0
167}-
168-
169static inline QRect toBottomLeftRect(const QRect &topLeftRect, int windowHeight)-
170{-
171 return
never executed: return QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1, topLeftRect.width(), topLeftRect.height());
QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1,
never executed: return QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1, topLeftRect.width(), topLeftRect.height());
0
172 topLeftRect.width(), topLeftRect.height());
never executed: return QRect(topLeftRect.x(), windowHeight - topLeftRect.bottomRight().y() - 1, topLeftRect.width(), topLeftRect.height());
0
173}-
174-
175static void blitTextureForWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect,-
176 QOpenGLTextureBlitter *blitter, const QPoint &offset)-
177{-
178 const QRect clipRect = textures->clipRect(idx);-
179 if (clipRect.isEmpty()
clipRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
180 return;
never executed: return;
0
181-
182 QRect rectInWindow = textures->geometry(idx);-
183-
184 rectInWindow.translate(-offset);-
185-
186 const QRect clippedRectInWindow = rectInWindow & clipRect.translated(rectInWindow.topLeft());-
187 const QRect srcRect = toBottomLeftRect(clipRect, rectInWindow.height());-
188-
189 const QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(deviceRect(clippedRectInWindow, window),-
190 deviceWindowRect);-
191-
192 const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(deviceRect(srcRect, window),-
193 deviceRect(rectInWindow, window).size(),-
194 QOpenGLTextureBlitter::OriginBottomLeft);-
195-
196 blitter->blit(textures->textureId(idx), target, source);-
197}
never executed: end of block
0
198void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &region,-
199 const QPoint &offset,-
200 QPlatformTextureList *textures, QOpenGLContext *context,-
201 bool translucentBackground)-
202{-
203 if (!qt_window_private(window)->receivedExpose
!qt_window_pri...receivedExposeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
204 return;
never executed: return;
0
205-
206 if (!context->makeCurrent(window)
!context->makeCurrent(window)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
207 QMessageLogger(__FILE__, 316, __PRETTY_FUNCTION__).warning("composeAndFlush: makeCurrent() failed");-
208 return;
never executed: return;
0
209 }-
210-
211 QWindowPrivate::get(window)->lastComposeTime.start();-
212-
213 QOpenGLFunctions *funcs = context->functions();-
214 funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio());-
215 funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1);-
216 funcs->glClear(0x00004000);-
217-
218 if (!d_ptr->blitter
!d_ptr->blitterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
219 d_ptr->blitter = new QOpenGLTextureBlitter;-
220 d_ptr->blitter->create();-
221 }
never executed: end of block
0
222-
223 d_ptr->blitter->bind();-
224-
225 const QRect deviceWindowRect = deviceRect(QRect(QPoint(), window->size()), window);-
226-
227-
228 for (int i = 0; i < textures->count()
i < textures->count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
229 if (!textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)
!textures->fla...::StacksOnTop)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
230 blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
never executed: blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
0
231 }
never executed: end of block
0
232-
233-
234 GLuint textureId = 0;-
235 QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft;-
236 if (QPlatformGraphicsBuffer *graphicsBuffer = this->graphicsBuffer()
QPlatformGraph...aphicsBuffer()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
237 if (graphicsBuffer->size() != d_ptr->textureSize
graphicsBuffer...r->textureSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
238 if (d_ptr->textureId
d_ptr->textureIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
239 funcs->glDeleteTextures(1, &d_ptr->textureId);
never executed: funcs->glDeleteTextures(1, &d_ptr->textureId);
0
240 funcs->glGenTextures(1, &d_ptr->textureId);-
241 funcs->glBindTexture(0x0DE1, d_ptr->textureId);-
242 QOpenGLContext *ctx = QOpenGLContext::currentContext();-
243 if (!ctx->isOpenGLES()
!ctx->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
|| ctx->format().majorVersion() >= 3
ctx->format()....Version() >= 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
244 funcs->glTexParameteri(0x0DE1, 0x813C, 0);-
245 funcs->glTexParameteri(0x0DE1, 0x813D, 0);-
246 }
never executed: end of block
0
247 funcs->glTexParameterf(0x0DE1, 0x2801, 0x2600);-
248 funcs->glTexParameterf(0x0DE1, 0x2800, 0x2600);-
249 funcs->glTexParameterf(0x0DE1, 0x2802, 0x812F);-
250 funcs->glTexParameterf(0x0DE1, 0x2803, 0x812F);-
251-
252 if (QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied)
QPlatformGraph...premultiplied)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
253 d_ptr->textureSize = graphicsBuffer->size();-
254 }
never executed: end of block
else {
0
255 d_ptr->textureSize = QSize(0,0);-
256 }
never executed: end of block
0
257-
258 graphicsBuffer->unlock();-
259 }
never executed: end of block
else if (!region.isEmpty()
!region.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
){
0
260 funcs->glBindTexture(0x0DE1, d_ptr->textureId);-
261 QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied);-
262 }
never executed: end of block
0
263-
264 if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft
graphicsBuffer...iginBottomLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
265 origin = QOpenGLTextureBlitter::OriginBottomLeft;
never executed: origin = QOpenGLTextureBlitter::OriginBottomLeft;
0
266 textureId = d_ptr->textureId;-
267 }
never executed: end of block
else {
0
268 TextureFlags flags = 0;-
269 textureId = toTexture(deviceRegion(region, window, offset), &d_ptr->textureSize, &flags);-
270 d_ptr->needsSwizzle = (flags & TextureSwizzle) != 0;-
271 d_ptr->premultiplied = (flags & TexturePremultiplied) != 0;-
272 if (flags & TextureFlip
flags & TextureFlipDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
273 origin = QOpenGLTextureBlitter::OriginBottomLeft;
never executed: origin = QOpenGLTextureBlitter::OriginBottomLeft;
0
274 }
never executed: end of block
0
275-
276 funcs->glEnable(0x0BE2);-
277 if (d_ptr->premultiplied
d_ptr->premultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
278 funcs->glBlendFuncSeparate(1, 0x0303, 1, 1);
never executed: funcs->glBlendFuncSeparate(1, 0x0303, 1, 1);
0
279 else-
280 funcs->glBlendFuncSeparate(0x0302, 0x0303, 1, 1);
never executed: funcs->glBlendFuncSeparate(0x0302, 0x0303, 1, 1);
0
281-
282 if (textureId
textureIdDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
283 if (d_ptr->needsSwizzle
d_ptr->needsSwizzleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
284 d_ptr->blitter->setSwizzleRB(true);
never executed: d_ptr->blitter->setSwizzleRB(true);
0
285-
286-
287 const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(offset), d_ptr->textureSize.height());-
288 const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(srcRect,-
289 d_ptr->textureSize,-
290 origin);-
291 d_ptr->blitter->blit(textureId, QMatrix4x4(), source);-
292 if (d_ptr->needsSwizzle
d_ptr->needsSwizzleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
293 d_ptr->blitter->setSwizzleRB(false);
never executed: d_ptr->blitter->setSwizzleRB(false);
0
294 }
never executed: end of block
0
295-
296-
297 for (int i = 0; i < textures->count()
i < textures->count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
298 if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop)
textures->flag...::StacksOnTop)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
299 blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
never executed: blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset);
0
300 }
never executed: end of block
0
301-
302 funcs->glDisable(0x0BE2);-
303 d_ptr->blitter->release();-
304-
305 context->swapBuffers(window);-
306}
never executed: end of block
0
307QImage QPlatformBackingStore::toImage() const-
308{-
309 return
never executed: return QImage();
QImage();
never executed: return QImage();
0
310}-
311GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const-
312{-
313 ((!(textureSize)) ? qt_assert("textureSize",__FILE__,460) : qt_noop());-
314 ((!(flags)) ? qt_assert("flags",__FILE__,461) : qt_noop());-
315-
316 QImage image = toImage();-
317 QSize imageSize = image.size();-
318-
319 QOpenGLContext *ctx = QOpenGLContext::currentContext();-
320 GLenum internalFormat = 0x1908;-
321 GLuint pixelType = 0x1401;-
322-
323 bool needsConversion = false;-
324 *flags = 0;-
325 switch (image.format()) {-
326 case
never executed: case QImage::Format_ARGB32_Premultiplied:
QImage::Format_ARGB32_Premultiplied:
never executed: case QImage::Format_ARGB32_Premultiplied:
0
327 *flags |= TexturePremultiplied;-
328-
329 case
never executed: case QImage::Format_RGB32:
QImage::Format_RGB32:
never executed: case QImage::Format_RGB32:
code before this statement never executed: case QImage::Format_RGB32:
0
330 case
never executed: case QImage::Format_ARGB32:
QImage::Format_ARGB32:
never executed: case QImage::Format_ARGB32:
0
331 *flags |= TextureSwizzle;-
332 break;
never executed: break;
0
333 case
never executed: case QImage::Format_RGBA8888_Premultiplied:
QImage::Format_RGBA8888_Premultiplied:
never executed: case QImage::Format_RGBA8888_Premultiplied:
0
334 *flags |= TexturePremultiplied;-
335-
336 case
never executed: case QImage::Format_RGBX8888:
QImage::Format_RGBX8888:
never executed: case QImage::Format_RGBX8888:
code before this statement never executed: case QImage::Format_RGBX8888:
0
337 case
never executed: case QImage::Format_RGBA8888:
QImage::Format_RGBA8888:
never executed: case QImage::Format_RGBA8888:
0
338 break;
never executed: break;
0
339 case
never executed: case QImage::Format_BGR30:
QImage::Format_BGR30:
never executed: case QImage::Format_BGR30:
0
340 case
never executed: case QImage::Format_A2BGR30_Premultiplied:
QImage::Format_A2BGR30_Premultiplied:
never executed: case QImage::Format_A2BGR30_Premultiplied:
0
341 if (!ctx->isOpenGLES()
!ctx->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
|| ctx->format().majorVersion() >= 3
ctx->format()....Version() >= 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
342 pixelType = 0x8368;-
343 internalFormat = 0x8059;-
344 *flags |= TexturePremultiplied;-
345 }
never executed: end of block
else {
0
346 needsConversion = true;-
347 }
never executed: end of block
0
348 break;
never executed: break;
0
349 case
never executed: case QImage::Format_RGB30:
QImage::Format_RGB30:
never executed: case QImage::Format_RGB30:
0
350 case
never executed: case QImage::Format_A2RGB30_Premultiplied:
QImage::Format_A2RGB30_Premultiplied:
never executed: case QImage::Format_A2RGB30_Premultiplied:
0
351 if (!ctx->isOpenGLES()
!ctx->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
|| ctx->format().majorVersion() >= 3
ctx->format()....Version() >= 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
352 pixelType = 0x8368;-
353 internalFormat = 0x8059;-
354 *flags |= TextureSwizzle | TexturePremultiplied;-
355 }
never executed: end of block
else {
0
356 needsConversion = true;-
357 }
never executed: end of block
0
358 break;
never executed: break;
0
359 default
never executed: default:
:
never executed: default:
0
360 needsConversion = true;-
361 break;
never executed: break;
0
362 }-
363 if (imageSize.isEmpty()
imageSize.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
364 *textureSize = imageSize;-
365 return
never executed: return 0;
0;
never executed: return 0;
0
366 }-
367-
368-
369-
370 bool resized = *textureSize != imageSize;-
371 if (dirtyRegion.isEmpty()
dirtyRegion.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !resized
!resizedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
372 return
never executed: return d_ptr->textureId;
d_ptr->textureId;
never executed: return d_ptr->textureId;
0
373-
374 *textureSize = imageSize;-
375-
376 if (needsConversion
needsConversionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
377 image = image.convertToFormat(QImage::Format_RGBA8888);
never executed: image = image.convertToFormat(QImage::Format_RGBA8888);
0
378-
379-
380-
381 static const int bytesPerPixel = 4;-
382 const int strideInPixels = image.bytesPerLine() / bytesPerPixel;-
383 const bool hasUnpackRowLength = !ctx->isOpenGLES()
!ctx->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
|| ctx->format().majorVersion() >= 3
ctx->format()....Version() >= 3Description
TRUEnever evaluated
FALSEnever evaluated
;
0
384-
385 QOpenGLFunctions *funcs = ctx->functions();-
386-
387 if (hasUnpackRowLength
hasUnpackRowLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
388 funcs->glPixelStorei(0x0CF2, strideInPixels);-
389 }
never executed: end of block
else if (strideInPixels != image.width()
strideInPixels... image.width()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
390-
391-
392-
393 image = image.copy();-
394 }
never executed: end of block
0
395-
396 if (resized
resizedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
397 if (d_ptr->textureId
d_ptr->textureIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
398 funcs->glDeleteTextures(1, &d_ptr->textureId);
never executed: funcs->glDeleteTextures(1, &d_ptr->textureId);
0
399 funcs->glGenTextures(1, &d_ptr->textureId);-
400 funcs->glBindTexture(0x0DE1, d_ptr->textureId);-
401 if (!ctx->isOpenGLES()
!ctx->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
|| ctx->format().majorVersion() >= 3
ctx->format()....Version() >= 3Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
402 funcs->glTexParameteri(0x0DE1, 0x813C, 0);-
403 funcs->glTexParameteri(0x0DE1, 0x813D, 0);-
404 }
never executed: end of block
0
405 funcs->glTexParameterf(0x0DE1, 0x2801, 0x2600);-
406 funcs->glTexParameterf(0x0DE1, 0x2800, 0x2600);-
407 funcs->glTexParameterf(0x0DE1, 0x2802, 0x812F);-
408 funcs->glTexParameterf(0x0DE1, 0x2803, 0x812F);-
409-
410 funcs->glTexImage2D(0x0DE1, 0, internalFormat, imageSize.width(), imageSize.height(), 0, 0x1908, pixelType,-
411 const_cast<uchar*>(image.constBits()));-
412 }
never executed: end of block
else {
0
413 funcs->glBindTexture(0x0DE1, d_ptr->textureId);-
414 QRect imageRect = image.rect();-
415 QRect rect = dirtyRegion.boundingRect() & imageRect;-
416-
417 if (hasUnpackRowLength
hasUnpackRowLengthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
418 funcs->glTexSubImage2D(0x0DE1, 0, rect.x(), rect.y(), rect.width(), rect.height(), 0x1908, pixelType,-
419 image.constScanLine(rect.y()) + rect.x() * bytesPerPixel);-
420 }
never executed: end of block
else {
0
421-
422-
423 if (rect.width() >= imageRect.width() / 2
rect.width() >...ct.width() / 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
424 rect.setX(0);-
425 rect.setWidth(imageRect.width());-
426 }
never executed: end of block
0
427-
428-
429-
430-
431 if (rect.width() == imageRect.width()
rect.width() =...geRect.width()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
432 funcs->glTexSubImage2D(0x0DE1, 0, 0, rect.y(), rect.width(), rect.height(), 0x1908, pixelType,-
433 image.constScanLine(rect.y()));-
434 }
never executed: end of block
else {
0
435 funcs->glTexSubImage2D(0x0DE1, 0, rect.x(), rect.y(), rect.width(), rect.height(), 0x1908, pixelType,-
436 image.copy(rect).constBits());-
437 }
never executed: end of block
0
438 }-
439 }-
440-
441 if (hasUnpackRowLength
hasUnpackRowLengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
442 funcs->glPixelStorei(0x0CF2, 0);
never executed: funcs->glPixelStorei(0x0CF2, 0);
0
443-
444 return
never executed: return d_ptr->textureId;
d_ptr->textureId;
never executed: return d_ptr->textureId;
0
445}-
446QPlatformBackingStore::QPlatformBackingStore(QWindow *window)-
447 : d_ptr(new QPlatformBackingStorePrivate(window))-
448{-
449}
never executed: end of block
0
450-
451-
452-
453-
454QPlatformBackingStore::~QPlatformBackingStore()-
455{-
456 delete d_ptr;-
457}
never executed: end of block
0
458-
459-
460-
461-
462-
463QWindow* QPlatformBackingStore::window() const-
464{-
465 return
never executed: return d_ptr->window;
d_ptr->window;
never executed: return d_ptr->window;
0
466}-
467void QPlatformBackingStore::beginPaint(const QRegion &)-
468{-
469}-
470-
471-
472-
473-
474-
475-
476-
477void QPlatformBackingStore::endPaint()-
478{-
479}-
480-
481-
482-
483-
484QPlatformGraphicsBuffer *QPlatformBackingStore::graphicsBuffer() const-
485{-
486 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
487}-
488-
489-
490-
491-
492-
493-
494-
495bool QPlatformBackingStore::scroll(const QRegion &area, int dx, int dy)-
496{-
497 (void)area;;-
498 (void)dx;;-
499 (void)dy;;-
500-
501 return
never executed: return false;
false;
never executed: return false;
0
502}-
503-
504-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9