summaryrefslogtreecommitdiff
path: root/metawatchpaintengine.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-16 20:51:27 +0200
committerJavier <javier@pcjavier.(none)>2011-09-16 20:51:27 +0200
commitb6060852c4b317cd73043cdc82b652d187d952fd (patch)
treea5795eb33379e7172cd16962c131b8bac8db16da /metawatchpaintengine.cpp
parentaa1c0fd3146b4ed055d181c99d52463afa6bedbb (diff)
downloadsowatch-b6060852c4b317cd73043cdc82b652d187d952fd.tar.gz
sowatch-b6060852c4b317cd73043cdc82b652d187d952fd.zip
Fixing some bugs in damage tracking on real N950
Diffstat (limited to 'metawatchpaintengine.cpp')
-rw-r--r--metawatchpaintengine.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/metawatchpaintengine.cpp b/metawatchpaintengine.cpp
index 96e78a7..71ad452 100644
--- a/metawatchpaintengine.cpp
+++ b/metawatchpaintengine.cpp
@@ -14,7 +14,7 @@ void MetaWatchPaintEngine::drawRects(const QRectF *rects, int rectCount)
int i;
for (i = 0; i < rectCount; i++) {
const QRectF& r = rects[i];
- if (_hasBrush && r.toRect() == _imageRect && (_isBrushBlack | _isBrushWhite)) {
+ if (_hasBrush && fillsEntireImage(r.toRect()) && (_isBrushBlack | _isBrushWhite)) {
_watch->clear(_isBrushWhite);
_damaged = QRegion();
continue;
@@ -37,7 +37,7 @@ void MetaWatchPaintEngine::drawRects(const QRect *rects, int rectCount)
int i;
for (i = 0; i < rectCount; i++) {
const QRect& r = rects[i];
- if (_hasBrush && r == _imageRect && (_isBrushBlack | _isBrushWhite)) {
+ if (_hasBrush && fillsEntireImage(r) && (_isBrushBlack | _isBrushWhite)) {
_watch->clear(_isBrushWhite);
_damaged = QRegion();
continue;
@@ -73,3 +73,10 @@ void MetaWatchPaintEngine::updateState(const QPaintEngineState &state)
}
}
}
+
+bool MetaWatchPaintEngine::fillsEntireImage(const QRect& rect)
+{
+ return rect == _imageRect &&
+ (!_clipEnabled ||
+ (_clipRegion.numRects() == 1 && _clipRegion.rects().at(0) == _imageRect));
+}