diff options
author | Chris Craik <ccraik@google.com> | 2011-09-08 14:53:37 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-08 14:53:37 -0700 |
commit | a2938835206f51208d52e324eb20ded39ed28d1e (patch) | |
tree | ef334c627b148c087c52965490cd43a5b1f6049e /Source/WebCore/platform/graphics | |
parent | 3dbec40108fe6f94e4eff7c84979b6c3a5340c64 (diff) | |
parent | ab3df5899158b0bcb5c7bb6858d9717a22781ad3 (diff) | |
download | external_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.zip external_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.tar.gz external_webkit-a2938835206f51208d52e324eb20ded39ed28d1e.tar.bz2 |
Merge "Stop layer tile flickering"
Diffstat (limited to 'Source/WebCore/platform/graphics')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesManager.cpp | 25 |
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!!!", |