Bug 1420865 - Don't check for CONTENT_MAY_CHANGE_TRANSFORM across layer trees. r=mstange, a=RyanVM
authorRyan Hunt <rhunt@eqrion.net>
Mon, 07 May 2018 16:07:06 -0500
changeset 473397 151ea913c9a32f499bbfb077e331554c0d251e83
parent 473396 a4753784833d68799720789ce80526eed1d0e084
child 473398 5e73575edddf28dbf6eb5a8d3d4cb079e38472da
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, RyanVM
bugs1420865
milestone61.0
Bug 1420865 - Don't check for CONTENT_MAY_CHANGE_TRANSFORM across layer trees. r=mstange, a=RyanVM MayResample() is used on the content and compositor to determine whether the whole visible region should be or should have been validated. This calculation is done partially by traversing ancestor layers and looking for a flag. This can return different values then in the content side versus the shadow side, which in this case leads to artifacts. This commit tries to solve the problem by ignoring layers that content is unaware of. This works, but has the downside that resampling artifacts could show up if the parent process is truly doing animations that require resampling. MozReview-Commit-ID: 4TW6nzxS6E
gfx/layers/Layers.cpp
gfx/layers/Layers.h
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -458,16 +458,20 @@ Layer::SnapTransform(const Matrix4x4& aT
 
 static bool
 AncestorLayerMayChangeTransform(Layer* aLayer)
 {
   for (Layer* l = aLayer; l; l = l->GetParent()) {
     if (l->GetContentFlags() & Layer::CONTENT_MAY_CHANGE_TRANSFORM) {
       return true;
     }
+
+    if (l->GetParent() && l->GetParent()->AsRefLayer()) {
+      return false;
+    }
   }
   return false;
 }
 
 bool
 Layer::MayResample()
 {
   Matrix transform2d;
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1792,16 +1792,19 @@ public:
 
   virtual int32_t GetMaxLayerSize() { return Manager()->GetMaxTextureSize(); }
 
   /**
    * Returns true if this layer's effective transform is not just
    * a translation by integers, or if this layer or some ancestor layer
    * is marked as having a transform that may change without a full layer
    * transaction.
+   *
+   * Note: This function ignores ancestor layers across layer tree boundaries
+   * so that it returns a consistent value when compositing and when painting.
    */
   bool MayResample();
 
   RenderTargetRect TransformRectToRenderTarget(const LayerIntRect& aRect);
 
   /**
    * Add debugging information to the layer dump.
    */