summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-10-11 14:35:51 -0700
committerChris Craik <ccraik@google.com>2011-10-11 15:41:34 -0700
commit93bfc77abb66a95750b747cf5d782c31beadf7cf (patch)
treeac0b60eb2ca3f88b1bd136d3802852c42cf87c00 /Source/WebCore/platform/graphics
parent8242049005e7219ea9846eff8eff3cead8e2461e (diff)
downloadexternal_webkit-93bfc77abb66a95750b747cf5d782c31beadf7cf.zip
external_webkit-93bfc77abb66a95750b747cf5d782c31beadf7cf.tar.gz
external_webkit-93bfc77abb66a95750b747cf5d782c31beadf7cf.tar.bz2
Fixed infinite redraw loop from running out of layer tiles
bug:5349958 Clear a flag when a layer tile can't allocate a texture, and only try and redraw from tile dirtiness if that flag is set. Also, don't ask for redraw if offending tiles are offscreen. Change-Id: Iadb0cb267a9c1f308e5b42a6e0e3b4bc71d18ece
Diffstat (limited to 'Source/WebCore/platform/graphics')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/TiledTexture.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.h5
4 files changed, 20 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index 94bf045..827c858 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -337,9 +337,13 @@ bool BaseLayerAndroid::drawGL(double currentTime, LayerAndroid* compositedRoot,
TilesManager::instance()->videoLayerManager()->deleteUnusedTextures();
compositedRoot->prepare(m_glWebViewState);
- if (compositedRoot->drawGL(m_glWebViewState, matrix))
- needsRedraw = true;
- else if (!animsRunning)
+ if (compositedRoot->drawGL(m_glWebViewState, matrix)) {
+ if (TilesManager::instance()->layerTexturesRemain()) {
+ // only try redrawing for layers if layer textures remain,
+ // otherwise we'll repaint without getting anything done
+ needsRedraw = true;
+ }
+ } else if (!animsRunning)
m_glWebViewState->resetLayersDirtyArea();
}
diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
index 8c63b42..ce4dc7f 100644
--- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
@@ -219,8 +219,8 @@ bool TiledTexture::draw()
for (unsigned int i = 0; i < m_tiles.size(); i++) {
BaseTile* tile = m_tiles[i];
- askRedraw |= !tile->isTileReady();
if (tile->isTileVisible(m_area)) {
+ askRedraw |= !tile->isTileReady();
SkRect rect;
rect.fLeft = tile->x() * tileWidth;
rect.fTop = tile->y() * tileHeight;
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index f077d48..38a3788 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -93,7 +93,7 @@ int TilesManager::getMaxTextureAllocation()
}
TilesManager::TilesManager()
- : m_layersMemoryUsage(0)
+ : m_layerTexturesRemain(true)
, m_maxTextureCount(0)
, m_generatorReady(false)
, m_showVisualIndicator(false)
@@ -237,6 +237,7 @@ void TilesManager::gatherLayerTextures()
{
android::Mutex::Autolock lock(m_texturesLock);
m_availableTilesTextures = m_tilesTextures;
+ m_layerTexturesRemain = true;
}
BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
@@ -326,6 +327,13 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner)
availableTexturePool->remove(availableTexturePool->find(farthestTexture));
return farthestTexture;
}
+ } else {
+ if (owner->isLayerTile()) {
+ // couldn't find a tile for a layer, layers shouldn't request redraw
+ // TODO: once we do layer prefetching, don't set this for those
+ // tiles
+ m_layerTexturesRemain = false;
+ }
}
XLOG("Couldn't find an available texture for %s tile %x (%d, %d) out of %d available",
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h
index 1549581..b7d6aa6 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.h
+++ b/Source/WebCore/platform/graphics/android/TilesManager.h
@@ -87,6 +87,8 @@ public:
void gatherLayerTextures();
void gatherTextures();
+ bool layerTexturesRemain() { return m_layerTexturesRemain; }
+
BaseTileTexture* getAvailableTexture(BaseTile* owner);
void markGeneratorAsReady()
@@ -197,11 +199,10 @@ private:
Vector<BaseTileTexture*> m_tilesTextures;
Vector<BaseTileTexture*> m_availableTilesTextures;
+ bool m_layerTexturesRemain;
Vector<PaintedSurface*> m_paintedSurfaces;
- unsigned int m_layersMemoryUsage;
-
int m_maxTextureCount;
bool m_generatorReady;