[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
simon.fraser at apple.com
simon.fraser at apple.com
Thu Feb 4 21:20:47 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 7dc90bcb30abee8bb1140bc9140591f1e0b3dda6
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 20 00:37:23 2010 +0000
2010-01-19 Simon Fraser <simon.fraser at apple.com>
Reviewed by Dan Bernstein.
Occasional crash when interacting with page with reflected WebGL
https://bugs.webkit.org/show_bug.cgi?id=33863
If updateCompositingLayers() was called with an updateRoot that was a reflection layer,
then we would determine that the layer does not require compositing, and tear down its
backing (without clearing replicaLayer() on the source layer's GraphicsLayer).
Fix by changing requiresCompositingLayer() on a reflection layer to always give the
same answer for a reflection and its original.
Also add various belt-and-brances code and null checks to ensure that if we ever end up
with a non-composited reflection layer, we won't crash.
No new tests, because the crash depends on timing issues that are hard to reproduce in a test.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::replicaLayer): Make this public so we can use it in an assertion.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking): Clear the source layer's replica layer
pointer if tearing down backing store of a reflection.
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Null-check reflection->backing().
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Null-check reflection->backing().
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): reflection->backing().
(WebCore::RenderLayerCompositor::requiresCompositingLayer): If being called for a reflection layer,
use the source layer to answer the question.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index de96a9b..21a0594 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -169,6 +169,38 @@
Reviewed by Dan Bernstein.
+ Occasional crash when interacting with page with reflected WebGL
+ https://bugs.webkit.org/show_bug.cgi?id=33863
+
+ If updateCompositingLayers() was called with an updateRoot that was a reflection layer,
+ then we would determine that the layer does not require compositing, and tear down its
+ backing (without clearing replicaLayer() on the source layer's GraphicsLayer).
+
+ Fix by changing requiresCompositingLayer() on a reflection layer to always give the
+ same answer for a reflection and its original.
+
+ Also add various belt-and-brances code and null checks to ensure that if we ever end up
+ with a non-composited reflection layer, we won't crash.
+
+ No new tests, because the crash depends on timing issues that are hard to reproduce in a test.
+
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::replicaLayer): Make this public so we can use it in an assertion.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateBacking): Clear the source layer's replica layer
+ pointer if tearing down backing store of a reflection.
+
+ (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Null-check reflection->backing().
+ (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Null-check reflection->backing().
+ (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): reflection->backing().
+ (WebCore::RenderLayerCompositor::requiresCompositingLayer): If being called for a reflection layer,
+ use the source layer to answer the question.
+
+2010-01-19 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Dan Bernstein.
+
Some composited reflections incorrectly positioned
https://bugs.webkit.org/show_bug.cgi?id=33856
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index ee01911..9bc4174 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -202,6 +202,8 @@ public:
virtual void setReplicatedByLayer(GraphicsLayer*);
// Whether this layer is being replicated by another layer.
bool isReplicated() const { return m_replicaLayer; }
+ // The layer that replicates this layer (if any).
+ GraphicsLayer* replicaLayer() const { return m_replicaLayer; }
const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
@@ -337,8 +339,6 @@ protected:
virtual void setOpacityInternal(float) { }
- // The layer that replicates this layer (if any).
- GraphicsLayer* replicaLayer() const { return m_replicaLayer; }
// The layer being replicated.
GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index 9a7f3e5..4a0b40d 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -38,8 +38,9 @@
#include "HitTestResult.h"
#include "HTMLCanvasElement.h"
#include "Page.h"
-#include "RenderLayerBacking.h"
#include "RenderEmbeddedObject.h"
+#include "RenderLayerBacking.h"
+#include "RenderReplica.h"
#include "RenderVideo.h"
#include "RenderView.h"
#include "Settings.h"
@@ -237,6 +238,17 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
}
} else {
if (layer->backing()) {
+ // If we're removing backing on a reflection, clear the source GraphicsLayer's pointer to
+ // its replica GraphicsLayer. In practice this should never happen because reflectee and reflection
+ // are both either composited, or not composited.
+ if (layer->isReflection()) {
+ RenderLayer* sourceLayer = toRenderBoxModelObject(layer->renderer()->parent())->layer();
+ if (RenderLayerBacking* backing = sourceLayer->backing()) {
+ ASSERT(backing->graphicsLayer()->replicaLayer() == layer->backing()->graphicsLayer());
+ backing->graphicsLayer()->setReplicatedByLayer(0);
+ }
+ }
+
layer->clearBacking();
layerChanged = true;
@@ -624,8 +636,10 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, cons
// we can compute and cache the composited bounds for this layer.
layerBacking->updateCompositedBounds();
- if (layer->reflectionLayer())
- layer->reflectionLayer()->backing()->updateCompositedBounds();
+ if (RenderLayer* reflection = layer->reflectionLayer()) {
+ if (reflection->backing())
+ reflection->backing()->updateCompositedBounds();
+ }
layerBacking->updateGraphicsLayerConfiguration();
layerBacking->updateGraphicsLayerGeometry();
@@ -700,8 +714,10 @@ void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer)
// we can compute and cache the composited bounds for this layer.
layerBacking->updateCompositedBounds();
- if (layer->reflectionLayer())
- layer->reflectionLayer()->backing()->updateCompositedBounds();
+ if (RenderLayer* reflection = layer->reflectionLayer()) {
+ if (reflection->backing())
+ reflection->backing()->updateCompositedBounds();
+ }
layerBacking->updateGraphicsLayerConfiguration();
layerBacking->updateGraphicsLayerGeometry();
@@ -743,8 +759,10 @@ void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer* com
if (RenderLayerBacking* layerBacking = layer->backing()) {
layerBacking->updateCompositedBounds();
- if (layer->reflectionLayer())
- layer->reflectionLayer()->backing()->updateCompositedBounds();
+ if (RenderLayer* reflection = layer->reflectionLayer()) {
+ if (reflection->backing())
+ reflection->backing()->updateCompositedBounds();
+ }
layerBacking->updateGraphicsLayerGeometry();
if (updateDepth == RenderLayerBacking::CompositingChildren)
@@ -905,6 +923,11 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) const
{
RenderObject* renderer = layer->renderer();
+ // The compositing state of a reflection should match that of its reflected layer.
+ if (layer->isReflection()) {
+ renderer = renderer->parent(); // The RenderReplica's parent is the object being reflected.
+ layer = toRenderBoxModelObject(renderer)->layer();
+ }
// The root layer always has a compositing layer, but it may not have backing.
return (inCompositingMode() && layer->isRootLayer()) ||
requiresCompositingForTransform(renderer) ||
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list