summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-12-07 11:02:30 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-07 11:02:30 -0800
commit5857949e50a7f0ace43ba5d349fc4aacf0dd1847 (patch)
tree93aaf294adc302b40811fc7c029f6c340bddadfc /Source
parent801032d5838b8b449ddfbfb3d10b464ec9d5156e (diff)
parentf288ebbc0f8b160082a78668df554a4ae7192e11 (diff)
downloadexternal_webkit-5857949e50a7f0ace43ba5d349fc4aacf0dd1847.zip
external_webkit-5857949e50a7f0ace43ba5d349fc4aacf0dd1847.tar.gz
external_webkit-5857949e50a7f0ace43ba5d349fc4aacf0dd1847.tar.bz2
am f288ebbc: Merge "Account for dirty tiles doubly in texture counting" into ics-mr1
* commit 'f288ebbc0f8b160082a78668df554a4ae7192e11': Account for dirty tiles doubly in texture counting
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()