diff options
author | Ben Murdoch <benm@google.com> | 2011-09-15 12:01:40 +0100 |
---|---|---|
committer | Bart Sears <bsears@google.com> | 2011-09-19 18:40:06 -0700 |
commit | 5cfbc58a9c1b7639519272029d1d3aa452723685 (patch) | |
tree | efbdd2b2b8a2d0b974518e225cd5f6b920ab1840 | |
parent | ab7f5033f435437499cefc7066915f88a7f1cae9 (diff) | |
download | external_webkit-5cfbc58a9c1b7639519272029d1d3aa452723685.zip external_webkit-5cfbc58a9c1b7639519272029d1d3aa452723685.tar.gz external_webkit-5cfbc58a9c1b7639519272029d1d3aa452723685.tar.bz2 |
Cherry-pick fix for rect sizes from master - do not merge
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
Cherry-pick of: 1672c0ff79526ae74ab745724fa57c877811d071
Change-Id: I6a18f1d3d223f5389b0f4f35fab9e579f499e9da
-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); |