From 20ed54e0d613ead8237af598d8e8e1f5ea3f8b82 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 23 Jul 2012 11:29:08 -0700 Subject: Don't attach empty PicturePile content to layer This fixes a frequent warning that was occurring due to empty-content layers being painted in merged layers: "Warning: painting PicturePile without content!" Change-Id: I71dbc3cdf1adbbcdd15c833add753cdd06cfcd4f --- Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 2807163..25441f4 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -852,8 +852,9 @@ bool GraphicsLayerAndroid::paintContext(LayerAndroid* layer, // TODO: add content checks (text, opacity, etc.) picture.updatePicturesIfNeeded(this); + // store the newly painted content in the layer if it's not empty PicturePileLayerContent* content = new PicturePileLayerContent(picture); - layer->setContent(content); + layer->setContent(content->isEmpty() ? 0 : content); SkSafeUnref(content); return true; -- cgit v1.1