Bug 1497059 - Bail out on empty dtRect. r=mstange
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 09 Oct 2018 23:09:39 +0000
changeset 496085 8995622893ecaa74ae47835a75677496c4368637
parent 496084 3fafffb5ace29b9a357f264d4a821348d540ec36
child 496086 f2b367bc188af94df47032d10cab669d0dc0c474
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1497059
milestone64.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 1497059 - Bail out on empty dtRect. r=mstange I thought it was going to be trivial to add a test-case for this with a scale transform and such, but I haven't been able to. This restores the wallpaper that there was before my change. Differential Revision: https://phabricator.services.mozilla.com/D8000
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -1859,16 +1859,19 @@ WebRenderCommandBuilder::GenerateFallbac
   // rerasterize on MotionMark
   bool differentScale = gfx::FuzzyEqual(scale.width, oldScale.width, 1e-6f) &&
                         gfx::FuzzyEqual(scale.height, oldScale.height, 1e-6f);
 
   LayoutDeviceToLayerScale2D layerScale(scale.width, scale.height);
   auto scaledBounds = bounds * layerScale;
   auto dtRect = RoundedOut(scaledBounds);
   auto dtSize = dtRect.Size();
+  if (dtSize.IsEmpty()) {
+    return nullptr;
+  }
 
   aImageRect = dtRect / layerScale;
 
   auto offset = aImageRect.TopLeft();
 
   nsDisplayItemGeometry* geometry = fallbackData->GetGeometry();
 
   bool needPaint = true;