From e5c9306b222e597f907697ab28a7936bfc61e487 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 4 May 2012 11:08:55 -0700 Subject: Disable prerenders while scrolling Bug: 6445656 Change-Id: I3d9e2cece4b3ec86deb00e98ae98f281525dab48 --- .../graphics/android/rendering/SurfaceCollection.cpp | 12 ++++-------- .../platform/graphics/android/rendering/SurfaceCollection.h | 2 +- .../graphics/android/rendering/SurfaceCollectionManager.cpp | 3 ++- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'Source/WebCore/platform') diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp index 0bdbf38..7e7a503 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp @@ -83,21 +83,17 @@ SurfaceCollection::~SurfaceCollection() #endif } -void SurfaceCollection::prepareGL(const SkRect& visibleContentRect) +void SurfaceCollection::prepareGL(const SkRect& visibleContentRect, bool tryToFastBlit) { updateLayerPositions(visibleContentRect); bool layerTilesDisabled = m_compositedRoot->state()->layersRenderingMode() > GLWebViewState::kClippedTextures; - bool updateWithBlit = true; if (!layerTilesDisabled) { - for (unsigned int i = 0; i < m_surfaces.size(); i++) { - updateWithBlit &= m_surfaces[i]->canUpdateWithBlit(); - if (!updateWithBlit) - break; - } + for (unsigned int i = 0; tryToFastBlit && i < m_surfaces.size(); i++) + tryToFastBlit &= m_surfaces[i]->canUpdateWithBlit(); } for (unsigned int i = 0; i < m_surfaces.size(); i++) - m_surfaces[i]->prepareGL(layerTilesDisabled, updateWithBlit); + m_surfaces[i]->prepareGL(layerTilesDisabled, tryToFastBlit); } static inline bool compareSurfaceZ(const Surface* a, const Surface* b) diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h index 5cfd943..18e50ee 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h @@ -48,7 +48,7 @@ public: virtual ~SurfaceCollection(); // Tiled painting methods (executed on groups) - void prepareGL(const SkRect& visibleContentRect); + void prepareGL(const SkRect& visibleContentRect, bool tryToFastBlit = false); bool drawGL(const SkRect& visibleContentRect); Color getBackgroundColor(); void swapTiles(); diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp index b26be03..7c42bd9 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp @@ -171,7 +171,8 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect, m_paintingCollection->evaluateAnimations(currentTime); - m_paintingCollection->prepareGL(visibleContentRect); + bool tryFastBlit = !m_fastSwapMode; + m_paintingCollection->prepareGL(visibleContentRect, tryFastBlit); m_paintingCollection->computeTexturesAmount(texturesResultPtr); if (!TilesManager::instance()->useDoubleBuffering() || m_paintingCollection->isReady()) { -- cgit v1.1