summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-09-08 14:53:37 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-08 14:53:37 -0700
commita2938835206f51208d52e324eb20ded39ed28d1e (patch)
treeef334c627b148c087c52965490cd43a5b1f6049e /Source/WebCore
parent3dbec40108fe6f94e4eff7c84979b6c3a5340c64 (diff)
parentab3df5899158b0bcb5c7bb6858d9717a22781ad3 (diff)
downloadexternal_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.zip
external_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.tar.gz
external_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.tar.bz2
Merge "Stop layer tile flickering"
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index 769d9e3..bb8feb9 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -270,10 +270,11 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
// 1. If a tile isn't owned, break with that one
// 2. If we find a tile in the same page with a different scale,
// it's old and not visible. Break with that one
- // 3. Otherwise, use the least recently prepared tile
+ // 3. Otherwise, use the least recently prepared tile, but ignoring tiles
+ // drawn in the last frame to avoid flickering
BaseTileTexture* farthestTexture = 0;
- unsigned long long oldestDrawCount = ~0; //maximum u64
+ unsigned long long oldestDrawCount = getDrawGLCount() - 1;
const unsigned int max = availableTexturePool->size();
for (unsigned int i = 0; i < max; i++) {
BaseTileTexture* texture = (*availableTexturePool)[i];
@@ -298,16 +299,18 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
}
}
- TextureOwner* previousOwner = farthestTexture->owner();
- if (farthestTexture && farthestTexture->acquire(owner)) {
- if (previousOwner) {
- XLOG("%s texture %p stolen from tile %d, %d, drawCount was %llu",
- owner->isLayerTile() ? "LAYER" : "BASE",
- farthestTexture, owner->x(), owner->y(), oldestDrawCount);
+ if (farthestTexture) {
+ TextureOwner* previousOwner = farthestTexture->owner();
+ if (farthestTexture->acquire(owner)) {
+ if (previousOwner) {
+ XLOG("%s texture %p stolen from tile %d, %d, drawCount was %llu",
+ owner->isLayerTile() ? "LAYER" : "BASE",
+ farthestTexture, owner->x(), owner->y(), oldestDrawCount);
+ }
+
+ availableTexturePool->remove(availableTexturePool->find(farthestTexture));
+ return farthestTexture;
}
-
- availableTexturePool->remove(availableTexturePool->find(farthestTexture));
- return farthestTexture;
}
XLOG("Couldn't find an available texture for tile %x (%d, %d) out of %d available!!!",