[PATCH] Hack hack fun time, do not commit this! (Hacks to work around
author"Kearwood \"Kip\" Gilbert" <kgilbert@mozilla.com>
Thu, 11 Jun 2015 14:04:07 -0700
changeset 486378 6b12cd209552e3e553219d52ebd4b9535d8b005a
parent 486377 97d1ded1c412275722ee055804b9fbd81c63878d
child 486379 84ccde462c136b539e5771f184a9f4a778450c8a
push id73935
push userkgilbert@mozilla.com
push dateThu, 11 Jun 2015 23:37:13 +0000
treeherdertry@3b9917ae67dd [default view] [failures only]
bugs1171750
milestone41.0a1
[PATCH] Hack hack fun time, do not commit this! (Hacks to work around From 2dd2de43377e3418c445c98ad9646259c9ed115e Mon Sep 17 00:00:00 2001 VR specific culling issues, including Bug 1171750) --- gfx/layers/Layers.cpp | 2 +- gfx/layers/client/ClientContainerLayer.h | 6 +++--- gfx/layers/composite/ContainerLayerComposite.cpp | 4 ++++ layout/base/FrameLayerBuilder.cpp | 6 ++++-- layout/base/nsLayoutUtils.cpp | 1 + layout/generic/nsFrame.cpp | 10 +++++++--- modules/libpref/init/all.js | 4 ++-- 7 files changed, 22 insertions(+), 11 deletions(-)
gfx/layers/Layers.cpp
gfx/layers/client/ClientContainerLayer.h
gfx/layers/composite/ContainerLayerComposite.cpp
layout/base/FrameLayerBuilder.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/nsFrame.cpp
modules/libpref/init/all.js
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1282,17 +1282,17 @@ ContainerLayer::DefaultComputeEffectiveT
             useIntermediateSurface = true;
             break;
           }
         }
       }
     }
   }
 
