kernel/qwidgetbackingstore.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11 -
12extern QRegion qt_dirtyRegion(QWidget *); -
13 -
14 -
15 -
16 -
17static inline bool qRectIntersects(const QRect &r1, const QRect &r2) -
18{ -
19 return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) 0
20 && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
never executed: return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
0
21} -
22 -
23 -
24 -
25 -
26 -
27 -
28static inline void qt_flush(QWidget *widget, const QRegion &region, QBackingStore *backingStore, -
29 QWidget *tlw, const QPoint &tlwOffset) -
30{ -
31 qt_noop(); -
32 qt_noop(); -
33 qt_noop(); -
34 qt_noop(); -
35 static bool fpsDebug = qgetenv("QT_DEBUG_FPS").toInt(); -
36 if (fpsDebug) {
partially evaluated: fpsDebug
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3887
0-3887
37 static QTime time = QTime::currentTime(); -
38 static int frames = 0; -
39 -
40 frames++; -
41 -
42 if(time.elapsed() > 5000) {
never evaluated: time.elapsed() > 5000
0
43 double fps = double(frames * 1000) /time.restart(); -
44 fprintf(stderr,"FPS: %.1f\n",fps); -
45 frames = 0; -
46 }
never executed: }
0
47 }
never executed: }
0
48 -
49 if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
partially evaluated: tlw->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3887
partially evaluated: widget->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3887
0-3887
50 return;
never executed: return;
0
51 -
52 if (widget != tlw)
evaluated: widget != tlw
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:3878
9-3878
53 backingStore->flush(region, widget->windowHandle(), tlwOffset + widget->mapTo(tlw, QPoint()));
executed: backingStore->flush(region, widget->windowHandle(), tlwOffset + widget->mapTo(tlw, QPoint()));
Execution Count:9
9
54 else -
55 backingStore->flush(region, widget->windowHandle(), tlwOffset);
executed: backingStore->flush(region, widget->windowHandle(), tlwOffset);
Execution Count:3878
3878
56} -
57bool QWidgetBackingStore::bltRect(const QRect &rect, int dx, int dy, QWidget *widget) -
58{ -
59 const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft())); -
60 const QRect tlwRect(QRect(pos, rect.size())); -
61 if (fullUpdatePending || dirty.intersects(tlwRect))
partially evaluated: fullUpdatePending
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1016
evaluated: dirty.intersects(tlwRect)
TRUEFALSE
yes
Evaluation Count:686
yes
Evaluation Count:330
0-1016
62 return false;
executed: return false;
Execution Count:686
686
63 return store->scroll(tlwRect, dx, dy);
executed: return store->scroll(tlwRect, dx, dy);
Execution Count:330
330
64} -
65 -
66void QWidgetBackingStore::releaseBuffer() -
67{ -
68 if (store)
never evaluated: store
0
69 store->resize(QSize());
never executed: store->resize(QSize());
0
70}
never executed: }
0
71 -
72 -
73 -
74 -
75 -
76 -
77 -
78void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QBackingStore *backingStore, -
79 BeginPaintInfo *returnInfo, bool toCleanIsInTopLevelCoordinates) -
80{ -
81 (void)widget;; -
82 (void)toCleanIsInTopLevelCoordinates;; -
83 -
84 -
85 dirtyOnScreen += toClean; -
86 -
87 -
88 backingStore->beginPaint(toClean); -
89 (void)returnInfo;; -
90}
executed: }
Execution Count:2971
2971
91 -
92void QWidgetBackingStore::endPaint(const QRegion &cleaned, QBackingStore *backingStore, -
93 BeginPaintInfo *beginPaintInfo) -
94{ -
95 -
96 -
97 -
98 -
99 -
100 -
101 (void)beginPaintInfo;; -
102 (void)cleaned;; -
103 backingStore->endPaint(); -
104 -
105 -
106 flush(); -
107}
executed: }
Execution Count:2971
2971
108 -
109 -
110 -
111 -
112 -
113 -
114 -
115QRegion QWidgetBackingStore::dirtyRegion(QWidget *widget) const -
116{ -
117 const bool widgetDirty = widget && widget != tlw;
never evaluated: widget
never evaluated: widget != tlw
0
118 const QRect tlwRect(topLevelRect()); -
119 const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); -
120 if (fullUpdatePending || (surfaceGeometry != tlwRect && surfaceGeometry.size() != tlwRect.size())) {
never evaluated: fullUpdatePending
never evaluated: surfaceGeometry != tlwRect
never evaluated: surfaceGeometry.size() != tlwRect.size()
0
121 if (widgetDirty) {
never evaluated: widgetDirty
0
122 const QRect dirtyTlwRect = QRect(QPoint(), tlwRect.size()); -
123 const QPoint offset(widget->mapTo(tlw, QPoint())); -
124 const QRect dirtyWidgetRect(dirtyTlwRect & widget->rect().translated(offset)); -
125 return dirtyWidgetRect.translated(-offset);
never executed: return dirtyWidgetRect.translated(-offset);
0
126 } -
127 return QRect(QPoint(), tlwRect.size());
never executed: return QRect(QPoint(), tlwRect.size());
0
128 } -
129 -
130 -
131 QRegion r(dirty); -
132 for (int i = 0; i < dirtyWidgets.size(); ++i) {
never evaluated: i < dirtyWidgets.size()
0
133 QWidget *w = dirtyWidgets.at(i); -
134 if (widgetDirty && w != widget && !widget->isAncestorOf(w))
never evaluated: widgetDirty
never evaluated: w != widget
never evaluated: !widget->isAncestorOf(w)
0
135 continue;
never executed: continue;
0
136 r += w->d_func()->dirty.translated(w->mapTo(tlw, QPoint())); -
137 }
never executed: }
0
138 -
139 -
140 r += dirtyOnScreen; -
141 -
142 if (dirtyOnScreenWidgets) {
never evaluated: dirtyOnScreenWidgets
0
143 for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
never evaluated: i < dirtyOnScreenWidgets->size()
0
144 QWidget *w = dirtyOnScreenWidgets->at(i); -
145 if (widgetDirty && w != widget && !widget->isAncestorOf(w))
never evaluated: widgetDirty
never evaluated: w != widget
never evaluated: !widget->isAncestorOf(w)
0
146 continue;
never executed: continue;
0
147 QWidgetPrivate *wd = w->d_func(); -
148 qt_noop(); -
149 r += wd->needsFlush->translated(w->mapTo(tlw, QPoint())); -
150 }
never executed: }
0
151 }
never executed: }
0
152 -
153 if (widgetDirty) {
never evaluated: widgetDirty
0
154 -
155 const QPoint offset(widget->mapTo(tlw, QPoint())); -
156 r &= widget->rect().translated(offset); -
157 r.translate(-offset); -
158 }
never executed: }
0
159 return r;
never executed: return r;
0
160} -
161 -
162 -
163 -
164 -
165 -
166 -
167QRegion QWidgetBackingStore::staticContents(QWidget *parent, const QRect &withinClipRect) const -
168{ -
169 if (!parent && tlw->testAttribute(Qt::WA_StaticContents)) {
partially evaluated: !parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2842
never evaluated: tlw->testAttribute(Qt::WA_StaticContents)
0-2842
170 const QSize surfaceGeometry(store->size()); -
171 QRect surfaceRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); -
172 if (!withinClipRect.isEmpty())
never evaluated: !withinClipRect.isEmpty()
0
173 surfaceRect &= withinClipRect;
never executed: surfaceRect &= withinClipRect;
0
174 return QRegion(surfaceRect);
never executed: return QRegion(surfaceRect);
0
175 } -
176 -
177 QRegion region; -
178 if (parent && parent->d_func()->children.isEmpty())
partially evaluated: parent
TRUEFALSE
yes
Evaluation Count:2842
no
Evaluation Count:0
evaluated: parent->d_func()->children.isEmpty()
TRUEFALSE
yes
Evaluation Count:1617
yes
Evaluation Count:1225
0-2842
179 return region;
executed: return region;
Execution Count:1617
1617
180 -
181 const bool clipToRect = !withinClipRect.isEmpty(); -
182 const int count = staticWidgets.count(); -
183 for (int i = 0; i < count; ++i) {
partially evaluated: i < count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1225
0-1225
184 QWidget *w = staticWidgets.at(i); -
185 QWidgetPrivate *wd = w->d_func(); -
186 if (!wd->isOpaque || !wd->extra || wd->extra->staticContentsSize.isEmpty()
never evaluated: !wd->isOpaque
never evaluated: !wd->extra
never evaluated: wd->extra->staticContentsSize.isEmpty()
0
187 || !w->isVisible() || (parent && !parent->isAncestorOf(w))) {
never evaluated: !w->isVisible()
never evaluated: parent
never evaluated: !parent->isAncestorOf(w)
0
188 continue;
never executed: continue;
0
189 } -
190 -
191 QRect rect(0, 0, wd->extra->staticContentsSize.width(), wd->extra->staticContentsSize.height()); -
192 const QPoint offset = w->mapTo(parent ? parent : tlw, QPoint()); -
193 if (clipToRect)
never evaluated: clipToRect
0
194 rect &= withinClipRect.translated(-offset);
never executed: rect &= withinClipRect.translated(-offset);
0
195 if (rect.isEmpty())
never evaluated: rect.isEmpty()
0
196 continue;
never executed: continue;
0
197 -
198 rect &= wd->clipRect(); -
199 if (rect.isEmpty())
never evaluated: rect.isEmpty()
0
200 continue;
never executed: continue;
0
201 -
202 QRegion visible(rect); -
203 wd->clipToEffectiveMask(visible); -
204 if (visible.isEmpty())
never evaluated: visible.isEmpty()
0
205 continue;
never executed: continue;
0
206 wd->subtractOpaqueSiblings(visible, 0, true); -
207 -
208 visible.translate(offset); -
209 region += visible; -
210 }
never executed: }
0
211 -
212 return region;
executed: return region;
Execution Count:1225
1225
213} -
214 -
215static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately) -
216{ -
217 if (!widget)
partially evaluated: !widget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6125
0-6125
218 return;
never executed: return;
0
219 -
220 if (updateImmediately) {
evaluated: updateImmediately
TRUEFALSE
yes
Evaluation Count:238
yes
Evaluation Count:5887
238-5887
221 QEvent event(QEvent::UpdateRequest); -
222 QApplication::sendEvent(widget, &event); -
223 } else {
executed: }
Execution Count:238
238
224 QApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority); -
225 }
executed: }
Execution Count:5887
5887
226} -
227void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool updateImmediately, -
228 bool invalidateBuffer) -
229{ -
230 qt_noop(); -
231 qt_noop(); -
232 qt_noop(); -
233 qt_noop(); -
234 qt_noop(); -
235 qt_noop(); -
236 -
237 -
238 widget->d_func()->invalidateGraphicsEffectsRecursively(); -
239 -
240 -
241 if (widget->d_func()->paintOnScreen()) {
partially evaluated: widget->d_func()->paintOnScreen()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10995
0-10995
242 if (widget->d_func()->dirty.isEmpty()) {
never evaluated: widget->d_func()->dirty.isEmpty()
0
243 widget->d_func()->dirty = rgn; -
244 sendUpdateRequest(widget, updateImmediately); -
245 return;
never executed: return;
0
246 } else if (qt_region_strictContains(widget->d_func()->dirty, widget->rect())) {
never evaluated: qt_region_strictContains(widget->d_func()->dirty, widget->rect())
0
247 if (updateImmediately)
never evaluated: updateImmediately
0
248 sendUpdateRequest(widget, updateImmediately);
never executed: sendUpdateRequest(widget, updateImmediately);
0
249 return;
never executed: return;
0
250 } -
251 -
252 const bool eventAlreadyPosted = !widget->d_func()->dirty.isEmpty(); -
253 widget->d_func()->dirty += rgn; -
254 if (!eventAlreadyPosted || updateImmediately)
never evaluated: !eventAlreadyPosted
never evaluated: updateImmediately
0
255 sendUpdateRequest(widget, updateImmediately);
never executed: sendUpdateRequest(widget, updateImmediately);
0
256 return;
never executed: return;
0
257 } -
258 -
259 if (fullUpdatePending) {
partially evaluated: fullUpdatePending
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10995
0-10995
260 if (updateImmediately)
never evaluated: updateImmediately
0
261 sendUpdateRequest(tlw, updateImmediately);
never executed: sendUpdateRequest(tlw, updateImmediately);
0
262 return;
never executed: return;
0
263 } -
264 -
265 const QPoint offset = widget->mapTo(tlw, QPoint()); -
266 const QRect widgetRect = widget->d_func()->effectiveRectFor(widget->rect()); -
267 if (qt_region_strictContains(dirty, widgetRect.translated(offset))) {
evaluated: qt_region_strictContains(dirty, widgetRect.translated(offset))
TRUEFALSE
yes
Evaluation Count:7794
yes
Evaluation Count:3201
3201-7794
268 if (updateImmediately)
partially evaluated: updateImmediately
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7794
0-7794
269 sendUpdateRequest(tlw, updateImmediately);
never executed: sendUpdateRequest(tlw, updateImmediately);
0
270 return;
executed: return;
Execution Count:7794
7794
271 } -
272 -
273 if (invalidateBuffer) {
evaluated: invalidateBuffer
TRUEFALSE
yes
Evaluation Count:350
yes
Evaluation Count:2851
350-2851
274 const bool eventAlreadyPosted = !dirty.isEmpty(); -
275 -
276 if (widget->d_func()->graphicsEffect)
partially evaluated: widget->d_func()->graphicsEffect
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:350
0-350
277 dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset);
never executed: dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset);
0
278 else -
279 -
280 dirty += rgn.translated(offset);
executed: dirty += rgn.translated(offset);
Execution Count:350
350
281 if (!eventAlreadyPosted || updateImmediately)
evaluated: !eventAlreadyPosted
TRUEFALSE
yes
Evaluation Count:71
yes
Evaluation Count:279
partially evaluated: updateImmediately
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:279
0-279
282 sendUpdateRequest(tlw, updateImmediately);
executed: sendUpdateRequest(tlw, updateImmediately);
Execution Count:71
71
283 return;
executed: return;
Execution Count:350
350
284 } -
285 -
286 if (dirtyWidgets.isEmpty()) {
evaluated: dirtyWidgets.isEmpty()
TRUEFALSE
yes
Evaluation Count:776
yes
Evaluation Count:2075
776-2075
287 addDirtyWidget(widget, rgn); -
288 sendUpdateRequest(tlw, updateImmediately); -
289 return;
executed: return;
Execution Count:776
776
290 } -
291 -
292 if (widget->d_func()->inDirtyList) {
evaluated: widget->d_func()->inDirtyList
TRUEFALSE
yes
Evaluation Count:1546
yes
Evaluation Count:529
529-1546
293 if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)) {
evaluated: !qt_region_strictContains(widget->d_func()->dirty, widgetRect)
TRUEFALSE
yes
Evaluation Count:749
yes
Evaluation Count:797
749-797
294 -
295 if (widget->d_func()->graphicsEffect)
partially evaluated: widget->d_func()->graphicsEffect
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:749
0-749
296 widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect());
never executed: widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect());
0
297 else -
298 -
299 widget->d_func()->dirty += rgn;
executed: widget->d_func()->dirty += rgn;
Execution Count:749
749
300 } -
301 } else {
executed: }
Execution Count:1546
1546
302 addDirtyWidget(widget, rgn); -
303 }
executed: }
Execution Count:529
529
304 -
305 if (updateImmediately)
partially evaluated: updateImmediately
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2075
0-2075
306 sendUpdateRequest(tlw, updateImmediately);
never executed: sendUpdateRequest(tlw, updateImmediately);
0
307}
executed: }
Execution Count:2075
2075
308void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget, bool updateImmediately, -
309 bool invalidateBuffer) -
310{ -
311 qt_noop(); -
312 qt_noop(); -
313 qt_noop(); -
314 qt_noop(); -
315 qt_noop(); -
316 qt_noop(); -
317 -
318 -
319 widget->d_func()->invalidateGraphicsEffectsRecursively(); -
320 -
321 -
322 if (widget->d_func()->paintOnScreen()) {
partially evaluated: widget->d_func()->paintOnScreen()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:55275
0-55275
323 if (widget->d_func()->dirty.isEmpty()) {
never evaluated: widget->d_func()->dirty.isEmpty()
0
324 widget->d_func()->dirty = QRegion(rect); -
325 sendUpdateRequest(widget, updateImmediately); -
326 return;
never executed: return;
0
327 } else if (qt_region_strictContains(widget->d_func()->dirty, rect)) {
never evaluated: qt_region_strictContains(widget->d_func()->dirty, rect)
0
328 if (updateImmediately)
never evaluated: updateImmediately
0
329 sendUpdateRequest(widget, updateImmediately);
never executed: sendUpdateRequest(widget, updateImmediately);
0
330 return;
never executed: return;
0
331 } -
332 -
333 const bool eventAlreadyPosted = !widget->d_func()->dirty.isEmpty(); -
334 widget->d_func()->dirty += rect; -
335 if (!eventAlreadyPosted || updateImmediately)
never evaluated: !eventAlreadyPosted
never evaluated: updateImmediately
0
336 sendUpdateRequest(widget, updateImmediately);
never executed: sendUpdateRequest(widget, updateImmediately);
0
337 return;
never executed: return;
0
338 } -
339 -
340 if (fullUpdatePending) {
partially evaluated: fullUpdatePending
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:55275
0-55275
341 if (updateImmediately)
never evaluated: updateImmediately
0
342 sendUpdateRequest(tlw, updateImmediately);
never executed: sendUpdateRequest(tlw, updateImmediately);
0
343 return;
never executed: return;
0
344 } -
345 -
346 const QRect widgetRect = widget->d_func()->effectiveRectFor(rect); -
347 const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint()))); -
348 if (qt_region_strictContains(dirty, translatedRect)) {
evaluated: qt_region_strictContains(dirty, translatedRect)
TRUEFALSE
yes
Evaluation Count:37892
yes
Evaluation Count:17383
17383-37892
349 if (updateImmediately)
evaluated: updateImmediately
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:37853
39-37853
350 sendUpdateRequest(tlw, updateImmediately);
executed: sendUpdateRequest(tlw, updateImmediately);
Execution Count:39
39
351 return;
executed: return;
Execution Count:37892
37892
352 } -
353 -
354 if (invalidateBuffer) {
evaluated: invalidateBuffer
TRUEFALSE
yes
Evaluation Count:3797
yes
Evaluation Count:13586
3797-13586
355 const bool eventAlreadyPosted = !dirty.isEmpty(); -
356 dirty += translatedRect; -
357 if (!eventAlreadyPosted || updateImmediately)
evaluated: !eventAlreadyPosted
TRUEFALSE
yes
Evaluation Count:2444
yes
Evaluation Count:1353
partially evaluated: updateImmediately
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1353
0-2444
358 sendUpdateRequest(tlw, updateImmediately);
executed: sendUpdateRequest(tlw, updateImmediately);
Execution Count:2444
2444
359 return;
executed: return;
Execution Count:3797
3797
360 } -
361 -
362 if (dirtyWidgets.isEmpty()) {
evaluated: dirtyWidgets.isEmpty()
TRUEFALSE
yes
Evaluation Count:2622
yes
Evaluation Count:10964
2622-10964
363 addDirtyWidget(widget, rect); -
364 sendUpdateRequest(tlw, updateImmediately); -
365 return;
executed: return;
Execution Count:2622
2622
366 } -
367 -
368 if (widget->d_func()->inDirtyList) {
evaluated: widget->d_func()->inDirtyList
TRUEFALSE
yes
Evaluation Count:8637
yes
Evaluation Count:2327
2327-8637
369 if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect))
evaluated: !qt_region_strictContains(widget->d_func()->dirty, widgetRect)
TRUEFALSE
yes
Evaluation Count:2064
yes
Evaluation Count:6573
2064-6573
370 widget->d_func()->dirty += widgetRect;
executed: widget->d_func()->dirty += widgetRect;
Execution Count:2064
2064
371 } else {
executed: }
Execution Count:8637
8637
372 addDirtyWidget(widget, rect); -
373 }
executed: }
Execution Count:2327
2327
374 -
375 if (updateImmediately)
evaluated: updateImmediately
TRUEFALSE
yes
Evaluation Count:173
yes
Evaluation Count:10791
173-10791
376 sendUpdateRequest(tlw, updateImmediately);
executed: sendUpdateRequest(tlw, updateImmediately);
Execution Count:173
173
377}
executed: }
Execution Count:10964
10964
378 -
379 -
380 -
381 -
382 -
383 -
384 -
385void QWidgetBackingStore::markDirtyOnScreen(const QRegion &region, QWidget *widget, const QPoint &topLevelOffset) -
386{ -
387 if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
partially evaluated: !widget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1923
partially evaluated: widget->d_func()->paintOnScreen()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1923
evaluated: region.isEmpty()
TRUEFALSE
yes
Evaluation Count:155
yes
Evaluation Count:1768
0-1923
388 return;
executed: return;
Execution Count:155
155
389 if (widget == tlw) {
evaluated: widget == tlw
TRUEFALSE
yes
Evaluation Count:737
yes
Evaluation Count:1031
737-1031
390 if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
partially evaluated: !widget->testAttribute(Qt::WA_WState_InPaintEvent)
TRUEFALSE
yes
Evaluation Count:737
no
Evaluation Count:0
0-737
391 dirtyOnScreen += region;
executed: dirtyOnScreen += region;
Execution Count:737
737
392 return;
executed: return;
Execution Count:737
737
393 } -
394 -
395 -
396 if (!widget->internalWinId() && !widget->isWindow()) {
evaluated: !widget->internalWinId()
TRUEFALSE
yes
Evaluation Count:1018
yes
Evaluation Count:13
partially evaluated: !widget->isWindow()
TRUEFALSE
yes
Evaluation Count:1018
no
Evaluation Count:0
0-1018
397 QWidget *nativeParent = widget->nativeParentWidget(); -
398 if (nativeParent == tlw) {
evaluated: nativeParent == tlw
TRUEFALSE
yes
Evaluation Count:1016
yes
Evaluation Count:2
2-1016
399 if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
evaluated: !widget->testAttribute(Qt::WA_WState_InPaintEvent)
TRUEFALSE
yes
Evaluation Count:1015
yes
Evaluation Count:1
1-1015
400 dirtyOnScreen += region.translated(topLevelOffset);
executed: dirtyOnScreen += region.translated(topLevelOffset);
Execution Count:1015
1015
401 return;
executed: return;
Execution Count:1016
1016
402 } -
403 -
404 -
405 QWidgetPrivate *nativeParentPrivate = nativeParent->d_func(); -
406 if (!nativeParentPrivate->needsFlush)
partially evaluated: !nativeParentPrivate->needsFlush
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
407 nativeParentPrivate->needsFlush = new QRegion;
never executed: nativeParentPrivate->needsFlush = new QRegion;
0
408 const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint()); -
409 *nativeParentPrivate->needsFlush += region.translated(nativeParentOffset); -
410 appendDirtyOnScreenWidget(nativeParent); -
411 return;
executed: return;
Execution Count:2
2
412 } -
413 -
414 -
415 QWidgetPrivate *widgetPrivate = widget->d_func(); -
416 if (!widgetPrivate->needsFlush)
evaluated: !widgetPrivate->needsFlush
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:9
4-9
417 widgetPrivate->needsFlush = new QRegion;
executed: widgetPrivate->needsFlush = new QRegion;
Execution Count:4
4
418 *widgetPrivate->needsFlush += region; -
419 appendDirtyOnScreenWidget(widget); -
420}
executed: }
Execution Count:13
13
421 -
422void QWidgetBackingStore::removeDirtyWidget(QWidget *w) -
423{ -
424 if (!w)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54074
0-54074
425 return;
never executed: return;
0
426 -
427 dirtyWidgetsRemoveAll(w); -
428 dirtyOnScreenWidgetsRemoveAll(w); -
429 resetWidget(w); -
430 -
431 QWidgetPrivate *wd = w->d_func(); -
432 const int n = wd->children.count(); -
433 for (int i = 0; i < n; ++i) {
evaluated: i < n
TRUEFALSE
yes
Evaluation Count:68517
yes
Evaluation Count:54074
54074-68517
434 if (QWidget *child = qobject_cast<QWidget*>(wd->children.at(i)))
evaluated: QWidget *child = qobject_cast<QWidget*>(wd->children.at(i))
TRUEFALSE
yes
Evaluation Count:38560
yes
Evaluation Count:29957
29957-38560
435 removeDirtyWidget(child);
executed: removeDirtyWidget(child);
Execution Count:38560
38560
436 }
executed: }
Execution Count:68517
68517
437}
executed: }
Execution Count:54074
54074
438 -
439void QWidgetBackingStore::updateLists(QWidget *cur) -
440{ -
441 if (!cur)
partially evaluated: !cur
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12363
0-12363
442 return;
never executed: return;
0
443 -
444 QList<QObject*> children = cur->children(); -
445 for (int i = 0; i < children.size(); ++i) {
evaluated: i < children.size()
TRUEFALSE
yes
Evaluation Count:18240
yes
Evaluation Count:12363
12363-18240
446 QWidget *child = qobject_cast<QWidget*>(children.at(i)); -
447 if (!child)
evaluated: !child
TRUEFALSE
yes
Evaluation Count:7362
yes
Evaluation Count:10878
7362-10878
448 continue;
executed: continue;
Execution Count:7362
7362
449 -
450 updateLists(child); -
451 }
executed: }
Execution Count:10878
10878
452 -
453 if (cur->testAttribute(Qt::WA_StaticContents))
partially evaluated: cur->testAttribute(Qt::WA_StaticContents)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12363
0-12363
454 addStaticWidget(cur);
never executed: addStaticWidget(cur);
0
455}
executed: }
Execution Count:12363
12363
456 -
457QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel) -
458 : tlw(topLevel), dirtyOnScreenWidgets(0), fullUpdatePending(0) -
459{ -
460 store = tlw->backingStore(); -
461 qt_noop(); -
462 -
463 -
464 updateLists(topLevel); -
465}
executed: }
Execution Count:1485
1485
466 -
467QWidgetBackingStore::~QWidgetBackingStore() -
468{ -
469 for (int c = 0; c < dirtyWidgets.size(); ++c) {
evaluated: c < dirtyWidgets.size()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1452
2-1452
470 resetWidget(dirtyWidgets.at(c)); -
471 }
executed: }
Execution Count:2
2
472 -
473 delete dirtyOnScreenWidgets; -
474 dirtyOnScreenWidgets = 0; -
475}
executed: }
Execution Count:1452
1452
476 -
477 -
478 -
479void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) -
480{ -
481 QWidget * const q = q_func(); -
482 if (!q->isVisible() || (dx == 0 && dy == 0))
partially evaluated: !q->isVisible()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:369
evaluated: dx == 0
TRUEFALSE
yes
Evaluation Count:215
yes
Evaluation Count:154
partially evaluated: dy == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:215
0-369
483 return;
never executed: return;
0
484 -
485 QWidget *tlw = q->window(); -
486 QTLWExtra* x = tlw->d_func()->topData(); -
487 if (x->inTopLevelResize)
partially evaluated: x->inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:369
0-369
488 return;
never executed: return;
0
489 -
490 static int accelEnv = -1; -
491 if (accelEnv == -1) {
evaluated: accelEnv == -1
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:347
22-347
492 accelEnv = qgetenv("QT_NO_FAST_MOVE").toInt() == 0; -
493 }
executed: }
Execution Count:22
22
494 -
495 QWidget *pw = q->parentWidget(); -
496 QPoint toplevelOffset = pw->mapTo(tlw, QPoint()); -
497 QWidgetPrivate *pd = pw->d_func(); -
498 QRect clipR(pd->clipRect()); -
499 const QRect newRect(rect.translated(dx, dy)); -
500 QRect destRect = rect.intersected(clipR); -
501 if (destRect.isValid())
evaluated: destRect.isValid()
TRUEFALSE
yes
Evaluation Count:324
yes
Evaluation Count:45
45-324
502 destRect = destRect.translated(dx, dy).intersected(clipR);
executed: destRect = destRect.translated(dx, dy).intersected(clipR);
Execution Count:324
324
503 const QRect sourceRect(destRect.translated(-dx, -dy)); -
504 const QRect parentRect(rect & clipR); -
505 -
506 bool accelerateMove = accelEnv && isOpaque
partially evaluated: accelEnv
TRUEFALSE
yes
Evaluation Count:369
no
Evaluation Count:0
evaluated: isOpaque
TRUEFALSE
yes
Evaluation Count:68
yes
Evaluation Count:301
0-369
507 -
508 -
509 && !tlw->d_func()->extra->proxyWidget
partially evaluated: !tlw->d_func()->extra->proxyWidget
TRUEFALSE
yes
Evaluation Count:68
no
Evaluation Count:0
0-68
510 -
511 && !isOverlapped(sourceRect) && !isOverlapped(destRect);
evaluated: !isOverlapped(sourceRect)
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:8
partially evaluated: !isOverlapped(destRect)
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
0-60
512 -
513 if (!accelerateMove) {
evaluated: !accelerateMove
TRUEFALSE
yes
Evaluation Count:309
yes
Evaluation Count:60
60-309
514 QRegion parentR(effectiveRectFor(parentRect)); -
515 if (!extra || !extra->hasMask) {
evaluated: !extra
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:225
evaluated: !extra->hasMask
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:20
20-225
516 parentR -= newRect; -
517 } else {
executed: }
Execution Count:289
289
518 -
519 parentR += newRect & clipR; -
520 }
executed: }
Execution Count:20
20
521 pd->invalidateBuffer(parentR); -
522 invalidateBuffer((newRect & clipR).translated(-data.crect.topLeft())); -
523 } else {
executed: }
Execution Count:309
309
524 -
525 QWidgetBackingStore *wbs = x->backingStoreTracker.data(); -
526 QRegion childExpose(newRect & clipR); -
527 -
528 if (sourceRect.isValid() && wbs->bltRect(sourceRect, dx, dy, pw))
evaluated: sourceRect.isValid()
TRUEFALSE
yes
Evaluation Count:55
yes
Evaluation Count:5
evaluated: wbs->bltRect(sourceRect, dx, dy, pw)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:54
1-55
529 childExpose -= destRect;
executed: childExpose -= destRect;
Execution Count:1
1
530 -
531 if (!pw->updatesEnabled())
partially evaluated: !pw->updatesEnabled()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
532 return;
never executed: return;
0
533 -
534 const bool childUpdatesEnabled = q->updatesEnabled(); -
535 if (childUpdatesEnabled && !childExpose.isEmpty()) {
partially evaluated: childUpdatesEnabled
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
evaluated: !childExpose.isEmpty()
TRUEFALSE
yes
Evaluation Count:59
yes
Evaluation Count:1
0-60
536 childExpose.translate(-data.crect.topLeft()); -
537 wbs->markDirty(childExpose, q); -
538 isMoved = true; -
539 }
executed: }
Execution Count:59
59
540 -
541 QRegion parentExpose(parentRect); -
542 parentExpose -= newRect; -
543 if (extra && extra->hasMask)
partially evaluated: extra
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
partially evaluated: extra->hasMask
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
544 parentExpose += QRegion(newRect) - extra->mask.translated(data.crect.topLeft());
never executed: parentExpose += QRegion(newRect) - extra->mask.translated(data.crect.topLeft());
0
545 -
546 if (!parentExpose.isEmpty()) {
evaluated: !parentExpose.isEmpty()
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:13
13-47
547 wbs->markDirty(parentExpose, pw); -
548 pd->isMoved = true; -
549 }
executed: }
Execution Count:47
47
550 -
551 if (childUpdatesEnabled) {
partially evaluated: childUpdatesEnabled
TRUEFALSE
yes
Evaluation Count:60
no
Evaluation Count:0
0-60
552 QRegion needsFlush(sourceRect); -
553 needsFlush += destRect; -
554 wbs->markDirtyOnScreen(needsFlush, pw, toplevelOffset); -
555 }
executed: }
Execution Count:60
60
556 }
executed: }
Execution Count:60
60
557} -
558 -
559 -
560void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) -
561{ -
562 QWidget * const q = q_func(); -
563 QWidget *tlw = q->window(); -
564 QTLWExtra* x = tlw->d_func()->topData(); -
565 if (x->inTopLevelResize)
partially evaluated: x->inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1111
0-1111
566 return;
never executed: return;
0
567 -
568 QWidgetBackingStore *wbs = x->backingStoreTracker.data(); -
569 if (!wbs)
partially evaluated: !wbs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1111
0-1111
570 return;
never executed: return;
0
571 -
572 static int accelEnv = -1; -
573 if (accelEnv == -1) {
evaluated: accelEnv == -1
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1101
10-1101
574 accelEnv = qgetenv("QT_NO_FAST_SCROLL").toInt() == 0; -
575 }
executed: }
Execution Count:10
10
576 -
577 QRect scrollRect = rect & clipRect(); -
578 bool overlapped = false; -
579 bool accelerateScroll = accelEnv && isOpaque
partially evaluated: accelEnv
TRUEFALSE
yes
Evaluation Count:1111
no
Evaluation Count:0
partially evaluated: isOpaque
TRUEFALSE
yes
Evaluation Count:1111
no
Evaluation Count:0
0-1111
580 && !(overlapped = isOverlapped(scrollRect.translated(data.crect.topLeft())));
partially evaluated: !(overlapped = isOverlapped(scrollRect.translated(data.crect.topLeft())))
TRUEFALSE
yes
Evaluation Count:1111
no
Evaluation Count:0
0-1111
581 -
582 if (!accelerateScroll) {
partially evaluated: !accelerateScroll
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1111
0-1111
583 if (overlapped) {
never evaluated: overlapped
0
584 QRegion region(scrollRect); -
585 subtractOpaqueSiblings(region); -
586 invalidateBuffer(region); -
587 }else {
never executed: }
0
588 invalidateBuffer(scrollRect); -
589 }
never executed: }
0
590 } else { -
591 const QPoint toplevelOffset = q->mapTo(tlw, QPoint()); -
592 const QRect destRect = scrollRect.translated(dx, dy) & scrollRect; -
593 const QRect sourceRect = destRect.translated(-dx, -dy); -
594 -
595 QRegion childExpose(scrollRect); -
596 if (sourceRect.isValid()) {
evaluated: sourceRect.isValid()
TRUEFALSE
yes
Evaluation Count:961
yes
Evaluation Count:150
150-961
597 if (wbs->bltRect(sourceRect, dx, dy, q))
evaluated: wbs->bltRect(sourceRect, dx, dy, q)
TRUEFALSE
yes
Evaluation Count:313
yes
Evaluation Count:648
313-648
598 childExpose -= destRect;
executed: childExpose -= destRect;
Execution Count:313
313
599 }
executed: }
Execution Count:961
961
600 -
601 if (inDirtyList) {
evaluated: inDirtyList
TRUEFALSE
yes
Evaluation Count:955
yes
Evaluation Count:156
156-955
602 if (rect == q->rect()) {
partially evaluated: rect == q->rect()
TRUEFALSE
yes
Evaluation Count:955
no
Evaluation Count:0
0-955
603 dirty.translate(dx, dy); -
604 } else {
executed: }
Execution Count:955
955
605 QRegion dirtyScrollRegion = dirty.intersected(scrollRect); -
606 if (!dirtyScrollRegion.isEmpty()) {
never evaluated: !dirtyScrollRegion.isEmpty()
0
607 dirty -= dirtyScrollRegion; -
608 dirtyScrollRegion.translate(dx, dy); -
609 dirty += dirtyScrollRegion; -
610 }
never executed: }
0
611 }
never executed: }
0
612 } -
613 -
614 if (!q->updatesEnabled())
partially evaluated: !q->updatesEnabled()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1111
0-1111
615 return;
never executed: return;
0
616 -
617 if (!childExpose.isEmpty()) {
evaluated: !childExpose.isEmpty()
TRUEFALSE
yes
Evaluation Count:1108
yes
Evaluation Count:3
3-1108
618 wbs->markDirty(childExpose, q); -
619 isScrolled = true; -
620 }
executed: }
Execution Count:1108
1108
621 -
622 -
623 -
624 -
625 wbs->markDirtyOnScreen(destRect, q, toplevelOffset); -
626 }
executed: }
Execution Count:1111
1111
627} -
628 -
629static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra) -
630{ -
631 if (!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible())
partially evaluated: !tlw
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6408
partially evaluated: !tlwExtra
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6408
evaluated: !tlw->testAttribute(Qt::WA_Mapped)
TRUEFALSE
yes
Evaluation Count:1689
yes
Evaluation Count:4719
evaluated: !tlw->isVisible()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:4708
0-6408
632 return true;
executed: return true;
Execution Count:1700
1700
633 -
634 return false;
executed: return false;
Execution Count:4708
4708
635} -
636void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedRegion) -
637{ -
638 QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); -
639 if (discardSyncRequest(tlw, tlwExtra) || tlwExtra->inTopLevelResize)
evaluated: discardSyncRequest(tlw, tlwExtra)
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:1648
partially evaluated: tlwExtra->inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
0-1648
640 return;
executed: return;
Execution Count:11
11
641 -
642 if (!exposedWidget || !exposedWidget->internalWinId() || !exposedWidget->isVisible()
partially evaluated: !exposedWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
partially evaluated: !exposedWidget->internalWinId()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
partially evaluated: !exposedWidget->isVisible()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
0-1648
643 || !exposedWidget->updatesEnabled() || exposedRegion.isEmpty()) {
partially evaluated: !exposedWidget->updatesEnabled()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
partially evaluated: exposedRegion.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1648
0-1648
644 return;
never executed: return;
0
645 } -
646 -
647 -
648 if (!isDirty()) {
evaluated: !isDirty()
TRUEFALSE
yes
Evaluation Count:907
yes
Evaluation Count:741
741-907
649 qt_flush(exposedWidget, exposedRegion, store, tlw, tlwOffset); -
650 return;
executed: return;
Execution Count:907
907
651 } -
652 -
653 if (exposedWidget != tlw)
evaluated: exposedWidget != tlw
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:737
4-737
654 markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint()));
executed: markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint()));
Execution Count:4
4
655 else -
656 markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
executed: markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
Execution Count:737
737
657 sync(); -
658}
executed: }
Execution Count:741
741
659 -
660 -
661 -
662 -
663void QWidgetBackingStore::sync() -
664{ -
665 QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); -
666 if (discardSyncRequest(tlw, tlwExtra)) {
evaluated: discardSyncRequest(tlw, tlwExtra)
TRUEFALSE
yes
Evaluation Count:1689
yes
Evaluation Count:3060
1689-3060
667 -
668 -
669 -
670 -
671 -
672 if (!tlw->isVisible()) {
evaluated: !tlw->isVisible()
TRUEFALSE
yes
Evaluation Count:70
yes
Evaluation Count:1619
70-1619
673 dirty = QRegion(); -
674 for (int i = 0; i < dirtyWidgets.size(); ++i)
partially evaluated: i < dirtyWidgets.size()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:70
0-70
675 resetWidget(dirtyWidgets.at(i));
never executed: resetWidget(dirtyWidgets.at(i));
0
676 dirtyWidgets.clear(); -
677 fullUpdatePending = false; -
678 }
executed: }
Execution Count:70
70
679 return;
executed: return;
Execution Count:1689
1689
680 } -
681 -
682 const bool updatesDisabled = !tlw->updatesEnabled(); -
683 bool repaintAllWidgets = false; -
684 -
685 const bool inTopLevelResize = tlwExtra->inTopLevelResize; -
686 const QRect tlwRect(topLevelRect()); -
687 const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); -
688 if ((fullUpdatePending || inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
partially evaluated: fullUpdatePending
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3060
partially evaluated: inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3060
evaluated: surfaceGeometry.size() != tlwRect.size()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:3041
partially evaluated: !updatesDisabled
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-3060
689 if (hasStaticContents()) {
partially evaluated: hasStaticContents()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
690 -
691 const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); -
692 const QRegion staticRegion(staticContents(0, clipRect)); -
693 QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height()); -
694 newVisible -= staticRegion; -
695 dirty += newVisible; -
696 store->setStaticContents(staticRegion); -
697 } else {
never executed: }
0
698 -
699 dirty = QRegion(0, 0, tlwRect.width(), tlwRect.height()); -
700 for (int i = 0; i < dirtyWidgets.size(); ++i)
evaluated: i < dirtyWidgets.size()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:19
12-19
701 resetWidget(dirtyWidgets.at(i));
executed: resetWidget(dirtyWidgets.at(i));
Execution Count:12
12
702 dirtyWidgets.clear(); -
703 repaintAllWidgets = true; -
704 }
executed: }
Execution Count:19
19
705 } -
706 -
707 if (inTopLevelResize || surfaceGeometry.size() != tlwRect.size())
partially evaluated: inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3060
evaluated: surfaceGeometry.size() != tlwRect.size()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:3041
0-3060
708 store->resize(tlwRect.size());
executed: store->resize(tlwRect.size());
Execution Count:19
19
709 -
710 if (updatesDisabled)
partially evaluated: updatesDisabled
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3060
0-3060
711 return;
never executed: return;
0
712 -
713 -
714 QRegion toClean(dirty); -
715 -
716 -
717 -
718 -
719 -
720 QVarLengthArray<QWidget *, 32> opaqueNonOverlappedWidgets; -
721 for (int i = 0; i < dirtyWidgets.size(); ++i) {
evaluated: i < dirtyWidgets.size()
TRUEFALSE
yes
Evaluation Count:4474
yes
Evaluation Count:3060
3060-4474
722 QWidget *w = dirtyWidgets.at(i); -
723 QWidgetPrivate *wd = w->d_func(); -
724 if (wd->data.in_destructor)
partially evaluated: wd->data.in_destructor
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4474
0-4474
725 continue;
never executed: continue;
0
726 -
727 -
728 wd->dirty &= wd->clipRect(); -
729 wd->clipToEffectiveMask(wd->dirty); -
730 -
731 -
732 bool hasDirtySiblingsAbove = false; -
733 -
734 if (!wd->isMoved)
evaluated: !wd->isMoved
TRUEFALSE
yes
Evaluation Count:4457
yes
Evaluation Count:17
17-4457
735 wd->subtractOpaqueSiblings(wd->dirty, &hasDirtySiblingsAbove);
executed: wd->subtractOpaqueSiblings(wd->dirty, &hasDirtySiblingsAbove);
Execution Count:4457
4457
736 -
737 if (!wd->isScrolled && !wd->isMoved)
evaluated: !wd->isScrolled
TRUEFALSE
yes
Evaluation Count:4186
yes
Evaluation Count:288
evaluated: !wd->isMoved
TRUEFALSE
yes
Evaluation Count:4169
yes
Evaluation Count:17
17-4186
738 wd->subtractOpaqueChildren(wd->dirty, w->rect());
executed: wd->subtractOpaqueChildren(wd->dirty, w->rect());
Execution Count:4169
4169
739 -
740 if (wd->dirty.isEmpty()) {
evaluated: wd->dirty.isEmpty()
TRUEFALSE
yes
Evaluation Count:419
yes
Evaluation Count:4055
419-4055
741 resetWidget(w); -
742 continue;
executed: continue;
Execution Count:419
419
743 } -
744 -
745 const QRegion widgetDirty(w != tlw ? wd->dirty.translated(w->mapTo(tlw, QPoint())) -
746 : wd->dirty); -
747 toClean += widgetDirty; -
748 -
749 -
750 if (tlw->d_func()->extra->proxyWidget) {
partially evaluated: tlw->d_func()->extra->proxyWidget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4055
0-4055
751 resetWidget(w); -
752 continue;
never executed: continue;
0
753 } -
754 -
755 -
756 if (!hasDirtySiblingsAbove && wd->isOpaque && !dirty.intersects(widgetDirty.boundingRect())) {
evaluated: !hasDirtySiblingsAbove
TRUEFALSE
yes
Evaluation Count:4041
yes
Evaluation Count:14
evaluated: wd->isOpaque
TRUEFALSE
yes
Evaluation Count:2910
yes
Evaluation Count:1131
evaluated: !dirty.intersects(widgetDirty.boundingRect())
TRUEFALSE
yes
Evaluation Count:2284
yes
Evaluation Count:626
14-4041
757 opaqueNonOverlappedWidgets.append(w); -
758 } else {
executed: }
Execution Count:2284
2284
759 resetWidget(w); -
760 dirty += widgetDirty; -
761 }
executed: }
Execution Count:1771
1771
762 } -
763 dirtyWidgets.clear(); -
764 -
765 fullUpdatePending = false; -
766 -
767 if (toClean.isEmpty()) {
evaluated: toClean.isEmpty()
TRUEFALSE
yes
Evaluation Count:88
yes
Evaluation Count:2972
88-2972
768 -
769 -
770 -
771 flush(); -
772 return;
executed: return;
Execution Count:88
88
773 } -
774 -
775 -
776 if (tlw->d_func()->extra->proxyWidget) {
evaluated: tlw->d_func()->extra->proxyWidget
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2971
1-2971
777 updateStaticContentsSize(); -
778 dirty = QRegion(); -
779 const QVector<QRect> rects(toClean.rects()); -
780 for (int i = 0; i < rects.size(); ++i)
evaluated: i < rects.size()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
781 tlw->d_func()->extra->proxyWidget->update(rects.at(i));
executed: tlw->d_func()->extra->proxyWidget->update(rects.at(i));
Execution Count:1
1
782 return;
executed: return;
Execution Count:1
1
783 } -
784 -
785 -
786 BeginPaintInfo beginPaintInfo; -
787 beginPaint(toClean, tlw, store, &beginPaintInfo); -
788 if (beginPaintInfo.nothingToPaint) {
partially evaluated: beginPaintInfo.nothingToPaint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2971
0-2971
789 for (int i = 0; i < opaqueNonOverlappedWidgets.size(); ++i)
never evaluated: i < opaqueNonOverlappedWidgets.size()
0
790 resetWidget(opaqueNonOverlappedWidgets[i]);
never executed: resetWidget(opaqueNonOverlappedWidgets[i]);
0
791 dirty = QRegion(); -
792 return;
never executed: return;
0
793 } -
794 -
795 -
796 -
797 updateStaticContentsSize(); -
798 const QRegion dirtyCopy(dirty); -
799 dirty = QRegion(); -
800 -
801 -
802 for (int i = 0; i < opaqueNonOverlappedWidgets.size(); ++i) {
evaluated: i < opaqueNonOverlappedWidgets.size()
TRUEFALSE
yes
Evaluation Count:2284
yes
Evaluation Count:2971
2284-2971
803 QWidget *w = opaqueNonOverlappedWidgets[i]; -
804 QWidgetPrivate *wd = w->d_func(); -
805 -
806 int flags = QWidgetPrivate::DrawRecursive; -
807 -
808 if (!wd->isScrolled && !wd->isMoved)
evaluated: !wd->isScrolled
TRUEFALSE
yes
Evaluation Count:2010
yes
Evaluation Count:274
evaluated: !wd->isMoved
TRUEFALSE
yes
Evaluation Count:2007
yes
Evaluation Count:3
3-2010
809 flags |= QWidgetPrivate::DontDrawOpaqueChildren;
executed: flags |= QWidgetPrivate::DontDrawOpaqueChildren;
Execution Count:2007
2007
810 if (w == tlw)
evaluated: w == tlw
TRUEFALSE
yes
Evaluation Count:602
yes
Evaluation Count:1682
602-1682
811 flags |= QWidgetPrivate::DrawAsRoot;
executed: flags |= QWidgetPrivate::DrawAsRoot;
Execution Count:602
602
812 -
813 QRegion toBePainted(wd->dirty); -
814 resetWidget(w); -
815 -
816 QPoint offset(tlwOffset); -
817 if (w != tlw)
evaluated: w != tlw
TRUEFALSE
yes
Evaluation Count:1682
yes
Evaluation Count:602
602-1682
818 offset += w->mapTo(tlw, QPoint());
executed: offset += w->mapTo(tlw, QPoint());
Execution Count:1682
1682
819 wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, 0, this); -
820 }
executed: }
Execution Count:2284
2284
821 -
822 -
823 if (repaintAllWidgets || !dirtyCopy.isEmpty()) {
evaluated: repaintAllWidgets
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:2953
evaluated: !dirtyCopy.isEmpty()
TRUEFALSE
yes
Evaluation Count:1670
yes
Evaluation Count:1283
18-2953
824 const int flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive; -
825 tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, tlwOffset, flags, 0, this); -
826 }
executed: }
Execution Count:1688
1688
827 -
828 endPaint(toClean, store, &beginPaintInfo); -
829}
executed: }
Execution Count:2971
2971
830 -
831 -
832 -
833 -
834 -
835 -
836void QWidgetBackingStore::flush(QWidget *widget) -
837{ -
838 if (!dirtyOnScreen.isEmpty()) {
evaluated: !dirtyOnScreen.isEmpty()
TRUEFALSE
yes
Evaluation Count:2971
yes
Evaluation Count:88
88-2971
839 QWidget *target = widget ? widget : tlw;
partially evaluated: widget
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2971
0-2971
840 qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset); -
841 dirtyOnScreen = QRegion(); -
842 }
executed: }
Execution Count:2971
2971
843 -
844 if (!dirtyOnScreenWidgets || dirtyOnScreenWidgets->isEmpty())
evaluated: !dirtyOnScreenWidgets
TRUEFALSE
yes
Evaluation Count:3049
yes
Evaluation Count:10
evaluated: dirtyOnScreenWidgets->isEmpty()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5-3049
845 return;
executed: return;
Execution Count:3054
3054
846 -
847 for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
evaluated: i < dirtyOnScreenWidgets->size()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:5
5-9
848 QWidget *w = dirtyOnScreenWidgets->at(i); -
849 QWidgetPrivate *wd = w->d_func(); -
850 qt_noop(); -
851 qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset); -
852 *wd->needsFlush = QRegion(); -
853 }
executed: }
Execution Count:9
9
854 dirtyOnScreenWidgets->clear(); -
855}
executed: }
Execution Count:5
5
856 -
857static inline bool discardInvalidateBufferRequest(QWidget *widget, QTLWExtra *tlwExtra) -
858{ -
859 qt_noop(); -
860 if (QApplication::closingDown())
partially evaluated: QApplication::closingDown()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:37715
0-37715
861 return true;
never executed: return true;
0
862 -
863 if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore)
evaluated: !tlwExtra
TRUEFALSE
yes
Evaluation Count:8716
yes
Evaluation Count:28999
partially evaluated: tlwExtra->inTopLevelResize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28999
evaluated: !tlwExtra->backingStore
TRUEFALSE
yes
Evaluation Count:6621
yes
Evaluation Count:22378
0-28999
864 return true;
executed: return true;
Execution Count:15337
15337
865 -
866 if (!widget->isVisible() || !widget->updatesEnabled())
evaluated: !widget->isVisible()
TRUEFALSE
yes
Evaluation Count:10837
yes
Evaluation Count:11541
evaluated: !widget->updatesEnabled()
TRUEFALSE
yes
Evaluation Count:492
yes
Evaluation Count:11049
492-11541
867 return true;
executed: return true;
Execution Count:11329
11329
868 -
869 return false;
executed: return false;
Execution Count:11049
11049
870} -
871 -
872 -
873 -
874 -
875 -
876void QWidgetPrivate::invalidateBuffer_resizeHelper(const QPoint &oldPos, const QSize &oldSize) -
877{ -
878 QWidget * const q = q_func(); -
879 qt_noop(); -
880 qt_noop(); -
881 -
882 const bool staticContents = q->testAttribute(Qt::WA_StaticContents); -
883 const bool sizeDecreased = (data.crect.width() < oldSize.width())
evaluated: (data.crect.width() < oldSize.width())
TRUEFALSE
yes
Evaluation Count:830
yes
Evaluation Count:2443
830-2443
884 || (data.crect.height() < oldSize.height());
evaluated: (data.crect.height() < oldSize.height())
TRUEFALSE
yes
Evaluation Count:965
yes
Evaluation Count:1478
965-1478
885 -
886 const QPoint offset(data.crect.x() - oldPos.x(), data.crect.y() - oldPos.y()); -
887 const bool parentAreaExposed = !offset.isNull() || sizeDecreased;
evaluated: !offset.isNull()
TRUEFALSE
yes
Evaluation Count:431
yes
Evaluation Count:2842
evaluated: sizeDecreased
TRUEFALSE
yes
Evaluation Count:1509
yes
Evaluation Count:1333
431-2842
888 const QRect newWidgetRect(q->rect()); -
889 const QRect oldWidgetRect(0, 0, oldSize.width(), oldSize.height()); -
890 -
891 if (!staticContents || graphicsEffect) {
partially evaluated: !staticContents
TRUEFALSE
yes
Evaluation Count:3273
no
Evaluation Count:0
never evaluated: graphicsEffect
0-3273
892 QRegion staticChildren; -
893 QWidgetBackingStore *bs = 0; -
894 if (offset.isNull() && (bs = maybeBackingStore()))
evaluated: offset.isNull()
TRUEFALSE
yes
Evaluation Count:2842
yes
Evaluation Count:431
partially evaluated: (bs = maybeBackingStore())
TRUEFALSE
yes
Evaluation Count:2842
no
Evaluation Count:0
0-2842
895 staticChildren = bs->staticContents(q, oldWidgetRect);
executed: staticChildren = bs->staticContents(q, oldWidgetRect);
Execution Count:2842
2842
896 const bool hasStaticChildren = !staticChildren.isEmpty(); -
897 -
898 if (hasStaticChildren) {
partially evaluated: hasStaticChildren
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3273
0-3273
899 QRegion dirty(newWidgetRect); -
900 dirty -= staticChildren; -
901 invalidateBuffer(dirty); -
902 } else {
never executed: }
0
903 -
904 invalidateBuffer(newWidgetRect); -
905 }
executed: }
Execution Count:3273
3273
906 -
907 if (!parentAreaExposed)
evaluated: !parentAreaExposed
TRUEFALSE
yes
Evaluation Count:1333
yes
Evaluation Count:1940
1333-1940
908 return;
executed: return;
Execution Count:1333
1333
909 -
910 -
911 if (!graphicsEffect && extra && extra->hasMask) {
partially evaluated: !graphicsEffect
TRUEFALSE
yes
Evaluation Count:1940
no
Evaluation Count:0
evaluated: extra
TRUEFALSE
yes
Evaluation Count:1363
yes
Evaluation Count:577
partially evaluated: extra->hasMask
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1363
0-1940
912 QRegion parentExpose(extra->mask.translated(oldPos)); -
913 parentExpose &= QRect(oldPos, oldSize); -
914 if (hasStaticChildren)
never evaluated: hasStaticChildren
0
915 parentExpose -= data.crect;
never executed: parentExpose -= data.crect;
0
916 q->parentWidget()->d_func()->invalidateBuffer(parentExpose); -
917 } else {
never executed: }
0
918 if (hasStaticChildren && !graphicsEffect) {
partially evaluated: hasStaticChildren
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1940
never evaluated: !graphicsEffect
0-1940
919 QRegion parentExpose(QRect(oldPos, oldSize)); -
920 parentExpose -= data.crect; -
921 q->parentWidget()->d_func()->invalidateBuffer(parentExpose); -
922 } else {
never executed: }
0
923 q->parentWidget()->d_func()->invalidateBuffer(effectiveRectFor(QRect(oldPos, oldSize))); -
924 }
executed: }
Execution Count:1940
1940
925 } -
926 return;
executed: return;
Execution Count:1940
1940
927 } -
928 -
929 -
930 if (!offset.isNull()) {
never evaluated: !offset.isNull()
0
931 if (sizeDecreased) {
never evaluated: sizeDecreased
0
932 const QSize minSize(qMin(oldSize.width(), data.crect.width()), -
933 qMin(oldSize.height(), data.crect.height())); -
934 moveRect(QRect(oldPos, minSize), offset.x(), offset.y()); -
935 } else {
never executed: }
0
936 moveRect(QRect(oldPos, oldSize), offset.x(), offset.y()); -
937 }
never executed: }
0
938 } -
939 -
940 -
941 if (!sizeDecreased || !oldWidgetRect.contains(newWidgetRect)) {
never evaluated: !sizeDecreased
never evaluated: !oldWidgetRect.contains(newWidgetRect)
0
942 QRegion newVisible(newWidgetRect); -
943 newVisible -= oldWidgetRect; -
944 invalidateBuffer(newVisible); -
945 }
never executed: }
0
946 -
947 if (!parentAreaExposed)
never evaluated: !parentAreaExposed
0
948 return;
never executed: return;
0
949 -
950 -
951 const QRect oldRect(oldPos, oldSize); -
952 if (extra && extra->hasMask) {
never evaluated: extra
never evaluated: extra->hasMask
0
953 QRegion parentExpose(oldRect); -
954 parentExpose &= extra->mask.translated(oldPos); -
955 parentExpose -= (extra->mask.translated(data.crect.topLeft()) & data.crect); -
956 q->parentWidget()->d_func()->invalidateBuffer(parentExpose); -
957 } else {
never executed: }
0
958 QRegion parentExpose(oldRect); -
959 parentExpose -= data.crect; -
960 q->parentWidget()->d_func()->invalidateBuffer(parentExpose); -
961 }
never executed: }
0
962} -
963void QWidgetPrivate::invalidateBuffer(const QRegion &rgn) -
964{ -
965 QWidget * const q = q_func(); -
966 -
967 QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); -
968 if (discardInvalidateBufferRequest(q, tlwExtra) || rgn.isEmpty())
evaluated: discardInvalidateBufferRequest(q, tlwExtra)
TRUEFALSE
yes
Evaluation Count:1163
yes
Evaluation Count:1447
evaluated: rgn.isEmpty()
TRUEFALSE
yes
Evaluation Count:280
yes
Evaluation Count:1167
280-1447
969 return;
executed: return;
Execution Count:1443
1443
970 -
971 QRegion wrgn(rgn); -
972 wrgn &= clipRect(); -
973 if (!graphicsEffect && extra && extra->hasMask)
partially evaluated: !graphicsEffect
TRUEFALSE
yes
Evaluation Count:1167
no
Evaluation Count:0
evaluated: extra
TRUEFALSE
yes
Evaluation Count:1145
yes
Evaluation Count:22
partially evaluated: extra->hasMask
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1145
0-1167
974 wrgn &= extra->mask;
never executed: wrgn &= extra->mask;
0
975 if (wrgn.isEmpty())
evaluated: wrgn.isEmpty()
TRUEFALSE
yes
Evaluation Count:192
yes
Evaluation Count:975
192-975
976 return;
executed: return;
Execution Count:192
192
977 -
978 tlwExtra->backingStoreTracker->markDirty(wrgn, q, false, true); -
979}
executed: }
Execution Count:975
975
980void QWidgetPrivate::invalidateBuffer(const QRect &rect) -
981{ -
982 QWidget * const q = q_func(); -
983 -
984 QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); -
985 if (discardInvalidateBufferRequest(q, tlwExtra) || rect.isEmpty())
evaluated: discardInvalidateBufferRequest(q, tlwExtra)
TRUEFALSE
yes
Evaluation Count:25503
yes
Evaluation Count:9602
evaluated: rect.isEmpty()
TRUEFALSE
yes
Evaluation Count:335
yes
Evaluation Count:9267
335-25503
986 return;
executed: return;
Execution Count:25838
25838
987 -
988 QRect wRect(rect); -
989 wRect &= clipRect(); -
990 if (wRect.isEmpty())
evaluated: wRect.isEmpty()
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:9165
102-9165
991 return;
executed: return;
Execution Count:102
102
992 -
993 if (graphicsEffect || !extra || !extra->hasMask) {
partially evaluated: graphicsEffect
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9165
evaluated: !extra
TRUEFALSE
yes
Evaluation Count:1993
yes
Evaluation Count:7172
evaluated: !extra->hasMask
TRUEFALSE
yes
Evaluation Count:7122
yes
Evaluation Count:50
0-9165
994 tlwExtra->backingStoreTracker->markDirty(wRect, q, false, true); -
995 return;
executed: return;
Execution Count:9115
9115
996 } -
997 -
998 QRegion wRgn(extra->mask); -
999 wRgn &= wRect; -
1000 if (wRgn.isEmpty())
partially evaluated: wRgn.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:50
0-50
1001 return;
never executed: return;
0
1002 -
1003 tlwExtra->backingStoreTracker->markDirty(wRgn, q, false, true); -
1004}
executed: }
Execution Count:50
50
1005 -
1006void QWidgetPrivate::repaint_sys(const QRegion &rgn) -
1007{ -
1008 if (data.in_destructor)
never evaluated: data.in_destructor
0
1009 return;
never executed: return;
0
1010 -
1011 QWidget * const q = q_func(); -
1012 if (discardSyncRequest(q, maybeTopData()))
never evaluated: discardSyncRequest(q, maybeTopData())
0
1013 return;
never executed: return;
0
1014 -
1015 if (q->testAttribute(Qt::WA_StaticContents)) {
never evaluated: q->testAttribute(Qt::WA_StaticContents)
0
1016 if (!extra)
never evaluated: !extra
0
1017 createExtra();
never executed: createExtra();
0
1018 extra->staticContentsSize = data.crect.size(); -
1019 }
never executed: }
0
1020 -
1021 QPaintEngine *engine = q->paintEngine(); -
1022 -
1023 -
1024 -
1025 -
1026 const bool noPartialUpdateSupport = (engine && (engine->type() == QPaintEngine::OpenGL
never evaluated: engine
never evaluated: engine->type() == QPaintEngine::OpenGL
0
1027 || engine->type() == QPaintEngine::OpenGL2))
never evaluated: engine->type() == QPaintEngine::OpenGL2
0
1028 && (usesDoubleBufferedGLContext || q->autoFillBackground());
never evaluated: usesDoubleBufferedGLContext
never evaluated: q->autoFillBackground()
0
1029 QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn); -
1030 -
1031 -
1032 -
1033 -
1034 -
1035 -
1036 -
1037 toBePainted &= clipRect(); -
1038 clipToEffectiveMask(toBePainted); -
1039 if (toBePainted.isEmpty())
never evaluated: toBePainted.isEmpty()
0
1040 return;
never executed: return;
0
1041 -
1042 -
1043 -
1044 -
1045 -
1046 drawWidget(q, toBePainted, QPoint(), QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawPaintOnScreen, 0); -
1047 -
1048 -
1049 -
1050 -
1051 -
1052 -
1053 if (q->paintingActive())
never evaluated: q->paintingActive()
0
1054 QMessageLogger("kernel/qwidgetbackingstore.cpp", 1335, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
never executed: QMessageLogger("kernel/qwidgetbackingstore.cpp", 1335, __PRETTY_FUNCTION__).warning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
0
1055}
never executed: }
0
1056 -
1057 -
1058 -
1059 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial