From 1672c0ff79526ae74ab745724fa57c877811d071 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 15 Sep 2011 12:01:40 +0100 Subject: 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 --- Source/WebKit/android/jni/PictureSet.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'Source/WebKit') 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); -- cgit v1.1