diff options
author | Ben Murdoch <benm@google.com> | 2011-09-15 12:01:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-09-16 15:12:08 +0100 |
commit | 1672c0ff79526ae74ab745724fa57c877811d071 (patch) | |
tree | 57e8be3fc610b24d7ef0f9744cb4ca0bb936b496 /Source/WebKit | |
parent | e58b3f68036f1c961ed4c2c65a547481d8fde3e3 (diff) | |
download | external_webkit-1672c0ff79526ae74ab745724fa57c877811d071.zip external_webkit-1672c0ff79526ae74ab745724fa57c877811d071.tar.gz external_webkit-1672c0ff79526ae74ab745724fa57c877811d071.tar.bz2 |
Fix invalidation rect sizes
When splitting the invalidation rect over the tiles that it
invalidates, we need to use the tile's offset to calculate the
top/left co-ordinate in the case that the inval rect only covers
part of the tile.
(See change Ie3b4be68 for the regression)
Bug: 4965594
Change-Id: I6a18f1d3d223f5389b0f4f35fab9e579f499e9da
Diffstat (limited to 'Source/WebKit')
-rw-r--r-- | Source/WebKit/android/jni/PictureSet.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp index e6a9ed5..f61e0f1 100644 --- a/Source/WebKit/android/jni/PictureSet.cpp +++ b/Source/WebKit/android/jni/PictureSet.cpp @@ -356,23 +356,10 @@ void PictureSet::splitAdd(const SkIRect& rect) SkIRect newRect; int deltaX = i * maxSize; int deltaY = j * maxSize; - int left, top, right, bottom; - if (i == firstTileX) - left = rect.fLeft; - else - left = 0; - if (j == firstTileY) - top = rect.fTop; - else - top = 0; - if (i == lastTileX) - right = rect.fRight % maxSize; - else - right = maxSize; - if (j == lastTileY) - bottom = rect.fBottom % maxSize; - else - bottom = maxSize; + int left = (i == firstTileX) ? rect.fLeft - deltaX : 0; + int top = (j == firstTileY) ? rect.fTop - deltaY : 0; + int right = (i == lastTileX) ? rect.fRight % maxSize : maxSize; + int bottom = (j == lastTileY) ? rect.fBottom % maxSize : maxSize; newRect.set(left, top, right, bottom); addToBucket(bucket, deltaX, deltaY, newRect); |