summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-10-14 16:18:12 -0700
committerNicolas Roard <nicolas@android.com>2010-10-14 16:18:12 -0700
commit09fce604f7e67802272bf991cb667509521c36b3 (patch)
treee9658c1cf520d462bea44cc1b0e2560699424f68
parent19058237c678a394169062fa2f572634fd406018 (diff)
downloadexternal_webkit-09fce604f7e67802272bf991cb667509521c36b3.zip
external_webkit-09fce604f7e67802272bf991cb667509521c36b3.tar.gz
external_webkit-09fce604f7e67802272bf991cb667509521c36b3.tar.bz2
Fix PictureSet update crash
Change-Id: I5fec3f1ce421831b3fecae4030d63a29fe75fa1c
-rw-r--r--WebCore/platform/graphics/android/BaseLayerAndroid.cpp13
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index 0bb2928..3719c35 100644
--- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -63,6 +63,9 @@ int BaseLayerAndroid::count()
#endif
BaseLayerAndroid::BaseLayerAndroid()
+#if USE(ACCELERATED_COMPOSITING)
+ : m_glWebViewState(0)
+#endif
{
#ifdef DEBUG_COUNT
gBaseLayerAndroidCount++;
@@ -79,7 +82,17 @@ BaseLayerAndroid::~BaseLayerAndroid()
void BaseLayerAndroid::setContent(const PictureSet& src)
{
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_glWebViewState) {
+ m_glWebViewState->baseLayerLock();
+ m_content.set(src);
+ m_glWebViewState->baseLayerUnlock();
+ } else {
+ m_content.set(src);
+ }
+#else
m_content.set(src);
+#endif
}
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h
index ac3943e..4cbbdc0 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.h
+++ b/WebCore/platform/graphics/android/GLWebViewState.h
@@ -175,6 +175,9 @@ public:
unsigned int currentPictureCounter() const { return m_currentPictureCounter; }
SkRect& invalidatedRect() { return m_invalidatedRect; }
+ void baseLayerLock() { m_baseLayerLock.lock(); }
+ void baseLayerUnlock() { m_baseLayerLock.unlock(); }
+
private:
// Delay between scheduling a new page when the scale