summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTile.cpp20
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp24
2 files changed, 16 insertions, 28 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp
index a4ce788..dc17a21 100644
--- a/Source/WebCore/platform/graphics/android/BaseTile.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp
@@ -135,12 +135,13 @@ void BaseTile::reserveTexture()
if (texture && m_backTexture != texture) {
m_swapDrawCount = 0; // no longer ready to swap
m_backTexture = texture;
- }
- // a texture reservation will only happen if we're dirty, or ready to
- // swap. if it's the former, ensure it's marked dirty.
- if (!m_swapDrawCount)
- m_dirty = true;
+ // this is to catch when the front texture is stolen from beneath us. We
+ // should refine the stealing method to be simpler, and not require last
+ // moment checks like this
+ if (!m_frontTexture)
+ m_dirty = true;
+ }
}
bool BaseTile::removeTexture(BaseTileTexture* texture)
@@ -149,15 +150,12 @@ bool BaseTile::removeTexture(BaseTileTexture* texture)
this, m_backTexture, m_frontTexture, m_page);
// We update atomically, so paintBitmap() can see the correct value
android::AutoMutex lock(m_atomicSync);
- if (m_frontTexture == texture)
+ if (m_frontTexture == texture) {
m_frontTexture = 0;
+ m_dirty = true;
+ }
if (m_backTexture == texture)
m_backTexture = 0;
-
- // mark dirty regardless of which texture was taken - the back texture may
- // have been ready to swap
- m_dirty = true;
-
return true;
}
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index e1d7665..ee35ce2 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -267,13 +267,11 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
}
// The heuristic for selecting a texture is as follows:
- // 1. Skip textures currently being painted, they can't be painted while
- // busy anyway
- // 2. If a tile isn't owned, break with that one
- // 3. Don't let tiles acquire their front textures
- // 4. If we find a tile in the same page with a different scale,
+ // 1. If a tile isn't owned, break with that one
+ // 2. Don't let tiles acquire their front textures
+ // 3. If we find a tile in the same page with a different scale,
// it's old and not visible. Break with that one
- // 5. Otherwise, use the least recently prepared tile, but ignoring tiles
+ // 4. Otherwise, use the least recently prepared tile, but ignoring tiles
// drawn in the last frame to avoid flickering
BaseTileTexture* farthestTexture = 0;
@@ -282,23 +280,15 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
for (unsigned int i = 0; i < max; i++) {
BaseTileTexture* texture = (*availableTexturePool)[i];
TextureOwner* currentOwner = texture->owner();
-
- if (texture->busy()) {
- // don't bother, since the acquire() will likely fail
- continue;
- }
-
if (!currentOwner) {
- // unused texture! take it!
farthestTexture = texture;
break;
}
- if (currentOwner == owner) {
- // Don't let a tile acquire its own front texture, as the
- // acquisition logic doesn't handle that
+ // Don't let a tile acquire its own front texture, as the acquisition
+ // logic doesn't handle that
+ if (currentOwner == owner)
continue;
- }
if (currentOwner->page() == owner->page() && texture->scale() != owner->scale()) {
// if we render the back page with one scale, then another while