Bug 914457 - Part 1: Use an empty clip rect for layers with an empty visible region
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Mon, 14 Sep 2015 09:26:10 -0700
changeset 294985 8129b18d73980a107fcb12eced2827dfccd3fd18
parent 294984 3e3f42614efba0923b56e86388c06510765e2dd0
child 294986 7367ddecab995ef76d068d2fa4c188e32bbba8ef
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs914457
milestone43.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 914457 - Part 1: Use an empty clip rect for layers with an empty visible region - Layer::CalculateScissorRect no longer asserts when all children of a 3d transformed layer have an empty visible region.
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -695,16 +695,23 @@ Layer::CalculateScissorRect(const Render
   } else {
     currentClip = aCurrentScissorRect;
   }
 
   if (!GetEffectiveClipRect()) {
     return currentClip;
   }
 
+  if (GetVisibleRegion().IsEmpty()) {
+    // When our visible region is empty, our parent may not have created the
+    // intermediate surface that we would require for correct clipping; however,
+    // this does not matter since we are invisible.
+    return RenderTargetIntRect(currentClip.TopLeft(), RenderTargetIntSize(0, 0));
+  }
+
   const RenderTargetIntRect clipRect =
     ViewAs<RenderTargetPixel>(*GetEffectiveClipRect(),
                               PixelCastJustification::RenderTargetIsParentLayerForRoot);
   if (clipRect.IsEmpty()) {
     // We might have a non-translation transform in the container so we can't
     // use the code path below.
     return RenderTargetIntRect(currentClip.TopLeft(), RenderTargetIntSize(0, 0));
   }