From e13f94616ccce173b7eb3f9f691d8ff5e3eb86f3 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Wed, 23 May 2012 18:47:46 -0700 Subject: Don't set up background images if 1x1 We do this check in other places. We still need a better solution for the general case. bug:6540356 Change-Id: I3f75c62141d7b6993928927117d972d0ec224b55 --- .../platform/graphics/android/GraphicsLayerAndroid.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/platform/graphics') 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()); -- cgit v1.1