-  mUseIntermediateSurface = useIntermediateSurface && !GetEffectiveVisibleRegion().IsEmpty();
+  mUseIntermediateSurface = useIntermediateSurface /*&& !GetEffectiveVisibleRegion().IsEmpty()*/;
   if (useIntermediateSurface) {
     ComputeEffectiveTransformsForChildren(residual);
   } else {
     ComputeEffectiveTransformsForChildren(idealTransform);
   }
 
   if (idealTransform.CanDraw2D()) {
     ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
--- a/gfx/layers/client/ClientContainerLayer.h
+++ b/gfx/layers/client/ClientContainerLayer.h
@@ -57,23 +57,23 @@ public:
     SortChildrenBy3DZOrder(children);
 
     ReadbackProcessor readback;
     readback.BuildUpdates(this);
 
     for (uint32_t i = 0; i < children.Length(); i++) {
       Layer* child = children.ElementAt(i);
       if (child->GetEffectiveVisibleRegion().IsEmpty()) {
-        continue;
+        // continue;
       }
 
       ToClientLayer(child)->RenderLayerWithReadback(&readback);
 
-      if (!ClientManager()->GetRepeatTransaction() &&
-          !child->GetInvalidRegion().IsEmpty()) {
+      if (!ClientManager()->GetRepeatTransaction() /*&&
+          !child->GetInvalidRegion().IsEmpty()*/) {
         child->Mutated();
       }
     }
   }
 
   virtual void SetVisibleRegion(const nsIntRegion& aRegion) override
   {
     NS_ASSERTION(ClientManager()->InConstruction(),
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -225,20 +225,22 @@ ContainerRenderVR(ContainerT* aContainer
     cssEyeProjection[eye].PostTranslate(-0.5f + eye * 1.0f, 0.0f, 0.0f);
   }
 
   for (uint32_t i = 0; i < children.Length(); i++) {
     LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
     Layer* layer = layerToRender->GetLayer();
     uint32_t contentFlags = layer->GetContentFlags();
 
+/*
     if (layer->GetEffectiveVisibleRegion().IsEmpty() &&
         !layer->AsContainerLayer()) {
       continue;
     }
+*/
 
     const gfx::Matrix4x4 childTransform = layer->GetEffectiveTransform();
     // We flip between pre-rendered and Gecko-rendered VR based on whether
     // the child layer of this VR container layer has PRESERVE_3D or not.
     if ((contentFlags & Layer::CONTENT_PRESERVE_3D) == 0) {
       // This layer is native VR
       DUMP("%p pre-rendered VR layer %p\n", aContainer, layerToRender);
 
@@ -392,27 +394,29 @@ ContainerPrepare(ContainerT* aContainer,
   for (uint32_t i = 0; i < children.Length(); i++) {
     LayerComposite* layerToRender = static_cast<LayerComposite*>(children.ElementAt(i)->ImplData());
 
     RenderTargetIntRect clipRect = layerToRender->GetLayer()->
         CalculateScissorRect(aClipRect);
 
     // We don't want to skip container layers because otherwise their mPrepared
     // may be null which is not allowed.
+    /*
     if (!layerToRender->GetLayer()->AsContainerLayer()) {
       if (layerToRender->GetLayer()->GetEffectiveVisibleRegion().IsEmpty()) {
         CULLING_LOG("Sublayer %p has no effective visible region\n", layerToRender->GetLayer());
         continue;
       }
 
       if (clipRect.IsEmpty()) {
         CULLING_LOG("Sublayer %p has an empty world clip rect\n", layerToRender->GetLayer());
         continue;
       }
     }
+    */
 
     CULLING_LOG("Preparing sublayer %p\n", layerToRender->GetLayer());
 
     layerToRender->Prepare(clipRect);
     aContainer->mPrepared->mLayers.AppendElement(PreparedLayer(layerToRender, clipRect));
   }
 
   CULLING_LOG("Preparing container layer %p\n", aContainer->GetLayer());
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -2934,17 +2934,17 @@ ContainerState::PrepareImageLayer(Painte
   aData->mImage->ConfigureLayer(imageLayer, mParameters);
   imageLayer->SetPostScale(mParameters.mXScale,
                            mParameters.mYScale);
 
   if (aData->mItemClip.HasClip()) {
     ParentLayerIntRect clip =
       ViewAs<ParentLayerPixel>(ScaleToNearestPixels(aData->mItemClip.GetClipRect()));
     clip.MoveBy(ViewAs<ParentLayerPixel>(mParameters.mOffset));
-    imageLayer->SetClipRect(Some(clip));
+    imageLayer->SetClipRect(Nothing()); // FINDME!!! KIP!!! HACK!!! Return to imageLayer->SetClipRect(Some(clip));
   } else {
     imageLayer->SetClipRect(Nothing());
   }
 
   mLayerBuilder->StoreOptimizedLayerForFrame(aData->mImage, imageLayer);
   FLB_LOG_PAINTED_LAYER_DECISION(aData,
                                  "  Selected image layer=%p\n", imageLayer.get());
 
@@ -3701,20 +3701,22 @@ ContainerState::ProcessDisplayItems(nsDi
       // We also need to check the old data now, because BuildLayer
       // can overwrite it.
       InvalidateForLayerChange(item, nullptr);
 
       // If the item would have its own layer but is invisible, just hide it.
       // Note that items without their own layers can't be skipped this
       // way, since their PaintedLayer may decide it wants to draw them
       // into its buffer even if they're currently covered.
+      /*
       if (itemVisibleRect.IsEmpty() &&
           !item->ShouldBuildLayerEvenIfInvisible(mBuilder)) {
         continue;
       }
+      */
 
       // 3D-transformed layers don't necessarily draw in the order in which
       // they're added to their parent container layer.
       bool mayDrawOutOfOrder = itemType == nsDisplayItem::TYPE_TRANSFORM &&
         (item->Frame()->Preserves3D() || item->Frame()->Preserves3DChildren());
 
       // Let mPaintedLayerDataTree know about this item, so that
       // FindPaintedLayerFor and FindOpaqueBackgroundColor are aware of this
@@ -3794,17 +3796,17 @@ ContainerState::ProcessDisplayItems(nsDi
       NS_ASSERTION(ownLayer->Manager() == mManager, "Wrong manager");
       NS_ASSERTION(!ownLayer->HasUserData(&gLayerManagerUserData),
                    "We shouldn't have a FrameLayerBuilder-managed layer here!");
       NS_ASSERTION(itemClip.HasClip() ||
                    itemClip.GetRoundedRectCount() == 0,
                    "If we have rounded rects, we must have a clip rect");
       // It has its own layer. Update that layer's clip and visible rects.
       if (itemClip.HasClip()) {
-        ownLayer->SetClipRect(Some(clipRect));
+        ownLayer->SetClipRect(Nothing()); // FINDME!!! KIP!!! HACK!! ownLayer->SetClipRect(Some(clipRect));
       } else {
         ownLayer->SetClipRect(Nothing());
       }
 
       // rounded rectangle clipping using mask layers
       // (must be done after visible rect is set on layer)
       if (itemClip.IsRectClippedByRoundedCorner(itemContent)) {
         SetupMaskLayer(ownLayer, itemClip, itemVisibleRect);
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3086,16 +3086,17 @@ nsLayoutUtils::PaintFrame(nsRenderingCon
   if ((aFlags & PAINT_WIDGET_LAYERS) &&
       !willFlushRetainedLayers &&
       !(aFlags & PAINT_DOCUMENT_RELATIVE) &&
       rootPresContext->NeedToComputePluginGeometryUpdates()) {
     builder.SetWillComputePluginGeometry(true);
   }
 
   nsRect canvasArea(nsPoint(0, 0), aFrame->GetSize());
+
   bool ignoreViewportScrolling =
     aFrame->GetParent() ? false : presShell->IgnoringViewportScrolling();
   if (ignoreViewportScrolling && rootScrollFrame) {
     nsIScrollableFrame* rootScrollableFrame =
       presShell->GetRootScrollFrameAsScrollable();
     if (aFlags & PAINT_DOCUMENT_RELATIVE) {
       // Make visibleRegion and aRenderingContext relative to the
       // scrolled frame instead of the root frame.
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1967,32 +1967,36 @@ nsIFrame::BuildDisplayListForStackingCon
  
   nsRect dirtyRectOutsideTransform = dirtyRect;
   if (isTransformed) {
     const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
     if (aBuilder->IsForPainting() &&
         nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, this)) {
       dirtyRect = overflow;
     } else {
+    /* FINDME!!! KIP!!! HACK!!!
       if (overflow.IsEmpty() && !Preserves3DChildren()) {
         return;
       }
+    */
 
       nsRect untransformedDirtyRect;
       if (nsDisplayTransform::UntransformRect(dirtyRect, overflow, this,
             nsPoint(0,0), &untransformedDirtyRect)) {
         dirtyRect = untransformedDirtyRect;
+
       } else {
         NS_WARNING("Unable to untransform dirty rect!");
         // This should only happen if the transform is singular, in which case nothing is visible anyway
         dirtyRect.SetEmpty();
       }
     }
     inTransform = true;
   }
+  dirtyRect = nsRect(-10000 * 60,-10000 * 60, 20000 * 60, 20000 * 60); // FINDME!!! KIP!!! HACK!!!
 
   bool usingSVGEffects = nsSVGIntegrationUtils::UsingEffectsForFrame(this);
   nsRect dirtyRectOutsideSVGEffects = dirtyRect;
   nsDisplayList hoistedScrollInfoItemsStorage;
   if (usingSVGEffects) {
     dirtyRect =
       nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(this, dirtyRect);
     aBuilder->EnterSVGEffectsContents(&hoistedScrollInfoItemsStorage);
@@ -2030,17 +2034,17 @@ nsIFrame::BuildDisplayListForStackingCon
     DisplayListClipState::AutoSaveRestore nestedClipState(aBuilder);
     nsDisplayListBuilder::AutoInTransformSetter
       inTransformSetter(aBuilder, inTransform);
     CheckForApzAwareEventHandlers(aBuilder, this);
 
     nsRect clipPropClip;
     if (ApplyClipPropClipping(aBuilder, this, disp, &clipPropClip,
                               nestedClipState)) {
-      dirtyRect.IntersectRect(dirtyRect, clipPropClip);
+      // dirtyRect.IntersectRect(dirtyRect, clipPropClip); FINDME!!! KIP!!! HACK!!!
     }
 
     MarkAbsoluteFramesForDisplayList(aBuilder, dirtyRect);
 
     // Preserve3DChildren() also guarantees that applyAbsPosClipping and usingSVGEffects are false
     // We only modify the preserve-3d rect if we are the top of a preserve-3d heirarchy
     if (Preserves3DChildren()) {
       aBuilder->MarkPreserve3DFramesForDisplayList(this, aDirtyRect);
@@ -7331,22 +7335,22 @@ UnionBorderBoxes(nsIFrame* aFrame, bool 
       // elements within a preserve-3d scene are always transformed up
       // to the top of the scene.  This means we don't have a
       // mechanism for getting a transform up to an intermediate point
       // within the scene.  We choose to over-transform rather than
       // under-transform because this is consistent with other
       // overflow areas.
       nsRect childRect = UnionBorderBoxes(child, true) +
                          child->GetPosition();
-
+/*
       if (hasClipPropClip) {
         // Intersect with the clip before transforming.
         childRect.IntersectRect(childRect, clipPropClipRect);
       }
-
+*/
       // Note that we transform each child separately according to
       // aFrame's transform, and then union, which gives a different
       // (smaller) result from unioning and then transforming the
       // union.  This doesn't match the way we handle overflow areas
       // with 2-D transforms, though it does match the way we handle
       // overflow areas in preserve-3d 3-D scenes.
       if (doTransform && !child->Preserves3D()) {
         childRect = nsDisplayTransform::TransformRect(childRect, aFrame,
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1057,17 +1057,17 @@ pref("privacy.trackingprotection.pbmode.
 pref("dom.event.contextmenu.enabled",       true);
 pref("dom.event.clipboardevents.enabled",   true);
 #if defined(XP_WIN) && !defined(RELEASE_BUILD)
 pref("dom.event.highrestimestamp.enabled",  true);
 #else
 pref("dom.event.highrestimestamp.enabled",  false);
 #endif
 
-pref("dom.webcomponents.enabled",           false);
+pref("dom.webcomponents.enabled",           true);
 
 pref("javascript.enabled",                  true);
 pref("javascript.options.strict",           false);
 #ifdef DEBUG
 pref("javascript.options.strict.debug",     false);
 #endif
 pref("javascript.options.baselinejit",      true);
 pref("javascript.options.ion",              true);
@@ -4160,17 +4160,17 @@ pref("layers.acceleration.force-enabled"
 pref("layers.acceleration.force-enabled", false);
 #endif
 
 pref("layers.acceleration.draw-fps", false);
 
 // Enable DEAA antialiasing for transformed layers in the compositor
 #if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID)
 // Desktop prefs
-pref("layers.deaa.enabled", true);
+pref("layers.deaa.enabled", false);
 #else
 // Mobile prefs
 pref("layers.deaa.enabled", false);
 #endif
 
 pref("layers.dump", false);
 #ifdef MOZ_DUMP_PAINTING
 // If we're dumping layers, also dump the texture data