diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-05-23 19:01:30 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-23 19:01:30 -0700 |
commit | 6f4fd96b140b47cb8215dfe480209424929b609e (patch) | |
tree | 5165fb34ca2458d702837216119550a7b277bee0 /Source | |
parent | 596f7241ffc821ce234bc891c2fb54483c96c16c (diff) | |
parent | e13f94616ccce173b7eb3f9f691d8ff5e3eb86f3 (diff) | |
download | external_webkit-6f4fd96b140b47cb8215dfe480209424929b609e.zip external_webkit-6f4fd96b140b47cb8215dfe480209424929b609e.tar.gz external_webkit-6f4fd96b140b47cb8215dfe480209424929b609e.tar.bz2 |
Merge "Don't set up background images if 1x1" into jb-dev
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 11 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 7 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index ef355c7..5207ace 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -592,6 +592,13 @@ void GraphicsLayerAndroid::updateFixedBackgroundLayers() { if (!view->style()->hasFixedBackgroundImage()) return; + Image* image = FixedBackgroundImageLayerAndroid::GetCachedImage(view->style()); + if (!image) + return; + + if (image->width() == 1 && image->height() == 1) + return; + SkSafeUnref(m_foregroundClipLayer); SkSafeUnref(m_fixedBackgroundLayer); SkSafeUnref(m_foregroundLayer); @@ -605,10 +612,6 @@ void GraphicsLayerAndroid::updateFixedBackgroundLayers() { // use the background image and create a layer for it // the layer will be fixed positioned. - Image* image = FixedBackgroundImageLayerAndroid::GetCachedImage(view->style()); - if (!image) - return; - m_fixedBackgroundLayer = new FixedBackgroundImageLayerAndroid(view->style(), view->width(), view->height()); diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index d07b00e..9592d29 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -843,8 +843,11 @@ BaseLayerAndroid* WebViewCore::createBaseLayer(GraphicsLayerAndroid* root) Color viewBackground = view->baseBackgroundColor(); background = bodyHasCSSBackground ? viewBackground.blend(background) : viewBackground; } - bodyHasFixedBackgroundImage = style->hasFixedBackgroundImage() - && FixedBackgroundImageLayerAndroid::GetCachedImage(style); + if (style->hasFixedBackgroundImage()) { + Image* backgroundImage = FixedBackgroundImageLayerAndroid::GetCachedImage(style); + if (backgroundImage && backgroundImage->width() > 1 && backgroundImage->height() > 1) + bodyHasFixedBackgroundImage = true; + } } PicturePileLayerContent* content = new PicturePileLayerContent(m_content); |