diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-11-04 13:56:14 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-11-10 18:27:56 -0800 |
commit | 5997528e55d0dc6734718bde61faa8513b1dd54f (patch) | |
tree | 62b22677aeffd0f36ee9aa5c283e7eaab9cf9b1d /Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp | |
parent | c97291b2e7a966abf8dbad5cf2e0e8b033c3cd90 (diff) | |
download | external_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.zip external_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.tar.gz external_webkit-5997528e55d0dc6734718bde61faa8513b1dd54f.tar.bz2 |
Fallback mode when running out of textures for layers
- Implements a degraded rendering mode when running out of textures
- Speed up rendering by reusing the same SkBitmap in RasterRenderer
- Some refactoring
bug:5279231
Change-Id: I52943a87bed56c49b01b47fea4fa1a5c49e09e93
Diffstat (limited to 'Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 2a1b1de..0e6f64f 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -101,13 +101,14 @@ void BaseLayerAndroid::setContent(const PictureSet& src) // setSize(src.width(), src.height()); } -void BaseLayerAndroid::drawCanvas(SkCanvas* canvas) +bool BaseLayerAndroid::drawCanvas(SkCanvas* canvas) { #if USE(ACCELERATED_COMPOSITING) android::Mutex::Autolock lock(m_drawLock); #endif if (!m_content.isEmpty()) m_content.draw(canvas); + return true; } #if USE(ACCELERATED_COMPOSITING) @@ -307,16 +308,6 @@ bool BaseLayerAndroid::drawGL(double currentTime, LayerAndroid* compositedRoot, m_glWebViewState->resetFrameworkInval(); if (compositedRoot) { - TransformationMatrix ident; - - bool animsRunning = compositedRoot->evaluateAnimations(); - if (animsRunning) - needsRedraw = true; - - compositedRoot->updateFixedLayersPositions(visibleRect); - FloatRect clip(0, 0, viewRect.width(), viewRect.height()); - compositedRoot->updateGLPositionsAndScale( - ident, clip, 1, m_glWebViewState->zoomManager()->layersScale()); SkMatrix matrix; matrix.setTranslate(viewRect.x(), viewRect.y()); @@ -326,20 +317,16 @@ bool BaseLayerAndroid::drawGL(double currentTime, LayerAndroid* compositedRoot, compositedRoot->nbLayers(), compositedRoot->nbTexturedLayers()); #endif - - // Clean up GL textures for video layer. - TilesManager::instance()->videoLayerManager()->deleteUnusedTextures(); - - compositedRoot->prepare(m_glWebViewState); - if (compositedRoot->drawGL(m_glWebViewState, matrix)) { + // For now, we render layers only if the rendering mode + // is kAllTextures or kClippedTextures + if (m_glWebViewState->layersRenderingMode() < GLWebViewState::kScrollableAndFixedLayers + && 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(); - + } } m_previousVisible = visibleRect; |