Diff
Modified: trunk/LayoutTests/ChangeLog (87761 => 87762)
--- trunk/LayoutTests/ChangeLog 2011-05-31 23:37:48 UTC (rev 87761)
+++ trunk/LayoutTests/ChangeLog 2011-05-31 23:49:22 UTC (rev 87762)
@@ -1,3 +1,13 @@
+2011-05-27 Adrienne Walker <[email protected]>
+
+ Reviewed by James Robinson.
+
+ [chromium] Fix crash from empty reflections with masks
+ https://bugs.webkit.org/show_bug.cgi?id=61654
+
+ * compositing/reflections/empty-reflection-with-mask-expected.txt: Added.
+ * compositing/reflections/empty-reflection-with-mask.html: Added.
+
2011-05-31 Berend-Jan Wever <[email protected]>
Reviewed by Adam Barth.
Added: trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask-expected.txt (0 => 87762)
--- trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask-expected.txt 2011-05-31 23:49:22 UTC (rev 87762)
@@ -0,0 +1 @@
+
Property changes on: trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask.html (0 => 87762)
--- trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask.html (rev 0)
+++ trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask.html 2011-05-31 23:49:22 UTC (rev 87762)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+
+<!-- this test should render a blank page -->
+
+<html>
+<head>
+ <style>
+ div {
+ width: 500px;
+ height: 500px;
+ -webkit-transform:translateZ(0);
+ -webkit-box-reflect: below 0 -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(255, 255, 255, 1.0)));
+ }
+ </style>
+ <script type="text/_javascript_" charset="utf-8">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ </script>
+</head>
+<body>
+ <div></div>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/reflections/empty-reflection-with-mask.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (87761 => 87762)
--- trunk/Source/WebCore/ChangeLog 2011-05-31 23:37:48 UTC (rev 87761)
+++ trunk/Source/WebCore/ChangeLog 2011-05-31 23:49:22 UTC (rev 87762)
@@ -1,3 +1,22 @@
+2011-05-27 Adrienne Walker <[email protected]>
+
+ Reviewed by James Robinson.
+
+ [chromium] Fix crash from empty reflections with masks
+ https://bugs.webkit.org/show_bug.cgi?id=61654
+
+ Change the iteration for updateCompositorResources to match that being
+ done in the paint and draw steps. This mismatch of iteration style
+ was causing layers with replica masks to correctly get skipped while
+ painting but not get skipped during texture upload.
+
+ Test: compositing/reflections/empty-reflection-with-mask.html
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::updateLayers):
+ (WebCore::LayerRendererChromium::updateCompositorResources):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+
2011-05-31 B.J. Wever <[email protected]>
Reviewed by Adam Barth.
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (87761 => 87762)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2011-05-31 23:37:48 UTC (rev 87761)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2011-05-31 23:49:22 UTC (rev 87762)
@@ -330,10 +330,10 @@
s_inPaintLayerContents = false;
#endif
- // FIXME: Before updateCompositorResourcesRecursive, when the compositor runs in
+ // FIXME: Before updateCompositorResources, when the compositor runs in
// its own thread, and when the copyTexImage2D bug is fixed, insert
// a glWaitLatch(Compositor->Offscreen) on all child contexts here instead
- // of after updateCompositorResourcesRecursive.
+ // of after updateCompositorResources.
// Also uncomment the glSetLatch(Compositor->Offscreen) code in addChildContext.
// if (hardwareCompositing() && m_contextSupportsLatch) {
// // For each child context:
@@ -347,11 +347,11 @@
// }
// }
- updateCompositorResourcesRecursive(m_rootLayer.get());
+ updateCompositorResources(renderSurfaceLayerList);
// Update compositor resources for root layer.
m_rootLayerContentTiler->updateRect();
- // After updateCompositorResourcesRecursive, set/wait latches for all child
+ // After updateCompositorResources, set/wait latches for all child
// contexts. This will prevent the compositor from using any of the child
// parent textures while WebGL commands are executing from _javascript_ *and*
// while the final parent texture is being blit'd. copyTexImage2D
@@ -854,26 +854,44 @@
m_layerSorter.sort(&descendants.at(thisLayerIndex), descendants.end());
}
-void LayerRendererChromium::updateCompositorResourcesRecursive(LayerChromium* layer)
+void LayerRendererChromium::updateCompositorResources(const LayerList& renderSurfaceLayerList)
{
- const Vector<RefPtr<LayerChromium> >& children = layer->children();
- for (size_t i = 0; i < children.size(); ++i)
- updateCompositorResourcesRecursive(children[i].get());
+ for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
+ CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();
+ RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
+ ASSERT(renderSurface);
+ if (!renderSurface->m_layerList.size())
+ continue;
+
+ LayerList& layerList = renderSurface->m_layerList;
+ ASSERT(layerList.size());
+ for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
+ CCLayerImpl* ccLayerImpl = layerList[layerIndex].get();
+ if (ccLayerImpl->renderSurface() && ccLayerImpl->renderSurface() != renderSurface)
+ continue;
+
+ updateCompositorResources(ccLayerImpl);
+ }
+ }
+}
+
+void LayerRendererChromium::updateCompositorResources(CCLayerImpl* ccLayerImpl)
+{
+ LayerChromium* layer = ccLayerImpl->owner();
+
if (layer->bounds().isEmpty())
return;
if (layer->maskLayer())
- updateCompositorResourcesRecursive(layer->maskLayer());
+ updateCompositorResources(ccLayerImpl->maskLayer());
if (layer->replicaLayer())
- updateCompositorResourcesRecursive(layer->replicaLayer());
+ updateCompositorResources(ccLayerImpl->replicaLayer());
- CCLayerImpl* drawLayer = layer->ccLayerImpl();
+ if (ccLayerImpl->drawsContent())
+ ccLayerImpl->updateCompositorResources();
- if (drawLayer->drawsContent())
- drawLayer->updateCompositorResources();
-
- layer->pushPropertiesTo(drawLayer);
+ layer->pushPropertiesTo(ccLayerImpl);
}
void LayerRendererChromium::setCompositeOffscreen(bool compositeOffscreen)
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (87761 => 87762)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h 2011-05-31 23:37:48 UTC (rev 87761)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h 2011-05-31 23:49:22 UTC (rev 87762)
@@ -167,7 +167,8 @@
void updatePropertiesAndRenderSurfaces(CCLayerImpl*, const TransformationMatrix& parentMatrix, LayerList& renderSurfaceLayerList, LayerList& layers);
void paintLayerContents(const LayerList&);
- void updateCompositorResourcesRecursive(LayerChromium*);
+ void updateCompositorResources(const LayerList& renderSurfaceLayerList);
+ void updateCompositorResources(CCLayerImpl*);
void drawLayers(const LayerList& renderSurfaceLayerList);
void drawLayer(CCLayerImpl*, RenderSurfaceChromium*);