summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-12-06 17:40:33 -0800
committerChris Craik <ccraik@google.com>2011-12-06 17:40:33 -0800
commit429351139cee4eb681000434a73fabc3450a1f1d (patch)
treea6b404349927642835e8dd552eff3ba11d0b6e37 /Source
parent1d71a5f4405639dece648eda291ab6a2aecbb968 (diff)
downloadexternal_webkit-429351139cee4eb681000434a73fabc3450a1f1d.zip
external_webkit-429351139cee4eb681000434a73fabc3450a1f1d.tar.gz
external_webkit-429351139cee4eb681000434a73fabc3450a1f1d.tar.bz2
Account for dirty tiles doubly in texture counting
bug:5704511 Dirty tiles use two textures - one for display, and one for painting. This fixes an issue where the number of textures requested did not meet the needs of a double buffered tree with most content invalidated. The webview would give up drawing, and thus not paint the invalidated portions of the layers. Change-Id: Icd9b9e0b53cf82415074dac4338a8c48de880364
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/TiledTexture.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
index 6711527..d538416 100644
--- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
@@ -224,8 +224,19 @@ BaseTile* TiledTexture::getTile(int x, int y)
int TiledTexture::nbTextures(IntRect& area, float scale)
{
- IntRect computedTilesArea = computeTilesArea(area, scale);
- return computedTilesArea.width() * computedTilesArea.height();
+ IntRect tileBounds = computeTilesArea(area, scale);
+ int numberTextures = tileBounds.width() * tileBounds.height();
+
+ // add the number of dirty tiles in the bounds, as they take up double
+ // textures for double buffering
+ for (unsigned int i = 0; i <m_tiles.size(); i++) {
+ BaseTile* tile = m_tiles[i];
+ if (tile->isDirty()
+ && tile->x() >= tileBounds.x() && tile->x() <= tileBounds.maxX()
+ && tile->y() >= tileBounds.y() && tile->y() <= tileBounds.maxY())
+ numberTextures++;
+ }
+ return numberTextures;
}
bool TiledTexture::draw()