summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-12-07 10:58:49 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-07 10:58:49 -0800
commitf288ebbc0f8b160082a78668df554a4ae7192e11 (patch)
tree265f16b35d1d32ba16c71bffef8a828612e0fa74
parent5b7927778dc52a2279927acdbef479ca994c843e (diff)
parent429351139cee4eb681000434a73fabc3450a1f1d (diff)
downloadexternal_webkit-f288ebbc0f8b160082a78668df554a4ae7192e11.zip
external_webkit-f288ebbc0f8b160082a78668df554a4ae7192e11.tar.gz
external_webkit-f288ebbc0f8b160082a78668df554a4ae7192e11.tar.bz2
Merge "Account for dirty tiles doubly in texture counting" into ics-mr1
-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()