summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-08-01 11:32:58 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-08-02 17:48:21 -0700
commit7c554a61cb935660cdc86905d040c781b490150f (patch)
tree033ba7f31eb01931dd94eb37cff5e014faf79bc3 /Source/WebCore/platform/graphics/android/GLWebViewState.cpp
parentd4f990572c3485cdc15cff48c3bedc6e7cad809b (diff)
downloadexternal_webkit-7c554a61cb935660cdc86905d040c781b490150f.zip
external_webkit-7c554a61cb935660cdc86905d040c781b490150f.tar.gz
external_webkit-7c554a61cb935660cdc86905d040c781b490150f.tar.bz2
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
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp10
1 files changed, 9 insertions, 1 deletions
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<LayerAndroid*>(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();