diff options
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 30 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 2 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 5 |
3 files changed, 31 insertions, 6 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 824a5d1..277840d 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -184,6 +184,7 @@ LayerAndroid::~LayerAndroid() { removeTexture(0); removeChildren(); + delete m_extra; m_contentsImage->safeUnref(); m_recordingPicture->safeUnref(); m_animations.clear(); @@ -900,10 +901,11 @@ void LayerAndroid::contentDraw(SkCanvas* canvas) } else { canvas->drawPicture(*m_recordingPicture); } - if (m_extra) { - IntRect dummy; // inval area, unused for now - m_extra->draw(canvas, this, &dummy); - } + + m_atomicSync.lock(); + if (m_extra) + canvas->drawPicture(*m_extra); + m_atomicSync.unlock(); #ifdef LAYER_DEBUG float w = getSize().width(); @@ -1182,9 +1184,27 @@ LayerAndroid* LayerAndroid::findById(int match) void LayerAndroid::setExtra(DrawExtra* extra) { - m_extra = extra; for (int i = 0; i < countChildren(); i++) getChild(i)->setExtra(extra); + + android::AutoMutex lock(m_atomicSync); + if (extra || (m_extra && !extra)) + m_dirty = true; + + delete m_extra; + m_extra = 0; + + if (!extra) + return; + + if (m_recordingPicture) { + IntRect dummy; // inval area, unused for now + m_extra = new SkPicture(); + SkCanvas* canvas = m_extra->beginRecording(m_recordingPicture->width(), + m_recordingPicture->height()); + extra->draw(canvas, this, &dummy); + m_extra->endRecording(); + } } } // namespace WebCore diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index 6b76b58..66fbe15 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -296,7 +296,7 @@ private: typedef HashMap<String, RefPtr<AndroidAnimation> > KeyframesMap; KeyframesMap m_animations; - DrawExtra* m_extra; + SkPicture* m_extra; int m_uniqueId; // We have two textures pointers -- one if the texture we are currently diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 9eff795..0c18d85 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -474,6 +474,11 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras) picture.endRecording(); } m_glWebViewState->setExtra(m_baseLayer, picture, rect); + + LayerAndroid* compositeLayer = compositeRoot(); + if (compositeLayer) + compositeLayer->setExtra(extra); + SkRect visibleRect; calcOurContentVisibleRect(&visibleRect); bool ret = m_baseLayer->drawGL(viewRect, visibleRect, scale); |