diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-05-03 14:39:35 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-05-03 14:57:33 -0700 |
commit | 44fc37bf2a57490f319e5ddd4f692abf235cb9ca (patch) | |
tree | 2b7db852a98ff2c1f2fca046b532d455061f93f1 | |
parent | e859a34171f2a36877d95197d118d962078f8aa0 (diff) | |
download | external_webkit-44fc37bf2a57490f319e5ddd4f692abf235cb9ca.zip external_webkit-44fc37bf2a57490f319e5ddd4f692abf235cb9ca.tar.gz external_webkit-44fc37bf2a57490f319e5ddd4f692abf235cb9ca.tar.bz2 |
Fixed single-surface rendering with fixed-background elements
In single-surface rendering, we did not paint the surface collection
correctly if there was more than one child on the base surface
(which is the case with fixed-background elements).
Change-Id: I6e8d34630060414159b5f13cd302c1dc2165a048
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/Surface.cpp | 12 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp index 652c165..437b8ff 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp @@ -192,10 +192,10 @@ void Surface::prepareGL(bool layerTilesDisabled, bool updateWithBlit) ALOGV("prepareGL on Surf %p, no SurfBack, needsTexture? %d", this, m_surfaceBacking, needsTexture()); - if (!needsTexture()) + if (needsTexture() || (isBase() && layerTilesDisabled)) + m_surfaceBacking = new SurfaceBacking(isBase()); + else return; - - m_surfaceBacking = new SurfaceBacking(isBase()); } if (tilesDisabled) { @@ -351,8 +351,10 @@ bool Surface::paint(SkCanvas* canvas) // In single surface mode, draw layer content onto the base layer if (isBase() && getFirstLayer()->countChildren() - && getFirstLayer()->state()->layersRenderingMode() > GLWebViewState::kClippedTextures) - getFirstLayer()->getChild(0)->drawCanvas(canvas, true, Layer::FlattenedLayers); + && getFirstLayer()->state()->layersRenderingMode() > GLWebViewState::kClippedTextures) { + for (unsigned int i = 0; i < getFirstLayer()->countChildren(); i++) + getFirstLayer()->getChild(i)->drawCanvas(canvas, true, Layer::FlattenedLayers); + } } else { SkAutoCanvasRestore acr(canvas, true); SkMatrix matrix; diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 4e6ffc6..34740a8 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -824,7 +824,6 @@ BaseLayerAndroid* WebViewCore::createBaseLayer() FixedBackgroundBaseLayerAndroid* baseBackground = new FixedBackgroundBaseLayerAndroid(content); - // TODO -- check we don't have the assumption that baselayer has only one child realBase = new BaseLayerAndroid(0); realBase->setSize(content->width(), content->height()); realBase->addChild(baseBackground); |