diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-02-04 11:57:40 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2011-02-04 14:11:29 -0500 |
commit | 2bac1e45807d68b80f4a5cc7a62d0e3c24a4b6f6 (patch) | |
tree | 4fc5ebfe391f35bcc51881f75a47017ab0abe64b /WebCore/platform/graphics/android/MediaLayer.cpp | |
parent | afd330e2308bd382fb7d31431cb47e2d7a99f26a (diff) | |
download | external_webkit-2bac1e45807d68b80f4a5cc7a62d0e3c24a4b6f6.zip external_webkit-2bac1e45807d68b80f4a5cc7a62d0e3c24a4b6f6.tar.gz external_webkit-2bac1e45807d68b80f4a5cc7a62d0e3c24a4b6f6.tar.bz2 |
Only invalidate the webview when the plugin has new content.
bug: 3424551
Change-Id: I07beef845bb41980144222c3c5d076db8120037c
Diffstat (limited to 'WebCore/platform/graphics/android/MediaLayer.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/MediaLayer.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/WebCore/platform/graphics/android/MediaLayer.cpp b/WebCore/platform/graphics/android/MediaLayer.cpp index fac94f5..7a4c02d 100644 --- a/WebCore/platform/graphics/android/MediaLayer.cpp +++ b/WebCore/platform/graphics/android/MediaLayer.cpp @@ -40,11 +40,11 @@ namespace WebCore { -MediaLayer::MediaLayer() : LayerAndroid(false) +MediaLayer::MediaLayer(jobject weakWebViewRef) : LayerAndroid(false) { m_bufferedTexture = new MediaTexture(EGL_NO_CONTEXT); m_bufferedTexture->incStrong(this); - m_videoTexture = new VideoTexture(); + m_videoTexture = new VideoTexture(weakWebViewRef); m_videoTexture->incStrong(this); m_currentTextureInfo = 0; @@ -78,6 +78,8 @@ bool MediaLayer::drawGL(SkMatrix& matrix) // draw any video content if present m_videoTexture->drawVideo(drawTransform()); + bool needsInval = true; + // draw the primary content if (m_bufferedTexture) { TextureInfo* textureInfo = m_bufferedTexture->consumerLock(); @@ -95,14 +97,13 @@ bool MediaLayer::drawGL(SkMatrix& matrix) TilesManager::instance()->shader()->drawLayerQuad(m, rect, textureInfo->m_textureId, 1.0f); //TODO fix this m_drawOpacity + if (!rect.isEmpty()) + needsInval = false; } m_bufferedTexture->consumerRelease(); } - drawChildrenGL(matrix); - - //TODO allow plugins to specify when they should be drawn - return true; + return drawChildrenGL(matrix) || needsInval; } ANativeWindow* MediaLayer::acquireNativeWindowForVideo() |