diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index dd8e904f2059..ab38bbfd3f9f 100755 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -108,10 +108,6 @@ SelectLayerGeometry(const Maybe& aParentGeometry, { // Both the parent and the child layer were split. if (aParentGeometry && aChildGeometry) { - // As we use intermediate surface in these cases, this branch should never - // get executed. - MOZ_ASSERT(false, - "Both parent and child geometry present in nested 3D context!"); return Some(aParentGeometry->ClipPolygon(*aChildGeometry)); } @@ -453,12 +449,16 @@ RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager, layerToRender->SetClearRect(gfx::IntRect(0, 0, 0, 0)); } } else { + // Since we force an intermediate surface for nested 3D contexts, + // aGeometry and childGeometry are both in the same coordinate space. Maybe geometry = SelectLayerGeometry(aGeometry, childGeometry); // If we are dealing with a nested 3D context, we might need to transform - // the geometry to the coordinate space of the parent 3D context leaf. - const bool isLeafLayer = layer->AsContainerLayer() == nullptr; + // the geometry back to the coordinate space of the current layer before + // rendering the layer. + ContainerLayer* container = layer->AsContainerLayer(); + const bool isLeafLayer = !container || container->UseIntermediateSurface(); if (geometry && isLeafLayer) { TransformLayerGeometry(layer, geometry); diff --git a/layout/reftests/transform-3d/intermediate-1-ref.html b/layout/reftests/transform-3d/intermediate-1-ref.html new file mode 100644 index 000000000000..53f8045c8792 --- /dev/null +++ b/layout/reftests/transform-3d/intermediate-1-ref.html @@ -0,0 +1,43 @@ + + + + + + + + + +
+
+
+
+
+
+ + diff --git a/layout/reftests/transform-3d/intermediate-1.html b/layout/reftests/transform-3d/intermediate-1.html new file mode 100644 index 000000000000..cfc822f4b270 --- /dev/null +++ b/layout/reftests/transform-3d/intermediate-1.html @@ -0,0 +1,50 @@ + + + + + + + + + +
+
+
+
+
+
+
+
+ + diff --git a/layout/reftests/transform-3d/reftest.list b/layout/reftests/transform-3d/reftest.list index 7c4d111af335..173c94975a13 100644 --- a/layout/reftests/transform-3d/reftest.list +++ b/layout/reftests/transform-3d/reftest.list @@ -88,3 +88,4 @@ fuzzy(255,100) fails-if(webrender) == split-non-ortho1.html split-non-ortho1-ref fuzzy-if(winWidget,150,120) fails-if(webrender) == component-alpha-1.html component-alpha-1-ref.html fails-if(webrender) == nested-transform-1.html nested-transform-1-ref.html fails-if(webrender) == transform-geometry-1.html transform-geometry-1-ref.html +fails-if(webrender) == intermediate-1.html intermediate-1-ref.html