summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2012-05-23 19:06:00 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-23 19:06:00 -0700
commit415b03411f96b199071dc0aedc30f9517659929f (patch)
tree1c33e96ec2db539a33cbc5fcfcf5214c68d16f02
parent668d6f8ffd1fc17b5c6f5abf072b97430993d118 (diff)
parentcd6a3bff0abccf9f1c3c3351c6984be2c3124239 (diff)
downloadexternal_webkit-415b03411f96b199071dc0aedc30f9517659929f.zip
external_webkit-415b03411f96b199071dc0aedc30f9517659929f.tar.gz
external_webkit-415b03411f96b199071dc0aedc30f9517659929f.tar.bz2
am cd6a3bff: am 6f4fd96b: Merge "Don\'t set up background images if 1x1" into jb-dev
* commit 'cd6a3bff0abccf9f1c3c3351c6984be2c3124239': Don't set up background images if 1x1
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp11
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp7
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 fd1b7d0..00cec40 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);