diff options
author | Patrick Scott <phanna@android.com> | 2011-03-02 10:45:24 -0500 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2011-03-07 09:11:25 -0500 |
commit | 9e143ba2bd15b3dd507999ba142269ab17df938a (patch) | |
tree | e1661ae18b008491e59c1597069e1b81e0ef8294 /WebCore | |
parent | 4ffd02f8c673bc6ce1a6b96f9fd3b21e8337ec7c (diff) | |
download | external_webkit-9e143ba2bd15b3dd507999ba142269ab17df938a.zip external_webkit-9e143ba2bd15b3dd507999ba142269ab17df938a.tar.gz external_webkit-9e143ba2bd15b3dd507999ba142269ab17df938a.tar.bz2 |
Do not merge.
Remove the notion of root layers.
We were computing the root layer status incorrectly for some child layers. If an
iframe has a layer but it hasn't been attached, we might assume it is the root
layer of the tree and not produce a recording content.
Bug: 3492471
Change-Id: Ib81fb26d76742d74ebe244c34c1fab353fb9b78d
Diffstat (limited to 'WebCore')
5 files changed, 12 insertions, 32 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 7963ae0..4cd48a8 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -124,11 +124,7 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : m_foregroundClipLayer(0) { RenderLayer* renderLayer = renderLayerFromClient(m_client); - m_contentLayer = new LayerAndroid(renderLayer, true); - if (renderLayer) { - m_contentLayer->setIsRootLayer(renderLayer->isRootLayer() - && !(renderLayer->renderer()->frame()->ownerElement())); - } + m_contentLayer = new LayerAndroid(renderLayer); gDebugGraphicsLayerAndroidInstances++; } @@ -390,8 +386,6 @@ void GraphicsLayerAndroid::setDrawsContent(bool drawsContent) if (drawsContent == m_drawsContent) return; GraphicsLayer::setDrawsContent(drawsContent); - if (m_contentLayer->isRootLayer()) - return; if (m_drawsContent) { m_haveContents = true; setNeedsDisplay(); @@ -503,7 +497,7 @@ void GraphicsLayerAndroid::updateScrollingLayers() if (layerNeedsOverflow) { ASSERT(!m_foregroundLayer && !m_foregroundClipLayer); m_foregroundLayer = new ScrollableLayerAndroid(layer); - m_foregroundClipLayer = new LayerAndroid(layer, false); + m_foregroundClipLayer = new LayerAndroid(layer); m_foregroundClipLayer->setMasksToBounds(true); m_foregroundClipLayer->addChild(m_foregroundLayer); m_contentLayer->addChild(m_foregroundClipLayer); diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index f7e3f43..842637a 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -61,8 +61,7 @@ class OpacityDrawFilter : public SkDrawFilter { /////////////////////////////////////////////////////////////////////////////// -LayerAndroid::LayerAndroid(RenderLayer* owner, bool isRootLayer) : SkLayer(), - m_isRootLayer(isRootLayer), +LayerAndroid::LayerAndroid(RenderLayer* owner) : SkLayer(), m_haveClip(false), m_isFixed(false), m_isIframe(false), @@ -91,7 +90,6 @@ LayerAndroid::LayerAndroid(RenderLayer* owner, bool isRootLayer) : SkLayer(), } LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), - m_isRootLayer(layer.m_isRootLayer), m_haveClip(layer.m_haveClip), m_isIframe(layer.m_isIframe), m_extra(0), // deliberately not copied @@ -143,7 +141,6 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), } LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(), - m_isRootLayer(true), m_haveClip(false), m_isFixed(false), m_isIframe(false), @@ -616,7 +613,7 @@ void LayerAndroid::setContentsImage(SkBitmapRef* img) bool LayerAndroid::needsTexture() { - return m_contentsImage || (!m_isRootLayer && prepareContext() + return m_contentsImage || (prepareContext() && m_recordingPicture->width() && m_recordingPicture->height()); } @@ -1069,17 +1066,12 @@ bool LayerAndroid::prepareContext(bool force) if (masksToBounds()) return false; - if (!m_isRootLayer) { - if (force || !m_recordingPicture - || (m_recordingPicture - && ((m_recordingPicture->width() != (int) getSize().width()) - || (m_recordingPicture->height() != (int) getSize().height())))) { - SkSafeUnref(m_recordingPicture); - m_recordingPicture = new SkPicture(); - } - } else if (m_recordingPicture) { + if (force || !m_recordingPicture || + (m_recordingPicture && + ((m_recordingPicture->width() != (int) getSize().width()) || + (m_recordingPicture->height() != (int) getSize().height())))) { SkSafeUnref(m_recordingPicture); - m_recordingPicture = 0; + m_recordingPicture = new SkPicture(); } return m_recordingPicture; @@ -1224,7 +1216,6 @@ void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const writeHexVal(file, indentLevel + 1, "layer", (int)this); writeIntVal(file, indentLevel + 1, "layerId", m_uniqueId); writeIntVal(file, indentLevel + 1, "haveClip", m_haveClip); - writeIntVal(file, indentLevel + 1, "isRootLayer", m_isRootLayer); writeIntVal(file, indentLevel + 1, "isFixed", m_isFixed); writeIntVal(file, indentLevel + 1, "m_isIframe", m_isIframe); writePoint(file, indentLevel + 1, "m_iframeOffset", m_iframeOffset); diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index c315488..42356e9 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -89,7 +89,7 @@ class TiledPage; class LayerAndroid : public SkLayer, public TextureOwner { public: - LayerAndroid(RenderLayer* owner, bool isRootLayer); + LayerAndroid(RenderLayer* owner); LayerAndroid(const LayerAndroid& layer); LayerAndroid(SkPicture*); virtual ~LayerAndroid(); @@ -176,9 +176,6 @@ public: } bool masksToBounds() const { return m_haveClip; } - void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; } - bool isRootLayer() const { return m_isRootLayer; } - SkPicture* recordContext(); void addAnimation(PassRefPtr<AndroidAnimation> anim); @@ -263,8 +260,6 @@ private: bool prepareContext(bool force = false); void clipInner(SkTDArray<SkRect>* region, const SkRect& local) const; - bool m_isRootLayer; - bool m_drawsContent; bool m_haveClip; bool m_isFixed; bool m_backgroundColorSet; diff --git a/WebCore/platform/graphics/android/MediaLayer.cpp b/WebCore/platform/graphics/android/MediaLayer.cpp index 2443a5e..6c34585 100644 --- a/WebCore/platform/graphics/android/MediaLayer.cpp +++ b/WebCore/platform/graphics/android/MediaLayer.cpp @@ -40,7 +40,7 @@ namespace WebCore { -MediaLayer::MediaLayer(jobject weakWebViewRef) : LayerAndroid(false) +MediaLayer::MediaLayer(jobject weakWebViewRef) : LayerAndroid((RenderLayer*) NULL) { m_bufferedTexture = new MediaTexture(EGL_NO_CONTEXT); m_bufferedTexture->incStrong(this); diff --git a/WebCore/platform/graphics/android/ScrollableLayerAndroid.h b/WebCore/platform/graphics/android/ScrollableLayerAndroid.h index 68fba77..b23f056 100644 --- a/WebCore/platform/graphics/android/ScrollableLayerAndroid.h +++ b/WebCore/platform/graphics/android/ScrollableLayerAndroid.h @@ -27,7 +27,7 @@ class ScrollableLayerAndroid : public LayerAndroid { public: ScrollableLayerAndroid(RenderLayer* owner) - : LayerAndroid(owner, false) {} + : LayerAndroid(owner) {} ScrollableLayerAndroid(const ScrollableLayerAndroid& layer) : LayerAndroid(layer) , m_scrollLimits(layer.m_scrollLimits) {} |