summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-10-17 16:21:52 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-17 16:21:52 -0700
commit2852378f5d9c7969e3dd68231de94666344d05e1 (patch)
tree3c98aa86fcabbe9906d372b5a2c9bb93bd4373af /Source/WebCore/platform
parent2b708bc49715a3512379f1f7f1dd31d6a26eeb1a (diff)
parente87984118d573b7e6eea5547eaa43ea98bbf5447 (diff)
downloadexternal_webkit-2852378f5d9c7969e3dd68231de94666344d05e1.zip
external_webkit-2852378f5d9c7969e3dd68231de94666344d05e1.tar.gz
external_webkit-2852378f5d9c7969e3dd68231de94666344d05e1.tar.bz2
am e8798411: Don\'t paint/allocate off screen tiles
* commit 'e87984118d573b7e6eea5547eaa43ea98bbf5447': Don't paint/allocate off screen tiles
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp4
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.cpp14
2 files changed, 10 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index 827c858..a8c4d7a 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -57,8 +57,8 @@
// TODO: dynamically determine based on DPI
#define PREFETCH_SCALE_MODIFIER 0.3
#define PREFETCH_OPACITY 1
-#define PREFETCH_X_DIST 1
-#define PREFETCH_Y_DIST 2
+#define PREFETCH_X_DIST 0
+#define PREFETCH_Y_DIST 1
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp
index 34f0d4e..b3b4daf 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp
@@ -142,9 +142,6 @@ void TiledPage::invalidateRect(const IntRect& inval, const unsigned int pictureC
void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y, const SkIRect& tileBounds)
{
- if (y < 0)
- return;
-
for (int i = 0; i < tilesInRow; i++) {
int x = firstTileX;
@@ -156,9 +153,6 @@ void TiledPage::prepareRow(bool goingLeft, int tilesInRow, int firstTileX, int y
else
x += i;
- if (x < 0)
- continue;
-
BaseTile* currentTile = 0;
BaseTile* availableTile = 0;
for (int j = 0; j < m_baseTileSize; j++) {
@@ -269,6 +263,14 @@ void TiledPage::prepare(bool goingDown, bool goingLeft, const SkIRect& tileBound
nbTilesHeight += expandY * 2;
}
+ // crop the prepared region to the contents of the base layer
+ float maxWidthTiles = m_glWebViewState->baseContentWidth() * m_scale / TilesManager::tileWidth();
+ float maxHeightTiles = m_glWebViewState->baseContentHeight() * m_scale / TilesManager::tileHeight();
+ firstTileX = std::max(0, firstTileX);
+ firstTileY = std::max(0, firstTileY);
+ lastTileX = std::min(lastTileX, static_cast<int>(ceilf(maxWidthTiles)) - 1);
+ lastTileY = std::min(lastTileY, static_cast<int>(ceilf(maxHeightTiles)) - 1);
+
m_expandedTileBounds.fLeft = firstTileX;
m_expandedTileBounds.fTop = firstTileY;
m_expandedTileBounds.fRight = lastTileX;