summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2011-01-19 09:58:30 -0500
committerCary Clark <cary@android.com>2011-01-19 12:30:25 -0500
commitf3cef498906fce0a2d7787f7475f6df232baaead (patch)
tree6cacb5b6460ab5d63c219320739ad7e8153940f7 /WebCore/platform/graphics/android/GLWebViewState.cpp
parent07f392a57e45b228e53dd45cb7bd464edde5e23d (diff)
downloadexternal_webkit-f3cef498906fce0a2d7787f7475f6df232baaead.zip
external_webkit-f3cef498906fce0a2d7787f7475f6df232baaead.tar.gz
external_webkit-f3cef498906fce0a2d7787f7475f6df232baaead.tar.bz2
don't draw buttons while they are created
There are three threads all hammering at the same resource. The WebViewCore thread records the buttons on the page. The WebView thread rerecords the button pictures to show selection and focus. The GLWebViewState thread draws the picture containing the button pictures into the tile. Prevent drawing the picture while the buttons are recorded by sharing the button mutext with the GL tile creation. bug:3354678 Change-Id: I245ed47ad5a6d1fe28ea870bd7c557937eed1164
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index 1c32848..45915e5 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -63,7 +63,7 @@ int GLWebViewState::count()
}
#endif
-GLWebViewState::GLWebViewState()
+GLWebViewState::GLWebViewState(android::Mutex* buttonMutex)
: m_scaleRequestState(kNoScaleRequest)
, m_currentScale(1)
, m_futureScale(1)
@@ -72,6 +72,7 @@ GLWebViewState::GLWebViewState()
, m_baseLayer(0)
, m_currentPictureCounter(0)
, m_usePageA(true)
+ , m_globalButtonMutex(buttonMutex)
{
m_viewport.setEmpty();
m_futureViewportTileBounds.setEmpty();
@@ -135,8 +136,11 @@ void GLWebViewState::inval(const IntRect& rect)
unsigned int GLWebViewState::paintBaseLayerContent(SkCanvas* canvas)
{
android::Mutex::Autolock lock(m_baseLayerLock);
- if (m_baseLayer)
+ if (m_baseLayer) {
+ m_globalButtonMutex->lock();
m_baseLayer->drawCanvas(canvas);
+ m_globalButtonMutex->unlock();
+ }
return m_currentPictureCounter;
}