Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | extern QRegion qt_dirtyRegion(QWidget *); | - |
14 | | - |
15 | | - |
16 | namespace { namespace Q_QGS_qt_dummy_platformTextureList { typedef QPlatformTextureList Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::InitializedTRUE | never evaluated | FALSE | never evaluated |
) guard.store(QtGlobalStatic::Destroyed);never executed: guard.store(QtGlobalStatic::Destroyed); }never executed: end of block }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnnever executed: return &holder.value; &holder.value;never executed: return &holder.value; } } } static QGlobalStatic<QPlatformTextureList, Q_QGS_qt_dummy_platformTextureList::innerFunction, Q_QGS_qt_dummy_platformTextureList::guard> qt_dummy_platformTextureList; | 0 |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBackingStore *backingStore, | - |
25 | QWidget *tlw, const QPoint &tlwOffset, QPlatformTextureList *widgetTextures, | - |
26 | QWidgetBackingStore *widgetBackingStore) | - |
27 | { | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | ((!(!region.isEmpty() || widgetTextures)) ? qt_assert("!region.isEmpty() || widgetTextures",__FILE__,87) : qt_noop()); | - |
33 | | - |
34 | ((!(widget)) ? qt_assert("widget",__FILE__,89) : qt_noop()); | - |
35 | ((!(backingStore)) ? qt_assert("backingStore",__FILE__,90) : qt_noop()); | - |
36 | ((!(tlw)) ? qt_assert("tlw",__FILE__,91) : qt_noop()); | - |
37 | | - |
38 | static int flushUpdate = qEnvironmentVariableIntValue("QT_FLUSH_UPDATE"); | - |
39 | if (flushUpdate > 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
40 | QWidgetBackingStore::showYellowThing(widget, region, flushUpdate * 10, false); never executed: QWidgetBackingStore::showYellowThing(widget, region, flushUpdate * 10, false); | 0 |
41 | | - |
42 | | - |
43 | if (tlw->testAttribute(Qt::WA_DontShowOnScreen)TRUE | never evaluated | FALSE | never evaluated |
|| widget->testAttribute(Qt::WA_DontShowOnScreen)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
44 | return; never executed: return; | 0 |
45 | static bool fpsDebug = qEnvironmentVariableIntValue("QT_DEBUG_FPS"); | - |
46 | if (fpsDebugTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
47 | if (!widgetBackingStore->perfFrames++TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
48 | widgetBackingStore->perfTime.start(); never executed: widgetBackingStore->perfTime.start(); | 0 |
49 | if (widgetBackingStore->perfTime.elapsed() > 5000TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
50 | double fps = double(widgetBackingStore->perfFrames * 1000) / widgetBackingStore->perfTime.restart(); | - |
51 | QMessageLogger(__FILE__, 106, __PRETTY_FUNCTION__).debug("FPS: %.1f\n", fps); | - |
52 | widgetBackingStore->perfFrames = 0; | - |
53 | } never executed: end of block | 0 |
54 | } never executed: end of block | 0 |
55 | | - |
56 | QPoint offset = tlwOffset; | - |
57 | if (widget != tlwTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
58 | offset += widget->mapTo(tlw, QPoint()); never executed: offset += widget->mapTo(tlw, QPoint()); | 0 |
59 | | - |
60 | QRegion effectiveRegion = region; | - |
61 | | - |
62 | const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive; | - |
63 | if (!widgetTexturesTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
64 | widget->d_func()->renderToTextureComposeActive = false; | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | if (compositionWasActiveTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
70 | widgetTextures = qt_dummy_platformTextureList; never executed: widgetTextures = qt_dummy_platformTextureList; | 0 |
71 | } never executed: end of block else { | 0 |
72 | widget->d_func()->renderToTextureComposeActive = true; | - |
73 | } never executed: end of block | 0 |
74 | | - |
75 | | - |
76 | | - |
77 | if (compositionWasActive != widget->d_func()->renderToTextureComposeActiveTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
78 | effectiveRegion = widget->rect(); never executed: effectiveRegion = widget->rect(); | 0 |
79 | | - |
80 | | - |
81 | if (widgetTexturesTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
82 | qt_window_private(tlw->windowHandle())->compositing = true; | - |
83 | widget->window()->d_func()->sendComposeStatus(widget->window(), false); | - |
84 | | - |
85 | | - |
86 | | - |
87 | const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground); | - |
88 | | - |
89 | | - |
90 | backingStore->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset, widgetTextures, | - |
91 | tlw->d_func()->shareContext(), translucentBackground); | - |
92 | widget->window()->d_func()->sendComposeStatus(widget->window(), true); | - |
93 | } never executed: end of block else | 0 |
94 | | - |
95 | backingStore->flush(effectiveRegion, widget->windowHandle(), offset); never executed: backingStore->flush(effectiveRegion, widget->windowHandle(), offset); | 0 |
96 | } | - |
97 | void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped) | - |
98 | { | - |
99 | | - |
100 | | - |
101 | | - |
102 | QRegion paintRegion = toBePainted; | - |
103 | QRect widgetRect = widget->rect(); | - |
104 | | - |
105 | if (!widget->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
106 | QWidget *nativeParent = widget->nativeParentWidget(); | - |
107 | const QPoint offset = widget->mapTo(nativeParent, QPoint(0, 0)); | - |
108 | paintRegion.translate(offset); | - |
109 | widgetRect.translate(offset); | - |
110 | widget = nativeParent; | - |
111 | } never executed: end of block | 0 |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | bool paintUnclipped = widget->testAttribute(Qt::WA_PaintUnclipped); | - |
119 | if (unclippedTRUE | never evaluated | FALSE | never evaluated |
&& !widget->d_func()->paintOnScreen()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
120 | widget->setAttribute(Qt::WA_PaintUnclipped); never executed: widget->setAttribute(Qt::WA_PaintUnclipped); | 0 |
121 | | - |
122 | const bool setFlag = !widget->testAttribute(Qt::WA_WState_InPaintEvent); | - |
123 | if (setFlagTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
124 | widget->setAttribute(Qt::WA_WState_InPaintEvent); never executed: widget->setAttribute(Qt::WA_WState_InPaintEvent); | 0 |
125 | | - |
126 | | - |
127 | QPaintEngine *pe = widget->paintEngine(); | - |
128 | if (peTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
129 | pe->setSystemClip(paintRegion); | - |
130 | { | - |
131 | QPainter p(widget); | - |
132 | p.setClipRegion(paintRegion); | - |
133 | static int i = 0; | - |
134 | switch (i) { | - |
135 | case never executed: case 0: 0:never executed: case 0: | 0 |
136 | p.fillRect(widgetRect, QColor(255,255,0)); | - |
137 | break; never executed: break; | 0 |
138 | case never executed: case 1: 1:never executed: case 1: | 0 |
139 | p.fillRect(widgetRect, QColor(255,200,55)); | - |
140 | break; never executed: break; | 0 |
141 | case never executed: case 2: 2:never executed: case 2: | 0 |
142 | p.fillRect(widgetRect, QColor(200,255,55)); | - |
143 | break; never executed: break; | 0 |
144 | case never executed: case 3: 3:never executed: case 3: | 0 |
145 | p.fillRect(widgetRect, QColor(200,200,0)); | - |
146 | break; never executed: break; | 0 |
147 | } | - |
148 | i = (i+1) & 3; | - |
149 | p.end(); | - |
150 | } | - |
151 | } never executed: end of block | 0 |
152 | | - |
153 | if (setFlagTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
154 | widget->setAttribute(Qt::WA_WState_InPaintEvent, false); never executed: widget->setAttribute(Qt::WA_WState_InPaintEvent, false); | 0 |
155 | | - |
156 | | - |
157 | widget->setAttribute(Qt::WA_PaintUnclipped, paintUnclipped); | - |
158 | | - |
159 | if (peTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
160 | pe->setSystemClip(QRegion()); never executed: pe->setSystemClip(QRegion()); | 0 |
161 | | - |
162 | | - |
163 | ::usleep(1000 * msec); | - |
164 | | - |
165 | | - |
166 | } never executed: end of block | 0 |
167 | | - |
168 | bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn) | - |
169 | { | - |
170 | if (!widgetTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
171 | return never executed: return false; false;never executed: return false; | 0 |
172 | | - |
173 | int delay = 0; | - |
174 | if (widget->testAttribute(Qt::WA_WState_InPaintEvent)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
175 | static int flushPaintEvent = qEnvironmentVariableIntValue("QT_FLUSH_PAINT_EVENT"); | - |
176 | if (!flushPaintEventTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
177 | return never executed: return false; false;never executed: return false; | 0 |
178 | delay = flushPaintEvent; | - |
179 | } never executed: end of block else { | 0 |
180 | static int flushPaint = qEnvironmentVariableIntValue("QT_FLUSH_PAINT"); | - |
181 | if (!flushPaintTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
182 | return never executed: return false; false;never executed: return false; | 0 |
183 | delay = flushPaint; | - |
184 | } never executed: end of block | 0 |
185 | | - |
186 | QWidgetBackingStore::showYellowThing(widget, rgn, delay * 10, true); | - |
187 | return never executed: return true; true;never executed: return true; | 0 |
188 | } | - |
189 | | - |
190 | void QWidgetBackingStore::unflushPaint(QWidget *widget, const QRegion &rgn) | - |
191 | { | - |
192 | if (widget->d_func()->paintOnScreen()TRUE | never evaluated | FALSE | never evaluated |
|| rgn.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
193 | return; never executed: return; | 0 |
194 | | - |
195 | QWidget *tlw = widget->window(); | - |
196 | QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); | - |
197 | if (!tlwExtraTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
198 | return; never executed: return; | 0 |
199 | | - |
200 | const QPoint offset = widget->mapTo(tlw, QPoint()); | - |
201 | qt_flush(widget, rgn, tlwExtra->backingStoreTracker->store, tlw, offset, 0, tlw->d_func()->maybeBackingStore()); | - |
202 | } never executed: end of block | 0 |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | | - |
208 | | - |
209 | bool QWidgetBackingStore::bltRect(const QRect &rect, int dx, int dy, QWidget *widget) | - |
210 | { | - |
211 | const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft())); | - |
212 | const QRect tlwRect(QRect(pos, rect.size())); | - |
213 | if (fullUpdatePendingTRUE | never evaluated | FALSE | never evaluated |
|| dirty.intersects(tlwRect)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
214 | return never executed: return false; false;never executed: return false; | 0 |
215 | return never executed: return store->scroll(tlwRect, dx, dy); store->scroll(tlwRect, dx, dy);never executed: return store->scroll(tlwRect, dx, dy); | 0 |
216 | } | - |
217 | | - |
218 | void QWidgetBackingStore::releaseBuffer() | - |
219 | { | - |
220 | if (storeTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
221 | store->resize(QSize()); never executed: store->resize(QSize()); | 0 |
222 | } never executed: end of block | 0 |
223 | | - |
224 | | - |
225 | | - |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
230 | void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QBackingStore *backingStore, | - |
231 | BeginPaintInfo *returnInfo, bool toCleanIsInTopLevelCoordinates) | - |
232 | { | - |
233 | (void)widget;; | - |
234 | (void)toCleanIsInTopLevelCoordinates;; | - |
235 | | - |
236 | | - |
237 | dirtyOnScreen += toClean; | - |
238 | | - |
239 | | - |
240 | | - |
241 | | - |
242 | returnInfo->wasFlushed = QWidgetBackingStore::flushPaint(tlw, toClean); | - |
243 | | - |
244 | | - |
245 | | - |
246 | | - |
247 | if (!returnInfo->wasFlushedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
248 | backingStore->beginPaint(toClean); never executed: backingStore->beginPaint(toClean); | 0 |
249 | | - |
250 | | - |
251 | (void)returnInfo;; | - |
252 | } never executed: end of block | 0 |
253 | | - |
254 | void QWidgetBackingStore::endPaint(const QRegion &cleaned, QBackingStore *backingStore, | - |
255 | BeginPaintInfo *beginPaintInfo) | - |
256 | { | - |
257 | | - |
258 | if (!beginPaintInfo->wasFlushedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
259 | backingStore->endPaint(); never executed: backingStore->endPaint(); | 0 |
260 | else | - |
261 | QWidgetBackingStore::unflushPaint(tlw, cleaned); never executed: QWidgetBackingStore::unflushPaint(tlw, cleaned); | 0 |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | flush(); | - |
269 | } never executed: end of block | 0 |
270 | | - |
271 | | - |
272 | | - |
273 | | - |
274 | | - |
275 | | - |
276 | | - |
277 | QRegion QWidgetBackingStore::dirtyRegion(QWidget *widget) const | - |
278 | { | - |
279 | const bool widgetDirty = widgetTRUE | never evaluated | FALSE | never evaluated |
&& widget != tlwTRUE | never evaluated | FALSE | never evaluated |
; | 0 |
280 | const QRect tlwRect(topLevelRect()); | - |
281 | const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); | - |
282 | if (fullUpdatePendingTRUE | never evaluated | FALSE | never evaluated |
|| (surfaceGeometry != tlwRectTRUE | never evaluated | FALSE | never evaluated |
&& surfaceGeometry.size() != tlwRect.size()TRUE | never evaluated | FALSE | never evaluated |
)) { | 0 |
283 | if (widgetDirtyTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
284 | const QRect dirtyTlwRect = QRect(QPoint(), tlwRect.size()); | - |
285 | const QPoint offset(widget->mapTo(tlw, QPoint())); | - |
286 | const QRect dirtyWidgetRect(dirtyTlwRect & widget->rect().translated(offset)); | - |
287 | return never executed: return dirtyWidgetRect.translated(-offset); dirtyWidgetRect.translated(-offset);never executed: return dirtyWidgetRect.translated(-offset); | 0 |
288 | } | - |
289 | return never executed: return QRect(QPoint(), tlwRect.size()); QRect(QPoint(), tlwRect.size());never executed: return QRect(QPoint(), tlwRect.size()); | 0 |
290 | } | - |
291 | | - |
292 | | - |
293 | QRegion r(dirty); | - |
294 | for (int i = 0; i < dirtyWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
295 | QWidget *w = dirtyWidgets.at(i); | - |
296 | if (widgetDirtyTRUE | never evaluated | FALSE | never evaluated |
&& w != widgetTRUE | never evaluated | FALSE | never evaluated |
&& !widget->isAncestorOf(w)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
297 | continue; never executed: continue; | 0 |
298 | r += w->d_func()->dirty.translated(w->mapTo(tlw, QPoint())); | - |
299 | } never executed: end of block | 0 |
300 | | - |
301 | | - |
302 | r += dirtyOnScreen; | - |
303 | | - |
304 | if (dirtyOnScreenWidgetsTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
305 | for (int i = 0; i < dirtyOnScreenWidgets->size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
306 | QWidget *w = dirtyOnScreenWidgets->at(i); | - |
307 | if (widgetDirtyTRUE | never evaluated | FALSE | never evaluated |
&& w != widgetTRUE | never evaluated | FALSE | never evaluated |
&& !widget->isAncestorOf(w)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
308 | continue; never executed: continue; | 0 |
309 | QWidgetPrivate *wd = w->d_func(); | - |
310 | ((!(wd->needsFlush)) ? qt_assert("wd->needsFlush",__FILE__,409) : qt_noop()); | - |
311 | r += wd->needsFlush->translated(w->mapTo(tlw, QPoint())); | - |
312 | } never executed: end of block | 0 |
313 | } never executed: end of block | 0 |
314 | | - |
315 | if (widgetDirtyTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
316 | | - |
317 | const QPoint offset(widget->mapTo(tlw, QPoint())); | - |
318 | r &= widget->rect().translated(offset); | - |
319 | r.translate(-offset); | - |
320 | } never executed: end of block | 0 |
321 | return never executed: return r; r;never executed: return r; | 0 |
322 | } | - |
323 | | - |
324 | | - |
325 | | - |
326 | | - |
327 | | - |
328 | | - |
329 | QRegion QWidgetBackingStore::staticContents(QWidget *parent, const QRect &withinClipRect) const | - |
330 | { | - |
331 | if (!parentTRUE | never evaluated | FALSE | never evaluated |
&& tlw->testAttribute(Qt::WA_StaticContents)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
332 | const QSize surfaceGeometry(store->size()); | - |
333 | QRect surfaceRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); | - |
334 | if (!withinClipRect.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
335 | surfaceRect &= withinClipRect; never executed: surfaceRect &= withinClipRect; | 0 |
336 | return never executed: return QRegion(surfaceRect); QRegion(surfaceRect);never executed: return QRegion(surfaceRect); | 0 |
337 | } | - |
338 | | - |
339 | QRegion region; | - |
340 | if (parentTRUE | never evaluated | FALSE | never evaluated |
&& parent->d_func()->children.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
341 | return never executed: return region; region;never executed: return region; | 0 |
342 | | - |
343 | const bool clipToRect = !withinClipRect.isEmpty(); | - |
344 | const int count = staticWidgets.count(); | - |
345 | for (int i = 0; i < countTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
346 | QWidget *w = staticWidgets.at(i); | - |
347 | QWidgetPrivate *wd = w->d_func(); | - |
348 | if (!wd->isOpaqueTRUE | never evaluated | FALSE | never evaluated |
|| !wd->extraTRUE | never evaluated | FALSE | never evaluated |
|| wd->extra->staticContentsSize.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
| 0 |
349 | || !w->isVisible()TRUE | never evaluated | FALSE | never evaluated |
|| (parentTRUE | never evaluated | FALSE | never evaluated |
&& !parent->isAncestorOf(w)TRUE | never evaluated | FALSE | never evaluated |
)) { | 0 |
350 | continue; never executed: continue; | 0 |
351 | } | - |
352 | | - |
353 | QRect rect(0, 0, wd->extra->staticContentsSize.width(), wd->extra->staticContentsSize.height()); | - |
354 | const QPoint offset = w->mapTo(parent ? parent : tlw, QPoint()); | - |
355 | if (clipToRectTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
356 | rect &= withinClipRect.translated(-offset); never executed: rect &= withinClipRect.translated(-offset); | 0 |
357 | if (rect.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
358 | continue; never executed: continue; | 0 |
359 | | - |
360 | rect &= wd->clipRect(); | - |
361 | if (rect.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
362 | continue; never executed: continue; | 0 |
363 | | - |
364 | QRegion visible(rect); | - |
365 | wd->clipToEffectiveMask(visible); | - |
366 | if (visible.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
367 | continue; never executed: continue; | 0 |
368 | wd->subtractOpaqueSiblings(visible, 0, true); | - |
369 | | - |
370 | visible.translate(offset); | - |
371 | region += visible; | - |
372 | } never executed: end of block | 0 |
373 | | - |
374 | return never executed: return region; region;never executed: return region; | 0 |
375 | } | - |
376 | | - |
377 | void QWidgetBackingStore::sendUpdateRequest(QWidget *widget, UpdateTime updateTime) | - |
378 | { | - |
379 | if (!widgetTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
380 | return; never executed: return; | 0 |
381 | | - |
382 | | - |
383 | | - |
384 | | - |
385 | | - |
386 | | - |
387 | QWidget *w = widget->window(); | - |
388 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
&& wTRUE | never evaluated | FALSE | never evaluated |
&& w->windowHandle()TRUE | never evaluated | FALSE | never evaluated |
&& QWindowPrivate::get(w->windowHandle())->compositingTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
389 | int refresh = 60; | - |
390 | QScreen *ws = w->windowHandle()->screen(); | - |
391 | if (wsTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
392 | refresh = ws->refreshRate(); never executed: refresh = ws->refreshRate(); | 0 |
393 | QWindowPrivate *wd = QWindowPrivate::get(w->windowHandle()); | - |
394 | if (wd->lastComposeTime.isValid()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
395 | const qint64 elapsed = wd->lastComposeTime.elapsed(); | - |
396 | if (elapsed <= qint64(1000.0f / refresh)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
397 | updateTime = UpdateLater; never executed: updateTime = UpdateLater; | 0 |
398 | } never executed: end of block | 0 |
399 | } never executed: end of block | 0 |
400 | | - |
401 | | - |
402 | switch (updateTime) { | - |
403 | case never executed: case UpdateLater: UpdateLater:never executed: case UpdateLater: | 0 |
404 | updateRequestSent = true; | - |
405 | QApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority); | - |
406 | break; never executed: break; | 0 |
407 | case never executed: case UpdateNow: UpdateNow:never executed: case UpdateNow: { | 0 |
408 | QEvent event(QEvent::UpdateRequest); | - |
409 | QApplication::sendEvent(widget, &event); | - |
410 | break; never executed: break; | 0 |
411 | } | - |
412 | } | - |
413 | } never executed: end of block | 0 |
414 | void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, | - |
415 | UpdateTime updateTime, BufferState bufferState) | - |
416 | { | - |
417 | ((!(tlw->d_func()->extra)) ? qt_assert("tlw->d_func()->extra",__FILE__,530) : qt_noop()); | - |
418 | ((!(tlw->d_func()->extra->topextra)) ? qt_assert("tlw->d_func()->extra->topextra",__FILE__,531) : qt_noop()); | - |
419 | ((!(!tlw->d_func()->extra->topextra->inTopLevelResize)) ? qt_assert("!tlw->d_func()->extra->topextra->inTopLevelResize",__FILE__,532) : qt_noop()); | - |
420 | ((!(widget->isVisible() && widget->updatesEnabled())) ? qt_assert("widget->isVisible() && widget->updatesEnabled()",__FILE__,533) : qt_noop()); | - |
421 | ((!(widget->window() == tlw)) ? qt_assert("widget->window() == tlw",__FILE__,534) : qt_noop()); | - |
422 | ((!(!rgn.isEmpty())) ? qt_assert("!rgn.isEmpty()",__FILE__,535) : qt_noop()); | - |
423 | | - |
424 | | - |
425 | widget->d_func()->invalidateGraphicsEffectsRecursively(); | - |
426 | | - |
427 | | - |
428 | if (widget->d_func()->paintOnScreen()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
429 | if (widget->d_func()->dirty.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
430 | widget->d_func()->dirty = rgn; | - |
431 | sendUpdateRequest(widget, updateTime); | - |
432 | return; never executed: return; | 0 |
433 | } else if (qt_region_strictContains(widget->d_func()->dirty, widget->rect())TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
434 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
435 | sendUpdateRequest(widget, updateTime); never executed: sendUpdateRequest(widget, updateTime); | 0 |
436 | return; never executed: return; | 0 |
437 | } | - |
438 | | - |
439 | const bool eventAlreadyPosted = !widget->d_func()->dirty.isEmpty(); | - |
440 | widget->d_func()->dirty += rgn; | - |
441 | if (!eventAlreadyPostedTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
442 | sendUpdateRequest(widget, updateTime); never executed: sendUpdateRequest(widget, updateTime); | 0 |
443 | return; never executed: return; | 0 |
444 | } | - |
445 | | - |
446 | | - |
447 | if (fullUpdatePendingTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
448 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
449 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
450 | return; never executed: return; | 0 |
451 | } | - |
452 | | - |
453 | const QPoint offset = widget->mapTo(tlw, QPoint()); | - |
454 | | - |
455 | if (QWidgetPrivate::get(widget)->renderToTextureTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
456 | if (!widget->d_func()->inDirtyListTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
457 | addDirtyRenderToTextureWidget(widget); never executed: addDirtyRenderToTextureWidget(widget); | 0 |
458 | if (!updateRequestSentTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
459 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
460 | return; never executed: return; | 0 |
461 | } | - |
462 | | - |
463 | const QRect widgetRect = widget->d_func()->effectiveRectFor(widget->rect()); | - |
464 | if (qt_region_strictContains(dirty, widgetRect.translated(offset))TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
465 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
466 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
467 | return; never executed: return; | 0 |
468 | } | - |
469 | | - |
470 | if (bufferState == BufferInvalidTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
471 | const bool eventAlreadyPosted = !dirty.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
|| updateRequestSentTRUE | never evaluated | FALSE | never evaluated |
; | 0 |
472 | | - |
473 | if (widget->d_func()->graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
474 | dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset); never executed: dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset); | 0 |
475 | else | - |
476 | | - |
477 | dirty += rgn.translated(offset); never executed: dirty += rgn.translated(offset); | 0 |
478 | if (!eventAlreadyPostedTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
479 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
480 | return; never executed: return; | 0 |
481 | } | - |
482 | | - |
483 | if (dirtyWidgets.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
484 | addDirtyWidget(widget, rgn); | - |
485 | sendUpdateRequest(tlw, updateTime); | - |
486 | return; never executed: return; | 0 |
487 | } | - |
488 | | - |
489 | if (widget->d_func()->inDirtyListTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
490 | if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
491 | | - |
492 | if (widget->d_func()->graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
493 | widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()); never executed: widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()); | 0 |
494 | else | - |
495 | | - |
496 | widget->d_func()->dirty += rgn; never executed: widget->d_func()->dirty += rgn; | 0 |
497 | } | - |
498 | } never executed: end of block else { | 0 |
499 | addDirtyWidget(widget, rgn); | - |
500 | } never executed: end of block | 0 |
501 | | - |
502 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
503 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
504 | } never executed: end of block | 0 |
505 | void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget, | - |
506 | UpdateTime updateTime, BufferState bufferState) | - |
507 | { | - |
508 | ((!(tlw->d_func()->extra)) ? qt_assert("tlw->d_func()->extra",__FILE__,629) : qt_noop()); | - |
509 | ((!(tlw->d_func()->extra->topextra)) ? qt_assert("tlw->d_func()->extra->topextra",__FILE__,630) : qt_noop()); | - |
510 | ((!(!tlw->d_func()->extra->topextra->inTopLevelResize)) ? qt_assert("!tlw->d_func()->extra->topextra->inTopLevelResize",__FILE__,631) : qt_noop()); | - |
511 | ((!(widget->isVisible() && widget->updatesEnabled())) ? qt_assert("widget->isVisible() && widget->updatesEnabled()",__FILE__,632) : qt_noop()); | - |
512 | ((!(widget->window() == tlw)) ? qt_assert("widget->window() == tlw",__FILE__,633) : qt_noop()); | - |
513 | ((!(!rect.isEmpty())) ? qt_assert("!rect.isEmpty()",__FILE__,634) : qt_noop()); | - |
514 | | - |
515 | | - |
516 | widget->d_func()->invalidateGraphicsEffectsRecursively(); | - |
517 | | - |
518 | | - |
519 | if (widget->d_func()->paintOnScreen()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
520 | if (widget->d_func()->dirty.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
521 | widget->d_func()->dirty = QRegion(rect); | - |
522 | sendUpdateRequest(widget, updateTime); | - |
523 | return; never executed: return; | 0 |
524 | } else if (qt_region_strictContains(widget->d_func()->dirty, rect)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
525 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
526 | sendUpdateRequest(widget, updateTime); never executed: sendUpdateRequest(widget, updateTime); | 0 |
527 | return; never executed: return; | 0 |
528 | } | - |
529 | | - |
530 | const bool eventAlreadyPosted = !widget->d_func()->dirty.isEmpty(); | - |
531 | widget->d_func()->dirty += rect; | - |
532 | if (!eventAlreadyPostedTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
533 | sendUpdateRequest(widget, updateTime); never executed: sendUpdateRequest(widget, updateTime); | 0 |
534 | return; never executed: return; | 0 |
535 | } | - |
536 | | - |
537 | if (fullUpdatePendingTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
538 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
539 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
540 | return; never executed: return; | 0 |
541 | } | - |
542 | | - |
543 | if (QWidgetPrivate::get(widget)->renderToTextureTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
544 | if (!widget->d_func()->inDirtyListTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
545 | addDirtyRenderToTextureWidget(widget); never executed: addDirtyRenderToTextureWidget(widget); | 0 |
546 | if (!updateRequestSentTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
547 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
548 | return; never executed: return; | 0 |
549 | } | - |
550 | | - |
551 | | - |
552 | const QRect widgetRect = widget->d_func()->effectiveRectFor(rect); | - |
553 | QRect translatedRect = widgetRect; | - |
554 | if (widget != tlwTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
555 | translatedRect.translate(widget->mapTo(tlw, QPoint())); never executed: translatedRect.translate(widget->mapTo(tlw, QPoint())); | 0 |
556 | | - |
557 | translatedRect = translatedRect.intersected(QRect(QPoint(), tlw->size())); | - |
558 | if (qt_region_strictContains(dirty, translatedRect)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
559 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
560 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
561 | return; never executed: return; | 0 |
562 | } | - |
563 | | - |
564 | if (bufferState == BufferInvalidTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
565 | const bool eventAlreadyPosted = !dirty.isEmpty(); | - |
566 | dirty += translatedRect; | - |
567 | if (!eventAlreadyPostedTRUE | never evaluated | FALSE | never evaluated |
|| updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
568 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
569 | return; never executed: return; | 0 |
570 | } | - |
571 | | - |
572 | if (dirtyWidgets.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
573 | addDirtyWidget(widget, rect); | - |
574 | sendUpdateRequest(tlw, updateTime); | - |
575 | return; never executed: return; | 0 |
576 | } | - |
577 | | - |
578 | if (widget->d_func()->inDirtyListTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
579 | if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
580 | widget->d_func()->dirty += widgetRect; never executed: widget->d_func()->dirty += widgetRect; | 0 |
581 | } never executed: end of block else { | 0 |
582 | addDirtyWidget(widget, rect); | - |
583 | } never executed: end of block | 0 |
584 | | - |
585 | if (updateTime == UpdateNowTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
586 | sendUpdateRequest(tlw, updateTime); never executed: sendUpdateRequest(tlw, updateTime); | 0 |
587 | } never executed: end of block | 0 |
588 | | - |
589 | | - |
590 | | - |
591 | | - |
592 | | - |
593 | | - |
594 | | - |
595 | void QWidgetBackingStore::markDirtyOnScreen(const QRegion ®ion, QWidget *widget, const QPoint &topLevelOffset) | - |
596 | { | - |
597 | if (!widgetTRUE | never evaluated | FALSE | never evaluated |
|| widget->d_func()->paintOnScreen()TRUE | never evaluated | FALSE | never evaluated |
|| region.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
598 | return; never executed: return; | 0 |
599 | if (widget == tlwTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
600 | if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
601 | dirtyOnScreen += region; never executed: dirtyOnScreen += region; | 0 |
602 | return; never executed: return; | 0 |
603 | } | - |
604 | | - |
605 | | - |
606 | if (!widget->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
&& !widget->isWindow()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
607 | QWidget *nativeParent = widget->nativeParentWidget(); | - |
608 | if (nativeParent == tlwTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
609 | if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
610 | dirtyOnScreen += region.translated(topLevelOffset); never executed: dirtyOnScreen += region.translated(topLevelOffset); | 0 |
611 | return; never executed: return; | 0 |
612 | } | - |
613 | | - |
614 | | - |
615 | QWidgetPrivate *nativeParentPrivate = nativeParent->d_func(); | - |
616 | if (!nativeParentPrivate->needsFlushTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
617 | nativeParentPrivate->needsFlush = new QRegion; never executed: nativeParentPrivate->needsFlush = new QRegion; | 0 |
618 | const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint()); | - |
619 | *nativeParentPrivate->needsFlush += region.translated(nativeParentOffset); | - |
620 | appendDirtyOnScreenWidget(nativeParent); | - |
621 | return; never executed: return; | 0 |
622 | } | - |
623 | | - |
624 | | - |
625 | QWidgetPrivate *widgetPrivate = widget->d_func(); | - |
626 | if (!widgetPrivate->needsFlushTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
627 | widgetPrivate->needsFlush = new QRegion; never executed: widgetPrivate->needsFlush = new QRegion; | 0 |
628 | *widgetPrivate->needsFlush += region; | - |
629 | appendDirtyOnScreenWidget(widget); | - |
630 | } never executed: end of block | 0 |
631 | | - |
632 | void QWidgetBackingStore::removeDirtyWidget(QWidget *w) | - |
633 | { | - |
634 | if (!wTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
635 | return; never executed: return; | 0 |
636 | | - |
637 | dirtyWidgetsRemoveAll(w); | - |
638 | dirtyOnScreenWidgetsRemoveAll(w); | - |
639 | dirtyRenderToTextureWidgets.removeAll(w); | - |
640 | resetWidget(w); | - |
641 | | - |
642 | QWidgetPrivate *wd = w->d_func(); | - |
643 | const int n = wd->children.count(); | - |
644 | for (int i = 0; i < nTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
645 | if (QWidget *child = qobject_cast<QWidget*>(wd->children.at(i))TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
646 | removeDirtyWidget(child); never executed: removeDirtyWidget(child); | 0 |
647 | } never executed: end of block | 0 |
648 | } never executed: end of block | 0 |
649 | | - |
650 | void QWidgetBackingStore::updateLists(QWidget *cur) | - |
651 | { | - |
652 | if (!curTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
653 | return; never executed: return; | 0 |
654 | | - |
655 | QList<QObject*> children = cur->children(); | - |
656 | for (int i = 0; i < children.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
657 | QWidget *child = qobject_cast<QWidget*>(children.at(i)); | - |
658 | if (!childTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
659 | continue; never executed: continue; | 0 |
660 | | - |
661 | updateLists(child); | - |
662 | } never executed: end of block | 0 |
663 | | - |
664 | if (cur->testAttribute(Qt::WA_StaticContents)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
665 | addStaticWidget(cur); never executed: addStaticWidget(cur); | 0 |
666 | } never executed: end of block | 0 |
667 | | - |
668 | QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel) | - |
669 | : tlw(topLevel), | - |
670 | dirtyOnScreenWidgets(0), | - |
671 | fullUpdatePending(0), | - |
672 | updateRequestSent(0), | - |
673 | textureListWatcher(0), | - |
674 | perfFrames(0) | - |
675 | { | - |
676 | store = tlw->backingStore(); | - |
677 | ((!(store)) ? qt_assert("store",__FILE__,806) : qt_noop()); | - |
678 | | - |
679 | | - |
680 | updateLists(topLevel); | - |
681 | } never executed: end of block | 0 |
682 | | - |
683 | QWidgetBackingStore::~QWidgetBackingStore() | - |
684 | { | - |
685 | for (int c = 0; c < dirtyWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++c) | 0 |
686 | resetWidget(dirtyWidgets.at(c)); never executed: resetWidget(dirtyWidgets.at(c)); | 0 |
687 | for (int c = 0; c < dirtyRenderToTextureWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++c) | 0 |
688 | resetWidget(dirtyRenderToTextureWidgets.at(c)); never executed: resetWidget(dirtyRenderToTextureWidgets.at(c)); | 0 |
689 | | - |
690 | delete dirtyOnScreenWidgets; | - |
691 | } never executed: end of block | 0 |
692 | | - |
693 | | - |
694 | | - |
695 | void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) | - |
696 | { | - |
697 | QWidget * const q = q_func(); | - |
698 | if (!q->isVisible()TRUE | never evaluated | FALSE | never evaluated |
|| (dx == 0TRUE | never evaluated | FALSE | never evaluated |
&& dy == 0TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
699 | return; never executed: return; | 0 |
700 | | - |
701 | QWidget *tlw = q->window(); | - |
702 | QTLWExtra* x = tlw->d_func()->topData(); | - |
703 | if (x->inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
704 | return; never executed: return; | 0 |
705 | | - |
706 | static const bool accelEnv = qEnvironmentVariableIntValue("QT_NO_FAST_MOVE") == 0; | - |
707 | | - |
708 | QWidget *pw = q->parentWidget(); | - |
709 | QPoint toplevelOffset = pw->mapTo(tlw, QPoint()); | - |
710 | QWidgetPrivate *pd = pw->d_func(); | - |
711 | QRect clipR(pd->clipRect()); | - |
712 | const QRect newRect(rect.translated(dx, dy)); | - |
713 | QRect destRect = rect.intersected(clipR); | - |
714 | if (destRect.isValid()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
715 | destRect = destRect.translated(dx, dy).intersected(clipR); never executed: destRect = destRect.translated(dx, dy).intersected(clipR); | 0 |
716 | const QRect sourceRect(destRect.translated(-dx, -dy)); | - |
717 | const QRect parentRect(rect & clipR); | - |
718 | const bool nativeWithTextureChild = textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
&& q->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
; | 0 |
719 | | - |
720 | bool accelerateMove = accelEnvTRUE | never evaluated | FALSE | never evaluated |
&& isOpaqueTRUE | never evaluated | FALSE | never evaluated |
&& !nativeWithTextureChildTRUE | never evaluated | FALSE | never evaluated |
| 0 |
721 | | - |
722 | | - |
723 | && !tlw->d_func()->extra->proxyWidgetTRUE | never evaluated | FALSE | never evaluated |
| 0 |
724 | | - |
725 | && !isOverlapped(sourceRect)TRUE | never evaluated | FALSE | never evaluated |
&& !isOverlapped(destRect)TRUE | never evaluated | FALSE | never evaluated |
; | 0 |
726 | | - |
727 | if (!accelerateMoveTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
728 | QRegion parentR(effectiveRectFor(parentRect)); | - |
729 | if (!extraTRUE | never evaluated | FALSE | never evaluated |
|| !extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
730 | parentR -= newRect; | - |
731 | } never executed: end of block else { | 0 |
732 | | - |
733 | parentR += newRect & clipR; | - |
734 | } never executed: end of block | 0 |
735 | pd->invalidateBuffer(parentR); | - |
736 | invalidateBuffer((newRect & clipR).translated(-data.crect.topLeft())); | - |
737 | } never executed: end of block else { | 0 |
738 | | - |
739 | QWidgetBackingStore *wbs = x->backingStoreTracker.data(); | - |
740 | QRegion childExpose(newRect & clipR); | - |
741 | | - |
742 | if (sourceRect.isValid()TRUE | never evaluated | FALSE | never evaluated |
&& wbs->bltRect(sourceRect, dx, dy, pw)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
743 | childExpose -= destRect; never executed: childExpose -= destRect; | 0 |
744 | | - |
745 | if (!pw->updatesEnabled()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
746 | return; never executed: return; | 0 |
747 | | - |
748 | const bool childUpdatesEnabled = q->updatesEnabled(); | - |
749 | if (childUpdatesEnabledTRUE | never evaluated | FALSE | never evaluated |
&& !childExpose.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
750 | childExpose.translate(-data.crect.topLeft()); | - |
751 | wbs->markDirty(childExpose, q); | - |
752 | isMoved = true; | - |
753 | } never executed: end of block | 0 |
754 | | - |
755 | QRegion parentExpose(parentRect); | - |
756 | parentExpose -= newRect; | - |
757 | if (extraTRUE | never evaluated | FALSE | never evaluated |
&& extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
758 | parentExpose += QRegion(newRect) - extra->mask.translated(data.crect.topLeft()); never executed: parentExpose += QRegion(newRect) - extra->mask.translated(data.crect.topLeft()); | 0 |
759 | | - |
760 | if (!parentExpose.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
761 | wbs->markDirty(parentExpose, pw); | - |
762 | pd->isMoved = true; | - |
763 | } never executed: end of block | 0 |
764 | | - |
765 | if (childUpdatesEnabledTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
766 | QRegion needsFlush(sourceRect); | - |
767 | needsFlush += destRect; | - |
768 | wbs->markDirtyOnScreen(needsFlush, pw, toplevelOffset); | - |
769 | } never executed: end of block | 0 |
770 | } never executed: end of block | 0 |
771 | } | - |
772 | | - |
773 | | - |
774 | void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) | - |
775 | { | - |
776 | QWidget * const q = q_func(); | - |
777 | QWidget *tlw = q->window(); | - |
778 | QTLWExtra* x = tlw->d_func()->topData(); | - |
779 | if (x->inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
780 | return; never executed: return; | 0 |
781 | | - |
782 | QWidgetBackingStore *wbs = x->backingStoreTracker.data(); | - |
783 | if (!wbsTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
784 | return; never executed: return; | 0 |
785 | | - |
786 | static const bool accelEnv = qEnvironmentVariableIntValue("QT_NO_FAST_SCROLL") == 0; | - |
787 | | - |
788 | QRect scrollRect = rect & clipRect(); | - |
789 | bool overlapped = false; | - |
790 | bool accelerateScroll = accelEnvTRUE | never evaluated | FALSE | never evaluated |
&& isOpaqueTRUE | never evaluated | FALSE | never evaluated |
&& !q_func()->testAttribute(Qt::WA_WState_InPaintEvent)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
791 | && !(overlapped = isOverlapped(scrollRect.translated(data.crect.topLeft())))TRUE | never evaluated | FALSE | never evaluated |
; | 0 |
792 | | - |
793 | if (!accelerateScrollTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
794 | if (overlappedTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
795 | QRegion region(scrollRect); | - |
796 | subtractOpaqueSiblings(region); | - |
797 | invalidateBuffer(region); | - |
798 | } never executed: end of block else { | 0 |
799 | invalidateBuffer(scrollRect); | - |
800 | } never executed: end of block | 0 |
801 | } else { | - |
802 | const QPoint toplevelOffset = q->mapTo(tlw, QPoint()); | - |
803 | const QRect destRect = scrollRect.translated(dx, dy) & scrollRect; | - |
804 | const QRect sourceRect = destRect.translated(-dx, -dy); | - |
805 | | - |
806 | QRegion childExpose(scrollRect); | - |
807 | if (sourceRect.isValid()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
808 | if (wbs->bltRect(sourceRect, dx, dy, q)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
809 | childExpose -= destRect; never executed: childExpose -= destRect; | 0 |
810 | } never executed: end of block | 0 |
811 | | - |
812 | if (inDirtyListTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
813 | if (rect == q->rect()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
814 | dirty.translate(dx, dy); | - |
815 | } never executed: end of block else { | 0 |
816 | QRegion dirtyScrollRegion = dirty.intersected(scrollRect); | - |
817 | if (!dirtyScrollRegion.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
818 | dirty -= dirtyScrollRegion; | - |
819 | dirtyScrollRegion.translate(dx, dy); | - |
820 | dirty += dirtyScrollRegion; | - |
821 | } never executed: end of block | 0 |
822 | } never executed: end of block | 0 |
823 | } | - |
824 | | - |
825 | if (!q->updatesEnabled()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
826 | return; never executed: return; | 0 |
827 | | - |
828 | if (!childExpose.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
829 | wbs->markDirty(childExpose, q); | - |
830 | isScrolled = true; | - |
831 | } never executed: end of block | 0 |
832 | | - |
833 | | - |
834 | | - |
835 | | - |
836 | wbs->markDirtyOnScreen(destRect, q, toplevelOffset); | - |
837 | } never executed: end of block | 0 |
838 | } | - |
839 | | - |
840 | | - |
841 | static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures, QVector<QWidget *> *nativeChildren) | - |
842 | { | - |
843 | QWidgetPrivate *wd = QWidgetPrivate::get(widget); | - |
844 | if (wd->renderToTextureTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
845 | QPlatformTextureList::Flags flags = 0; | - |
846 | if (widget->testAttribute(Qt::WA_AlwaysStackOnTop)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
847 | flags |= QPlatformTextureList::StacksOnTop; never executed: flags |= QPlatformTextureList::StacksOnTop; | 0 |
848 | const QRect rect(widget->mapTo(tlw, QPoint()), widget->size()); | - |
849 | widgetTextures->appendTexture(widget, wd->textureId(), rect, wd->clipRect(), flags); | - |
850 | } never executed: end of block | 0 |
851 | | - |
852 | for (int i = 0; i < wd->children.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
853 | QWidget *w = qobject_cast<QWidget *>(wd->children.at(i)); | - |
854 | | - |
855 | if (wTRUE | never evaluated | FALSE | never evaluated |
&& !w->isWindow()TRUE | never evaluated | FALSE | never evaluated |
&& w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
856 | nativeChildren->append(w); never executed: nativeChildren->append(w); | 0 |
857 | if (wTRUE | never evaluated | FALSE | never evaluated |
&& !w->isWindow()TRUE | never evaluated | FALSE | never evaluated |
&& !w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
&& !w->isHidden()TRUE | never evaluated | FALSE | never evaluated |
&& QWidgetPrivate::get(w)->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
858 | findTextureWidgetsRecursively(tlw, w, widgetTextures, nativeChildren); never executed: findTextureWidgetsRecursively(tlw, w, widgetTextures, nativeChildren); | 0 |
859 | } never executed: end of block | 0 |
860 | } never executed: end of block | 0 |
861 | | - |
862 | static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget) | - |
863 | { | - |
864 | | - |
865 | if (QWidgetPrivate::get(widget)->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
866 | QVector<QWidget *> nativeChildren; | - |
867 | QScopedPointer<QPlatformTextureList> tl(new QPlatformTextureList); | - |
868 | | - |
869 | | - |
870 | findTextureWidgetsRecursively(tlw, widget, tl.data(), &nativeChildren); | - |
871 | | - |
872 | if (!tl->isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
873 | QWidgetPrivate::get(tlw)->topData()->widgetTextures.append(tl.take()); never executed: QWidgetPrivate::get(tlw)->topData()->widgetTextures.append(tl.take()); | 0 |
874 | | - |
875 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(nativeChildren)>::type> _container_((nativeChildren)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QWidget *ncw = *_container_.i; _container_.control; _container_.control = 0) { | - |
876 | if (QWidgetPrivate::get(ncw)->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
877 | findAllTextureWidgetsRecursively(tlw, ncw); never executed: findAllTextureWidgetsRecursively(tlw, ncw); | 0 |
878 | } never executed: end of block | 0 |
879 | } never executed: end of block | 0 |
880 | } never executed: end of block | 0 |
881 | | - |
882 | static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) | - |
883 | { | - |
884 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(QWidgetPrivate::get(tlw)->topData()->widgetTextures)>::type> _container_((QWidgetPrivate::get(tlw)->topData()->widgetTextures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QPlatformTextureList *tl = *_container_.i; _container_.control; _container_.control = 0) { | - |
885 | ((!(!tl->isEmpty())) ? qt_assert("!tl->isEmpty()",__FILE__,1014) : qt_noop()); | - |
886 | for (int i = 0; i < tl->count()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
887 | QWidget *w = static_cast<QWidget *>(tl->source(i)); | - |
888 | if ((w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
&& w == widgetTRUE | never evaluated | FALSE | never evaluated |
) || (!w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
&& w->nativeParentWidget() == widgetTRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
889 | return never executed: return tl; tl;never executed: return tl; | 0 |
890 | } never executed: end of block | 0 |
891 | } never executed: end of block | 0 |
892 | | - |
893 | if (QWidgetPrivate::get(tlw)->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
894 | | - |
895 | | - |
896 | | - |
897 | | - |
898 | | - |
899 | static bool switchableWidgetComposition = | - |
900 | QGuiApplicationPrivate::instance()->platformIntegration() | - |
901 | ->hasCapability(QPlatformIntegration::SwitchableWidgetComposition); | - |
902 | if (!switchableWidgetCompositionTRUE | never evaluated | FALSE | never evaluated |
| 0 |
903 | ) | - |
904 | { | - |
905 | return never executed: return qt_dummy_platformTextureList(); qt_dummy_platformTextureList();never executed: return qt_dummy_platformTextureList(); | 0 |
906 | } | - |
907 | } never executed: end of block | 0 |
908 | | - |
909 | return never executed: return 0; 0;never executed: return 0; | 0 |
910 | } | - |
911 | | - |
912 | | - |
913 | | - |
914 | | - |
915 | | - |
916 | | - |
917 | QPlatformTextureListWatcher::QPlatformTextureListWatcher(QWidgetBackingStore *backingStore) | - |
918 | : m_backingStore(backingStore) | - |
919 | { | - |
920 | } never executed: end of block | 0 |
921 | | - |
922 | void QPlatformTextureListWatcher::watch(QPlatformTextureList *textureList) | - |
923 | { | - |
924 | connect(textureList, qFlagLocation("2""locked(bool)" "\0" __FILE__ ":" "1062"), qFlagLocation("1""onLockStatusChanged(bool)" "\0" __FILE__ ":" "1062")); | - |
925 | m_locked[textureList] = textureList->isLocked(); | - |
926 | } never executed: end of block | 0 |
927 | | - |
928 | bool QPlatformTextureListWatcher::isLocked() const | - |
929 | { | - |
930 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(m_locked)>::type> _container_((m_locked)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (bool v = *_container_.i; _container_.control; _container_.control = 0) { | - |
931 | if (vTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
932 | return never executed: return true; true;never executed: return true; | 0 |
933 | } never executed: end of block | 0 |
934 | return never executed: return false; false;never executed: return false; | 0 |
935 | } | - |
936 | | - |
937 | void QPlatformTextureListWatcher::onLockStatusChanged(bool locked) | - |
938 | { | - |
939 | QPlatformTextureList *tl = static_cast<QPlatformTextureList *>(sender()); | - |
940 | m_locked[tl] = locked; | - |
941 | if (!isLocked()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
942 | m_backingStore->sync(); never executed: m_backingStore->sync(); | 0 |
943 | } never executed: end of block | 0 |
944 | static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra) | - |
945 | { | - |
946 | if (!tlwTRUE | never evaluated | FALSE | never evaluated |
|| !tlwExtraTRUE | never evaluated | FALSE | never evaluated |
|| !tlw->testAttribute(Qt::WA_Mapped)TRUE | never evaluated | FALSE | never evaluated |
|| !tlw->isVisible()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
947 | return never executed: return true; true;never executed: return true; | 0 |
948 | | - |
949 | return never executed: return false; false;never executed: return false; | 0 |
950 | } | - |
951 | | - |
952 | bool QWidgetBackingStore::syncAllowed() | - |
953 | { | - |
954 | | - |
955 | QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); | - |
956 | if (textureListWatcherTRUE | never evaluated | FALSE | never evaluated |
&& !textureListWatcher->isLocked()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
957 | textureListWatcher->deleteLater(); | - |
958 | textureListWatcher = 0; | - |
959 | } never executed: end of block else if (!tlwExtra->widgetTextures.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
960 | bool skipSync = false; | - |
961 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(tlwExtra->widgetTextures)>::type> _container_((tlwExtra->widgetTextures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QPlatformTextureList *tl = *_container_.i; _container_.control; _container_.control = 0) { | - |
962 | if (tl->isLocked()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
963 | if (!textureListWatcherTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
964 | textureListWatcher = new QPlatformTextureListWatcher(this); never executed: textureListWatcher = new QPlatformTextureListWatcher(this); | 0 |
965 | if (!textureListWatcher->isLocked()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
966 | textureListWatcher->watch(tl); never executed: textureListWatcher->watch(tl); | 0 |
967 | skipSync = true; | - |
968 | } never executed: end of block | 0 |
969 | } never executed: end of block | 0 |
970 | if (skipSyncTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
971 | return never executed: return false; false;never executed: return false; | 0 |
972 | } never executed: end of block | 0 |
973 | | - |
974 | return never executed: return true; true;never executed: return true; | 0 |
975 | } | - |
976 | void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedRegion) | - |
977 | { | - |
978 | QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); | - |
979 | if (!tlw->isVisible()TRUE | never evaluated | FALSE | never evaluated |
|| !tlwExtraTRUE | never evaluated | FALSE | never evaluated |
|| tlwExtra->inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
980 | return; never executed: return; | 0 |
981 | | - |
982 | if (!exposedWidgetTRUE | never evaluated | FALSE | never evaluated |
|| !exposedWidget->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
|| !exposedWidget->isVisible()TRUE | never evaluated | FALSE | never evaluated |
|| !exposedWidget->testAttribute(Qt::WA_Mapped)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
983 | || !exposedWidget->updatesEnabled()TRUE | never evaluated | FALSE | never evaluated |
|| exposedRegion.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
984 | return; never executed: return; | 0 |
985 | } | - |
986 | | - |
987 | | - |
988 | if (!isDirty()TRUE | never evaluated | FALSE | never evaluated |
&& store->size().isValid()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
989 | QPlatformTextureList *tl = widgetTexturesFor(tlw, exposedWidget); | - |
990 | qt_flush(exposedWidget, tl ? QRegion() : exposedRegion, store, tlw, tlwOffset, tl, this); | - |
991 | return; never executed: return; | 0 |
992 | } | - |
993 | | - |
994 | if (exposedWidget != tlwTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
995 | markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint())); never executed: markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint())); | 0 |
996 | else | - |
997 | markDirtyOnScreen(exposedRegion, exposedWidget, QPoint()); never executed: markDirtyOnScreen(exposedRegion, exposedWidget, QPoint()); | 0 |
998 | | - |
999 | if (syncAllowed()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1000 | doSync(); never executed: doSync(); | 0 |
1001 | } never executed: end of block | 0 |
1002 | | - |
1003 | | - |
1004 | | - |
1005 | | - |
1006 | void QWidgetBackingStore::sync() | - |
1007 | { | - |
1008 | updateRequestSent = false; | - |
1009 | QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); | - |
1010 | if (discardSyncRequest(tlw, tlwExtra)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1011 | | - |
1012 | | - |
1013 | | - |
1014 | | - |
1015 | | - |
1016 | if (!tlw->isVisible()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1017 | dirty = QRegion(); | - |
1018 | for (int i = 0; i < dirtyWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) | 0 |
1019 | resetWidget(dirtyWidgets.at(i)); never executed: resetWidget(dirtyWidgets.at(i)); | 0 |
1020 | dirtyWidgets.clear(); | - |
1021 | fullUpdatePending = false; | - |
1022 | } never executed: end of block | 0 |
1023 | return; never executed: return; | 0 |
1024 | } | - |
1025 | | - |
1026 | if (syncAllowed()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1027 | doSync(); never executed: doSync(); | 0 |
1028 | } never executed: end of block | 0 |
1029 | | - |
1030 | void QWidgetBackingStore::doSync() | - |
1031 | { | - |
1032 | const bool updatesDisabled = !tlw->updatesEnabled(); | - |
1033 | bool repaintAllWidgets = false; | - |
1034 | | - |
1035 | const bool inTopLevelResize = tlw->d_func()->maybeTopData()->inTopLevelResize; | - |
1036 | const QRect tlwRect(topLevelRect()); | - |
1037 | const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); | - |
1038 | if ((fullUpdatePendingTRUE | never evaluated | FALSE | never evaluated |
|| inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
|| surfaceGeometry.size() != tlwRect.size()TRUE | never evaluated | FALSE | never evaluated |
) && !updatesDisabledTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1039 | if (hasStaticContents()TRUE | never evaluated | FALSE | never evaluated |
&& !store->size().isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1040 | | - |
1041 | const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); | - |
1042 | const QRegion staticRegion(staticContents(0, clipRect)); | - |
1043 | QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height()); | - |
1044 | newVisible -= staticRegion; | - |
1045 | dirty += newVisible; | - |
1046 | store->setStaticContents(staticRegion); | - |
1047 | } never executed: end of block else { | 0 |
1048 | | - |
1049 | dirty = QRegion(0, 0, tlwRect.width(), tlwRect.height()); | - |
1050 | for (int i = 0; i < dirtyWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) | 0 |
1051 | resetWidget(dirtyWidgets.at(i)); never executed: resetWidget(dirtyWidgets.at(i)); | 0 |
1052 | dirtyWidgets.clear(); | - |
1053 | repaintAllWidgets = true; | - |
1054 | } never executed: end of block | 0 |
1055 | } | - |
1056 | | - |
1057 | if (inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
|| surfaceGeometry.size() != tlwRect.size()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1058 | store->resize(tlwRect.size()); never executed: store->resize(tlwRect.size()); | 0 |
1059 | | - |
1060 | if (updatesDisabledTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1061 | return; never executed: return; | 0 |
1062 | | - |
1063 | | - |
1064 | QRegion toClean(dirty); | - |
1065 | | - |
1066 | | - |
1067 | | - |
1068 | | - |
1069 | | - |
1070 | QVarLengthArray<QWidget *, 32> opaqueNonOverlappedWidgets; | - |
1071 | for (int i = 0; i < dirtyWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1072 | QWidget *w = dirtyWidgets.at(i); | - |
1073 | QWidgetPrivate *wd = w->d_func(); | - |
1074 | if (wd->data.in_destructorTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1075 | continue; never executed: continue; | 0 |
1076 | | - |
1077 | | - |
1078 | wd->dirty &= wd->clipRect(); | - |
1079 | wd->clipToEffectiveMask(wd->dirty); | - |
1080 | | - |
1081 | | - |
1082 | bool hasDirtySiblingsAbove = false; | - |
1083 | | - |
1084 | if (!wd->isMovedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1085 | wd->subtractOpaqueSiblings(wd->dirty, &hasDirtySiblingsAbove); never executed: wd->subtractOpaqueSiblings(wd->dirty, &hasDirtySiblingsAbove); | 0 |
1086 | | - |
1087 | | - |
1088 | | - |
1089 | | - |
1090 | | - |
1091 | const QRegion dirtyBeforeSubtractedOpaqueChildren = wd->dirty; | - |
1092 | | - |
1093 | | - |
1094 | if (!wd->isScrolledTRUE | never evaluated | FALSE | never evaluated |
&& !wd->isMovedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1095 | wd->subtractOpaqueChildren(wd->dirty, w->rect()); never executed: wd->subtractOpaqueChildren(wd->dirty, w->rect()); | 0 |
1096 | | - |
1097 | if (wd->dirty.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
&& wd->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1098 | wd->dirty = dirtyBeforeSubtractedOpaqueChildren; never executed: wd->dirty = dirtyBeforeSubtractedOpaqueChildren; | 0 |
1099 | | - |
1100 | if (wd->dirty.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1101 | resetWidget(w); | - |
1102 | continue; never executed: continue; | 0 |
1103 | } | - |
1104 | | - |
1105 | const QRegion widgetDirty(w != tlw ? wd->dirty.translated(w->mapTo(tlw, QPoint())) | - |
1106 | : wd->dirty); | - |
1107 | toClean += widgetDirty; | - |
1108 | | - |
1109 | | - |
1110 | if (tlw->d_func()->extra->proxyWidgetTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1111 | resetWidget(w); | - |
1112 | continue; never executed: continue; | 0 |
1113 | } | - |
1114 | | - |
1115 | | - |
1116 | if (!hasDirtySiblingsAboveTRUE | never evaluated | FALSE | never evaluated |
&& wd->isOpaqueTRUE | never evaluated | FALSE | never evaluated |
&& !dirty.intersects(widgetDirty.boundingRect())TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1117 | opaqueNonOverlappedWidgets.append(w); | - |
1118 | } never executed: end of block else { | 0 |
1119 | resetWidget(w); | - |
1120 | dirty += widgetDirty; | - |
1121 | } never executed: end of block | 0 |
1122 | } | - |
1123 | dirtyWidgets.clear(); | - |
1124 | | - |
1125 | | - |
1126 | | - |
1127 | | - |
1128 | | - |
1129 | QTLWExtra *tlwExtra = tlw->d_func()->topData(); | - |
1130 | qDeleteAll(tlwExtra->widgetTextures); | - |
1131 | tlwExtra->widgetTextures.clear(); | - |
1132 | findAllTextureWidgetsRecursively(tlw, tlw); | - |
1133 | qt_window_private(tlw->windowHandle())->compositing = false; | - |
1134 | fullUpdatePending = false; | - |
1135 | | - |
1136 | | - |
1137 | if (toClean.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1138 | | - |
1139 | | - |
1140 | | - |
1141 | | - |
1142 | | - |
1143 | QVarLengthArray<QWidget *, 16> paintPending; | - |
1144 | const int numPaintPending = dirtyRenderToTextureWidgets.count(); | - |
1145 | paintPending.reserve(numPaintPending); | - |
1146 | for (int i = 0; i < numPaintPendingTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1147 | QWidget *w = dirtyRenderToTextureWidgets.at(i); | - |
1148 | paintPending << w; | - |
1149 | resetWidget(w); | - |
1150 | } never executed: end of block | 0 |
1151 | dirtyRenderToTextureWidgets.clear(); | - |
1152 | for (int i = 0; i < numPaintPendingTRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1153 | QWidget *w = paintPending[i]; | - |
1154 | w->d_func()->sendPaintEvent(w->rect()); | - |
1155 | if (w != tlwTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1156 | QWidget *npw = w->nativeParentWidget(); | - |
1157 | if (w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
|| (npwTRUE | never evaluated | FALSE | never evaluated |
&& npw != tlwTRUE | never evaluated | FALSE | never evaluated |
)) { | 0 |
1158 | if (!w->internalWinId()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1159 | w = npw; never executed: w = npw; | 0 |
1160 | QWidgetPrivate *wPrivate = w->d_func(); | - |
1161 | if (!wPrivate->needsFlushTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1162 | wPrivate->needsFlush = new QRegion; never executed: wPrivate->needsFlush = new QRegion; | 0 |
1163 | appendDirtyOnScreenWidget(w); | - |
1164 | } never executed: end of block | 0 |
1165 | } never executed: end of block | 0 |
1166 | } never executed: end of block | 0 |
1167 | | - |
1168 | | - |
1169 | | - |
1170 | | - |
1171 | flush(); | - |
1172 | | - |
1173 | return; never executed: return; | 0 |
1174 | } | - |
1175 | | - |
1176 | | - |
1177 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(tlwExtra->widgetTextures)>::type> _container_((tlwExtra->widgetTextures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QPlatformTextureList *tl = *_container_.i; _container_.control; _container_.control = 0) { | - |
1178 | for (int i = 0; i < tl->count()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1179 | QWidget *w = static_cast<QWidget *>(tl->source(i)); | - |
1180 | if (dirtyRenderToTextureWidgets.contains(w)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1181 | const QRect rect = tl->geometry(i); | - |
1182 | | - |
1183 | | - |
1184 | w->d_func()->renderToTextureReallyDirty = 1; | - |
1185 | dirty += rect; | - |
1186 | toClean += rect; | - |
1187 | } never executed: end of block | 0 |
1188 | } never executed: end of block | 0 |
1189 | } never executed: end of block | 0 |
1190 | for (int i = 0; i < dirtyRenderToTextureWidgets.count()TRUE | never evaluated | FALSE | never evaluated |
; ++i) | 0 |
1191 | resetWidget(dirtyRenderToTextureWidgets.at(i)); never executed: resetWidget(dirtyRenderToTextureWidgets.at(i)); | 0 |
1192 | dirtyRenderToTextureWidgets.clear(); | - |
1193 | | - |
1194 | | - |
1195 | | - |
1196 | if (tlw->d_func()->extra->proxyWidgetTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1197 | updateStaticContentsSize(); | - |
1198 | dirty = QRegion(); | - |
1199 | updateRequestSent = false; | - |
1200 | const QVector<QRect> rects(toClean.rects()); | - |
1201 | for (int i = 0; i < rects.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) | 0 |
1202 | tlw->d_func()->extra->proxyWidget->update(rects.at(i)); never executed: tlw->d_func()->extra->proxyWidget->update(rects.at(i)); | 0 |
1203 | return; never executed: return; | 0 |
1204 | } | - |
1205 | | - |
1206 | | - |
1207 | BeginPaintInfo beginPaintInfo; | - |
1208 | beginPaint(toClean, tlw, store, &beginPaintInfo); | - |
1209 | if (beginPaintInfo.nothingToPaintTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1210 | for (int i = 0; i < opaqueNonOverlappedWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) | 0 |
1211 | resetWidget(opaqueNonOverlappedWidgets[i]); never executed: resetWidget(opaqueNonOverlappedWidgets[i]); | 0 |
1212 | dirty = QRegion(); | - |
1213 | updateRequestSent = false; | - |
1214 | return; never executed: return; | 0 |
1215 | } | - |
1216 | | - |
1217 | | - |
1218 | | - |
1219 | updateStaticContentsSize(); | - |
1220 | const QRegion dirtyCopy(dirty); | - |
1221 | dirty = QRegion(); | - |
1222 | updateRequestSent = false; | - |
1223 | | - |
1224 | | - |
1225 | for (int i = 0; i < opaqueNonOverlappedWidgets.size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1226 | QWidget *w = opaqueNonOverlappedWidgets[i]; | - |
1227 | QWidgetPrivate *wd = w->d_func(); | - |
1228 | | - |
1229 | int flags = QWidgetPrivate::DrawRecursive; | - |
1230 | | - |
1231 | if (!wd->isScrolledTRUE | never evaluated | FALSE | never evaluated |
&& !wd->isMovedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1232 | flags |= QWidgetPrivate::DontDrawOpaqueChildren; never executed: flags |= QWidgetPrivate::DontDrawOpaqueChildren; | 0 |
1233 | if (w == tlwTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1234 | flags |= QWidgetPrivate::DrawAsRoot; never executed: flags |= QWidgetPrivate::DrawAsRoot; | 0 |
1235 | | - |
1236 | QRegion toBePainted(wd->dirty); | - |
1237 | resetWidget(w); | - |
1238 | | - |
1239 | QPoint offset(tlwOffset); | - |
1240 | if (w != tlwTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1241 | offset += w->mapTo(tlw, QPoint()); never executed: offset += w->mapTo(tlw, QPoint()); | 0 |
1242 | wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, 0, this); | - |
1243 | } never executed: end of block | 0 |
1244 | | - |
1245 | | - |
1246 | if (repaintAllWidgetsTRUE | never evaluated | FALSE | never evaluated |
|| !dirtyCopy.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1247 | const int flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive; | - |
1248 | tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, tlwOffset, flags, 0, this); | - |
1249 | } never executed: end of block | 0 |
1250 | | - |
1251 | endPaint(toClean, store, &beginPaintInfo); | - |
1252 | } never executed: end of block | 0 |
1253 | | - |
1254 | | - |
1255 | | - |
1256 | | - |
1257 | | - |
1258 | | - |
1259 | void QWidgetBackingStore::flush(QWidget *widget) | - |
1260 | { | - |
1261 | const bool hasDirtyOnScreenWidgets = dirtyOnScreenWidgetsTRUE | never evaluated | FALSE | never evaluated |
&& !dirtyOnScreenWidgets->isEmpty()TRUE | never evaluated | FALSE | never evaluated |
; | 0 |
1262 | bool flushed = false; | - |
1263 | | - |
1264 | | - |
1265 | if (!dirtyOnScreen.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1266 | QWidget *target = widgetTRUE | never evaluated | FALSE | never evaluated |
? widget : tlw; | 0 |
1267 | qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset, widgetTexturesFor(tlw, tlw), this); | - |
1268 | dirtyOnScreen = QRegion(); | - |
1269 | flushed = true; | - |
1270 | } never executed: end of block | 0 |
1271 | | - |
1272 | | - |
1273 | if (!flushedTRUE | never evaluated | FALSE | never evaluated |
&& !hasDirtyOnScreenWidgetsTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1274 | | - |
1275 | if (!tlw->d_func()->topData()->widgetTextures.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1276 | QPlatformTextureList *tl = widgetTexturesFor(tlw, tlw); | - |
1277 | if (tlTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1278 | QWidget *target = widgetTRUE | never evaluated | FALSE | never evaluated |
? widget : tlw; | 0 |
1279 | qt_flush(target, QRegion(), store, tlw, tlwOffset, tl, this); | - |
1280 | } never executed: end of block | 0 |
1281 | } never executed: end of block | 0 |
1282 | | - |
1283 | } never executed: end of block | 0 |
1284 | | - |
1285 | if (!hasDirtyOnScreenWidgetsTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1286 | return; never executed: return; | 0 |
1287 | | - |
1288 | for (int i = 0; i < dirtyOnScreenWidgets->size()TRUE | never evaluated | FALSE | never evaluated |
; ++i) { | 0 |
1289 | QWidget *w = dirtyOnScreenWidgets->at(i); | - |
1290 | QWidgetPrivate *wd = w->d_func(); | - |
1291 | ((!(wd->needsFlush)) ? qt_assert("wd->needsFlush",__FILE__,1449) : qt_noop()); | - |
1292 | QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeenTRUE | never evaluated | FALSE | never evaluated |
? widgetTexturesFor(tlw, w) : 0; | 0 |
1293 | qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset, widgetTexturesForNative, this); | - |
1294 | *wd->needsFlush = QRegion(); | - |
1295 | } never executed: end of block | 0 |
1296 | dirtyOnScreenWidgets->clear(); | - |
1297 | } never executed: end of block | 0 |
1298 | | - |
1299 | static inline bool discardInvalidateBufferRequest(QWidget *widget, QTLWExtra *tlwExtra) | - |
1300 | { | - |
1301 | ((!(widget)) ? qt_assert("widget",__FILE__,1459) : qt_noop()); | - |
1302 | if (QApplication::closingDown()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1303 | return never executed: return true; true;never executed: return true; | 0 |
1304 | | - |
1305 | if (!tlwExtraTRUE | never evaluated | FALSE | never evaluated |
|| tlwExtra->inTopLevelResizeTRUE | never evaluated | FALSE | never evaluated |
|| !tlwExtra->backingStoreTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1306 | return never executed: return true; true;never executed: return true; | 0 |
1307 | | - |
1308 | if (!widget->isVisible()TRUE | never evaluated | FALSE | never evaluated |
|| !widget->updatesEnabled()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1309 | return never executed: return true; true;never executed: return true; | 0 |
1310 | | - |
1311 | return never executed: return false; false;never executed: return false; | 0 |
1312 | } | - |
1313 | | - |
1314 | | - |
1315 | | - |
1316 | | - |
1317 | | - |
1318 | void QWidgetPrivate::invalidateBuffer_resizeHelper(const QPoint &oldPos, const QSize &oldSize) | - |
1319 | { | - |
1320 | QWidget * const q = q_func(); | - |
1321 | ((!(!q->isWindow())) ? qt_assert("!q->isWindow()",__FILE__,1479) : qt_noop()); | - |
1322 | ((!(q->parentWidget())) ? qt_assert("q->parentWidget()",__FILE__,1480) : qt_noop()); | - |
1323 | | - |
1324 | const bool staticContents = q->testAttribute(Qt::WA_StaticContents); | - |
1325 | const bool sizeDecreased = (TRUE | never evaluated | FALSE | never evaluated |
data.crect.width() < oldSize.width())TRUE | never evaluated | FALSE | never evaluated |
| 0 |
1326 | || (TRUE | never evaluated | FALSE | never evaluated |
data.crect.height() < oldSize.height())TRUE | never evaluated | FALSE | never evaluated |
; | 0 |
1327 | | - |
1328 | const QPoint offset(data.crect.x() - oldPos.x(), data.crect.y() - oldPos.y()); | - |
1329 | const bool parentAreaExposed = !offset.isNull()TRUE | never evaluated | FALSE | never evaluated |
|| sizeDecreasedTRUE | never evaluated | FALSE | never evaluated |
; | 0 |
1330 | const QRect newWidgetRect(q->rect()); | - |
1331 | const QRect oldWidgetRect(0, 0, oldSize.width(), oldSize.height()); | - |
1332 | | - |
1333 | if (!staticContentsTRUE | never evaluated | FALSE | never evaluated |
|| graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1334 | QRegion staticChildren; | - |
1335 | QWidgetBackingStore *bs = 0; | - |
1336 | if (offset.isNull()TRUE | never evaluated | FALSE | never evaluated |
&& (TRUE | never evaluated | FALSE | never evaluated |
bs = maybeBackingStore())TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1337 | staticChildren = bs->staticContents(q, oldWidgetRect); never executed: staticChildren = bs->staticContents(q, oldWidgetRect); | 0 |
1338 | const bool hasStaticChildren = !staticChildren.isEmpty(); | - |
1339 | | - |
1340 | if (hasStaticChildrenTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1341 | QRegion dirty(newWidgetRect); | - |
1342 | dirty -= staticChildren; | - |
1343 | invalidateBuffer(dirty); | - |
1344 | } never executed: end of block else { | 0 |
1345 | | - |
1346 | invalidateBuffer(newWidgetRect); | - |
1347 | } never executed: end of block | 0 |
1348 | | - |
1349 | if (!parentAreaExposedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1350 | return; never executed: return; | 0 |
1351 | | - |
1352 | | - |
1353 | if (!graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
&& extraTRUE | never evaluated | FALSE | never evaluated |
&& extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1354 | QRegion parentExpose(extra->mask.translated(oldPos)); | - |
1355 | parentExpose &= QRect(oldPos, oldSize); | - |
1356 | if (hasStaticChildrenTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1357 | parentExpose -= data.crect; never executed: parentExpose -= data.crect; | 0 |
1358 | q->parentWidget()->d_func()->invalidateBuffer(parentExpose); | - |
1359 | } never executed: end of block else { | 0 |
1360 | if (hasStaticChildrenTRUE | never evaluated | FALSE | never evaluated |
&& !graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1361 | QRegion parentExpose(QRect(oldPos, oldSize)); | - |
1362 | parentExpose -= data.crect; | - |
1363 | q->parentWidget()->d_func()->invalidateBuffer(parentExpose); | - |
1364 | } never executed: end of block else { | 0 |
1365 | q->parentWidget()->d_func()->invalidateBuffer(effectiveRectFor(QRect(oldPos, oldSize))); | - |
1366 | } never executed: end of block | 0 |
1367 | } | - |
1368 | return; never executed: return; | 0 |
1369 | } | - |
1370 | | - |
1371 | | - |
1372 | if (!offset.isNull()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1373 | if (sizeDecreasedTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1374 | const QSize minSize(qMin(oldSize.width(), data.crect.width()), | - |
1375 | qMin(oldSize.height(), data.crect.height())); | - |
1376 | moveRect(QRect(oldPos, minSize), offset.x(), offset.y()); | - |
1377 | } never executed: end of block else { | 0 |
1378 | moveRect(QRect(oldPos, oldSize), offset.x(), offset.y()); | - |
1379 | } never executed: end of block | 0 |
1380 | } | - |
1381 | | - |
1382 | | - |
1383 | if (!sizeDecreasedTRUE | never evaluated | FALSE | never evaluated |
|| !oldWidgetRect.contains(newWidgetRect)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1384 | QRegion newVisible(newWidgetRect); | - |
1385 | newVisible -= oldWidgetRect; | - |
1386 | invalidateBuffer(newVisible); | - |
1387 | } never executed: end of block | 0 |
1388 | | - |
1389 | if (!parentAreaExposedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1390 | return; never executed: return; | 0 |
1391 | | - |
1392 | | - |
1393 | const QRect oldRect(oldPos, oldSize); | - |
1394 | if (extraTRUE | never evaluated | FALSE | never evaluated |
&& extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1395 | QRegion parentExpose(oldRect); | - |
1396 | parentExpose &= extra->mask.translated(oldPos); | - |
1397 | parentExpose -= (extra->mask.translated(data.crect.topLeft()) & data.crect); | - |
1398 | q->parentWidget()->d_func()->invalidateBuffer(parentExpose); | - |
1399 | } never executed: end of block else { | 0 |
1400 | QRegion parentExpose(oldRect); | - |
1401 | parentExpose -= data.crect; | - |
1402 | q->parentWidget()->d_func()->invalidateBuffer(parentExpose); | - |
1403 | } never executed: end of block | 0 |
1404 | } | - |
1405 | void QWidgetPrivate::invalidateBuffer(const QRegion &rgn) | - |
1406 | { | - |
1407 | QWidget * const q = q_func(); | - |
1408 | | - |
1409 | QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); | - |
1410 | if (discardInvalidateBufferRequest(q, tlwExtra)TRUE | never evaluated | FALSE | never evaluated |
|| rgn.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1411 | return; never executed: return; | 0 |
1412 | | - |
1413 | QRegion wrgn(rgn); | - |
1414 | wrgn &= clipRect(); | - |
1415 | if (!graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
&& extraTRUE | never evaluated | FALSE | never evaluated |
&& extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1416 | wrgn &= extra->mask; never executed: wrgn &= extra->mask; | 0 |
1417 | if (wrgn.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1418 | return; never executed: return; | 0 |
1419 | | - |
1420 | tlwExtra->backingStoreTracker->markDirty(wrgn, q, | - |
1421 | QWidgetBackingStore::UpdateLater, QWidgetBackingStore::BufferInvalid); | - |
1422 | } never executed: end of block | 0 |
1423 | void QWidgetPrivate::invalidateBuffer(const QRect &rect) | - |
1424 | { | - |
1425 | QWidget * const q = q_func(); | - |
1426 | | - |
1427 | QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); | - |
1428 | if (discardInvalidateBufferRequest(q, tlwExtra)TRUE | never evaluated | FALSE | never evaluated |
|| rect.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1429 | return; never executed: return; | 0 |
1430 | | - |
1431 | QRect wRect(rect); | - |
1432 | wRect &= clipRect(); | - |
1433 | if (wRect.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1434 | return; never executed: return; | 0 |
1435 | | - |
1436 | if (graphicsEffectTRUE | never evaluated | FALSE | never evaluated |
|| !extraTRUE | never evaluated | FALSE | never evaluated |
|| !extra->hasMaskTRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1437 | tlwExtra->backingStoreTracker->markDirty(wRect, q, | - |
1438 | QWidgetBackingStore::UpdateLater, QWidgetBackingStore::BufferInvalid); | - |
1439 | return; never executed: return; | 0 |
1440 | } | - |
1441 | | - |
1442 | QRegion wRgn(extra->mask); | - |
1443 | wRgn &= wRect; | - |
1444 | if (wRgn.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1445 | return; never executed: return; | 0 |
1446 | | - |
1447 | tlwExtra->backingStoreTracker->markDirty(wRgn, q, | - |
1448 | QWidgetBackingStore::UpdateLater, QWidgetBackingStore::BufferInvalid); | - |
1449 | } never executed: end of block | 0 |
1450 | | - |
1451 | void QWidgetPrivate::repaint_sys(const QRegion &rgn) | - |
1452 | { | - |
1453 | if (data.in_destructorTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1454 | return; never executed: return; | 0 |
1455 | | - |
1456 | QWidget * const q = q_func(); | - |
1457 | if (discardSyncRequest(q, maybeTopData())TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1458 | return; never executed: return; | 0 |
1459 | | - |
1460 | if (q->testAttribute(Qt::WA_StaticContents)TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
1461 | if (!extraTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1462 | createExtra(); never executed: createExtra(); | 0 |
1463 | extra->staticContentsSize = data.crect.size(); | - |
1464 | } never executed: end of block | 0 |
1465 | | - |
1466 | QPaintEngine *engine = q->paintEngine(); | - |
1467 | | - |
1468 | | - |
1469 | | - |
1470 | | - |
1471 | const bool noPartialUpdateSupport = (engineTRUE | never evaluated | FALSE | never evaluated |
&& (engine->type() == QPaintEngine::OpenGLTRUE | never evaluated | FALSE | never evaluated |
| 0 |
1472 | || engine->type() == QPaintEngine::OpenGL2TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
1473 | && (usesDoubleBufferedGLContextTRUE | never evaluated | FALSE | never evaluated |
|| q->autoFillBackground()TRUE | never evaluated | FALSE | never evaluated |
); | 0 |
1474 | QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn); | - |
1475 | | - |
1476 | | - |
1477 | | - |
1478 | | - |
1479 | | - |
1480 | | - |
1481 | | - |
1482 | toBePainted &= clipRect(); | - |
1483 | clipToEffectiveMask(toBePainted); | - |
1484 | if (toBePainted.isEmpty()TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1485 | return; never executed: return; | 0 |
1486 | | - |
1487 | | - |
1488 | bool flushed = QWidgetBackingStore::flushPaint(q, toBePainted); | - |
1489 | | - |
1490 | | - |
1491 | drawWidget(q, toBePainted, QPoint(), QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawPaintOnScreen, 0); | - |
1492 | | - |
1493 | | - |
1494 | if (flushedTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1495 | QWidgetBackingStore::unflushPaint(q, toBePainted); never executed: QWidgetBackingStore::unflushPaint(q, toBePainted); | 0 |
1496 | | - |
1497 | | - |
1498 | if (__builtin_expect(!!(q->paintingActive()), false)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
1499 | QMessageLogger(__FILE__, 1673, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); never executed: QMessageLogger(__FILE__, 1673, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent"); | 0 |
1500 | } never executed: end of block | 0 |
1501 | | - |
1502 | | - |
1503 | | - |
1504 | | - |
| | |