From 7c554a61cb935660cdc86905d040c781b490150f Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Mon, 1 Aug 2011 11:32:58 -0700 Subject: Shared surface texture Instead of assigning each tile a Surface Texture, now just a normal GL texture. The content from skia bitmap will first drawn into a queue of Surface Textures, at draw time, blit them into each tile's GL texture. Added extra lock to protect the queue operation and Surface Texture operation. bug:5044597 Change-Id: I25f46228b93a3e99526daf52d8bd0d8d8fcc2879 --- Source/WebCore/platform/graphics/android/GLWebViewState.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Source/WebCore/platform/graphics/android/GLWebViewState.cpp') diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 07dda03..df8ecbe 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -104,6 +104,9 @@ GLWebViewState::GLWebViewState(android::Mutex* buttonMutex) GLWebViewState::~GLWebViewState() { + // Take care of the transfer queue such that Tex Gen thread will not stuck + TilesManager::instance()->unregisterGLWebViewState(this); + // We have to destroy the two tiled pages first as their destructor // may depend on the existence of this GLWebViewState and some of its // instance variables in order to complete. @@ -121,7 +124,7 @@ GLWebViewState::~GLWebViewState() #ifdef DEBUG_COUNT ClassTracker::instance()->decrement("GLWebViewState"); #endif - TilesManager::instance()->unregisterGLWebViewState(this); + } void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval, @@ -544,6 +547,11 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect, if (baseForComposited && baseForComposited->countChildren() >= 1) compositedRoot = static_cast(baseForComposited->getChild(0)); + // Here before we draw, update the BaseTile which has updated content. + // Inside this function, just do GPU blits from the transfer queue into + // the BaseTiles' texture. + TilesManager::instance()->transferQueue()->updateDirtyBaseTiles(); + if (compositedRoot != m_previouslyUsedRoot) { TilesManager::instance()->swapLayersTextures(m_previouslyUsedRoot, compositedRoot); TilesManager::instance()->cleanupTilesTextures(); -- cgit v1.1