Bug 1516286. WR Fallback: Do the empty check later. r=aosmond
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 08 Oct 2019 14:20:40 +0000
changeset 496778 44d332a2e17a4bb895105cf87449806700ef1e44
parent 496777 e0427b37129bb0272be31d8d212db607db776f5c
child 496779 388dbc366e53877fea8728a12ff568d587f73d5a
push id36668
push useraiakab@mozilla.com
push dateWed, 09 Oct 2019 04:06:09 +0000
treeherdermozilla-central@26ebfec08834 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1516286
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516286. WR Fallback: Do the empty check later. r=aosmond What we actually care about here is whether itemRect is empty bceause that's the what we'll use for the actual surface size. Differential Revision: https://phabricator.services.mozilla.com/D48548
gfx/layers/wr/WebRenderCommandBuilder.cpp
layout/base/crashtests/crashtests.list
layout/base/crashtests/empty-mask.html
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -2427,19 +2427,16 @@ Maybe<wr::ImageMask> WebRenderCommandBui
           aMaskItem, aBuilder.GetRenderRoot());
 
   if (!maskData) {
     return Nothing();
   }
 
   bool snap;
   nsRect bounds = aMaskItem->GetBounds(aDisplayListBuilder, &snap);
-  if (bounds.IsEmpty()) {
-    return Nothing();
-  }
 
   const int32_t appUnitsPerDevPixel =
       aMaskItem->Frame()->PresContext()->AppUnitsPerDevPixel();
 
   Size scale = aSc.GetInheritedScale();
   Size oldScale = maskData->mScale;
   // This scale determination should probably be done using
   // ChooseScaleAndSetTransform but for now we just fake it.
@@ -2447,16 +2444,20 @@ Maybe<wr::ImageMask> WebRenderCommandBui
   // rerasterize on MotionMark
   bool sameScale = FuzzyEqual(scale.width, oldScale.width, 1e-6f) &&
                    FuzzyEqual(scale.height, oldScale.height, 1e-6f);
 
   LayerIntRect itemRect =
       LayerIntRect::FromUnknownRect(bounds.ScaleToOutsidePixels(
           scale.width, scale.height, appUnitsPerDevPixel));
 
+  if (itemRect.IsEmpty()) {
+    return Nothing();
+  }
+
   LayoutDeviceToLayerScale2D layerScale(scale.width, scale.height);
   LayoutDeviceRect imageRect = LayerRect(itemRect) / layerScale;
 
   nsPoint maskOffset = aMaskItem->ToReferenceFrame() - bounds.TopLeft();
 
   nsRect dirtyRect;
   if (aMaskItem->IsInvalid(dirtyRect) ||
       !itemRect.IsEqualInterior(maskData->mItemRect) ||
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -578,8 +578,9 @@ load 1553874.html
 load 1560328.html
 pref(layout.css.column-span.enabled,true) load 1566672.html
 load 1574101-1.html
 load 1574101-2.html
 HTTP load 1575908-1.html
 load 1576972-1.html
 pref(layout.css.column-span.enabled,true) load 1579953-1.html
 pref(layout.css.column-span.enabled,true) load 1580576.html
+load empty-mask.html
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/empty-mask.html
@@ -0,0 +1,14 @@
+<style>
+* {
+  -webkit-transform: scaleY(96);
+  float: left;
+  border-top: 4em solid
+}
+#a {
+  clip-path: polygon(0px 0px, 1px 0px, 48px 1px);
+}
+</style>
+<time>
+<ul>
+<li id="a">
+A