summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2012-07-18 14:58:47 -0700
committerNicolas Roard <nicolasroard@google.com>2012-07-18 14:58:47 -0700
commit3096f2d11f3fb84553c85836b666b08fe4c01d49 (patch)
treec4e93d088b2efca106c8d8420180447a1c0708dc
parentd12967fd535d36a592841c6c4bb112bd94092b3c (diff)
downloadexternal_webkit-3096f2d11f3fb84553c85836b666b08fe4c01d49.zip
external_webkit-3096f2d11f3fb84553c85836b666b08fe4c01d49.tar.gz
external_webkit-3096f2d11f3fb84553c85836b666b08fe4c01d49.tar.bz2
Fix crashes -- we were resetting a potentially
used PicturePile. bug:6835416 Change-Id: I5d810af206e111cfb7645e53d11f1aa6b35b313e
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 3cbf43e..45141e1 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -844,24 +844,17 @@ bool GraphicsLayerAndroid::paintContext(LayerAndroid* layer,
TRACE_METHOD();
- if (!layer->content()) {
- WebCore::PicturePile picture;
- picture.setSize(IntSize(m_size.width(), m_size.height()));
- PicturePileLayerContent* content = new PicturePileLayerContent(picture);
- layer->setContent(content);
- SkSafeUnref(content);
- }
-
- PicturePileLayerContent* pcontent = static_cast<PicturePileLayerContent*>(layer->content());
- WebCore::PicturePile* layerContent = pcontent->picturePile();
-
- // TODO: we might be able to reuse an existing picture instead of resetting it.
- // we can't do that because of transparency -- for now, we just invalidate everything.
- layerContent->reset();
- layerContent->setSize(IntSize(m_size.width(), m_size.height()));
+ // TODO: we might be able to reuse an existing picture instead of recreating it.
+ // we can't do that because of transparency -- for now, we just create
+ // a new picture every time.
+ WebCore::PicturePile picture;
+ picture.setSize(IntSize(m_size.width(), m_size.height()));
+ PicturePileLayerContent* content = new PicturePileLayerContent(picture);
+ layer->setContent(content);
+ SkSafeUnref(content);
// TODO: add content checks (text, opacity, etc.)
- layerContent->updatePicturesIfNeeded(this);
+ picture.updatePicturesIfNeeded(this);
return true;
}