diff options
author | Chris Craik <ccraik@google.com> | 2012-07-17 09:48:23 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-17 09:48:23 -0700 |
commit | df35691cd76b673c8a24babfab42d6bec4ee465b (patch) | |
tree | a8466827447f0fc86978af7a1fb3eacc9b554dfe /Source/WebCore/platform | |
parent | 0453f79675ffe6fddb59add2dcee0e3f0e7e74b1 (diff) | |
download | external_webkit-df35691cd76b673c8a24babfab42d6bec4ee465b.zip external_webkit-df35691cd76b673c8a24babfab42d6bec4ee465b.tar.gz external_webkit-df35691cd76b673c8a24babfab42d6bec4ee465b.tar.bz2 |
Revert "Don't prepare in invoke mode unless needed"
bug:6829376
This reverts commit 0453f79675ffe6fddb59add2dcee0e3f0e7e74b1
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp | 30 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.h | 9 |
2 files changed, 6 insertions, 33 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp index 09cb832..1270498 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp @@ -49,7 +49,6 @@ SurfaceCollectionManager::SurfaceCollectionManager() , m_fastSwapMode(false) , m_previouslyScrolling(false) , m_newPaintingCollection(false) - , m_lastPreparedCollection(0) { } @@ -230,26 +229,6 @@ int SurfaceCollectionManager::singleSurfaceModeInvalidation(bool hasRunningAnima return returnFlags; } -void SurfaceCollectionManager::prepareGL(SurfaceCollection* collection, SkRect& visibleContentRect, - float scale, TexturesResult* texturesResultPtr, - bool shouldDraw, bool tryFastBlit) -{ - - // don't prepare if not drawing, and nothing changed - if (!shouldDraw - && collection == m_lastPreparedCollection - && visibleContentRect == m_lastPreparedRect - && std::abs(scale - m_lastPreparedScale) < 0.01) - return; - - collection->prepareGL(visibleContentRect, tryFastBlit); - collection->computeTexturesAmount(texturesResultPtr); - - m_lastPreparedCollection = collection; - m_lastPreparedRect = visibleContentRect; - m_lastPreparedScale = scale; -} - int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect, SkRect& visibleContentRect, float scale, bool scrolling, bool singleSurfaceMode, @@ -273,8 +252,9 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect, m_paintingCollection->evaluateAnimations(currentTime); - prepareGL(m_paintingCollection, visibleContentRect, scale, - texturesResultPtr, shouldDraw, tryFastBlit); + m_paintingCollection->prepareGL(visibleContentRect, tryFastBlit); + m_paintingCollection->computeTexturesAmount(texturesResultPtr); + if (!TilesManager::instance()->useDoubleBuffering() || m_paintingCollection->isReady()) { ALOGV("have painting collection %p ready, swapping!", m_paintingCollection); didCollectionSwap = true; @@ -288,8 +268,8 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect, } } else if (m_drawingCollection) { ALOGV("preparing drawing collection %p", m_drawingCollection); - prepareGL(m_drawingCollection, visibleContentRect, scale, - texturesResultPtr, shouldDraw, tryFastBlit); + m_drawingCollection->prepareGL(visibleContentRect); + m_drawingCollection->computeTexturesAmount(texturesResultPtr); } if (m_paintingCollection) diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.h index 70b84df..53b5bb6 100644 --- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.h +++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.h @@ -26,10 +26,10 @@ #ifndef SurfaceCollectionManager_h #define SurfaceCollectionManager_h -#include "SkRect.h" #include "TestExport.h" #include <utils/threads.h> +class SkRect; class SkCanvas; namespace WebCore { @@ -60,9 +60,6 @@ private: void clearCollections(); void updatePaintingCollection(SurfaceCollection* newCollection); int singleSurfaceModeInvalidation(bool hasRunningAnimation, bool scrolling, bool shouldDraw); - void prepareGL(SurfaceCollection* collection, SkRect& visibleContentRect, float scale, - TexturesResult* texturesResultPtr, bool shouldDraw, bool tryFastBlit); - SurfaceCollection* m_drawingCollection; SurfaceCollection* m_paintingCollection; SurfaceCollection* m_queuedCollection; @@ -73,10 +70,6 @@ private: // Used in single surface mode only. True if there is a new painting tree // added for the current frame. bool m_newPaintingCollection; - - SurfaceCollection* m_lastPreparedCollection; - SkRect m_lastPreparedRect; - float m_lastPreparedScale; }; } // namespace WebCore |