diff options
author | Chris Craik <ccraik@google.com> | 2011-10-11 16:08:53 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-11 16:08:53 -0700 |
commit | 144926737b2b4e6f76f5c6347db3093b8a483e21 (patch) | |
tree | 4d67977d39d9ebf847c75554ce42364919d47401 /Source/WebCore | |
parent | 46f244f2351cbaa1a251d79605ed6d7e21d1d53f (diff) | |
parent | 93bfc77abb66a95750b747cf5d782c31beadf7cf (diff) | |
download | external_webkit-144926737b2b4e6f76f5c6347db3093b8a483e21.zip external_webkit-144926737b2b4e6f76f5c6347db3093b8a483e21.tar.gz external_webkit-144926737b2b4e6f76f5c6347db3093b8a483e21.tar.bz2 |
Merge "Fixed infinite redraw loop from running out of layer tiles" into ics-mr0
Diffstat (limited to 'Source/WebCore')
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 72c48b2..2d0cc7f 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; |