Bug 1265468 - Invalidate all layers when dragging a tab to a new window. r=nical
☠☠ backed out by df861a9e766d ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 26 May 2016 18:40:07 +1200
changeset 299102 4d417e2c21ff9a33aee9e53fd7ec7a8e3d96ec60
parent 299101 6247821de527eb807e543435a872ae3d93a0162e
child 299103 6cf4da71b921c34300d32f7fb5e5f3b01e1daf96
push id77431
push usermwoodrow@mozilla.com
push dateThu, 26 May 2016 06:40:29 +0000
treeherdermozilla-inbound@4d417e2c21ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1265468
milestone49.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 1265468 - Invalidate all layers when dragging a tab to a new window. r=nical
gfx/layers/composite/ContainerLayerComposite.h
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/opengl/CompositorOGL.cpp
layout/ipc/RenderFrameParent.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.h
+++ b/gfx/layers/composite/ContainerLayerComposite.h
@@ -63,16 +63,17 @@ protected:
 public:
   // LayerComposite Implementation
   virtual Layer* GetLayer() override { return this; }
 
   virtual void SetLayerManager(LayerManagerComposite* aManager) override
   {
     LayerComposite::SetLayerManager(aManager);
     mManager = aManager;
+    mLastIntermediateSurface = nullptr;
 
     for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
       LayerComposite* child = l->AsLayerComposite();
       child->SetLayerManager(aManager);
     }
   }
 
   virtual void Destroy() override;
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1632,19 +1632,16 @@ CompositorBridgeParent::RecvAdoptChild(c
 {
   RefPtr<GeckoContentController> controller;
   {
     MonitorAutoLock lock(*sIndirectLayerTreesLock);
     NotifyChildCreated(child);
     if (sIndirectLayerTrees[child].mLayerTree) {
       sIndirectLayerTrees[child].mLayerTree->mLayerManager = mLayerManager;
     }
-    if (sIndirectLayerTrees[child].mRoot) {
-      sIndirectLayerTrees[child].mRoot->AsLayerComposite()->SetLayerManager(mLayerManager);
-    }
     controller = sIndirectLayerTrees[child].mController;
   }
 
   // Calling ChildAdopted on controller will acquire a lock, to avoid a
   // potential deadlock between that lock and sIndirectLayerTreesLock we
   // release sIndirectLayerTreesLock first before calling ChildAdopted.
   if (mApzcTreeManager && controller) {
     controller->ChildAdopted();
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -1000,16 +1000,18 @@ CompositorOGL::DrawQuad(const Rect& aRec
   MOZ_ASSERT(mFrameInProgress, "frame not started");
   MOZ_ASSERT(mCurrentRenderTarget, "No destination");
 
   if (aEffectChain.mPrimaryEffect->mType == EffectTypes::VR_DISTORTION) {
     DrawVRDistortion(aRect, aClipRect, aEffectChain, aOpacity, aTransform);
     return;
   }
 
+  MakeCurrent();
+
   IntPoint offset = mCurrentRenderTarget->GetOrigin();
   IntSize size = mCurrentRenderTarget->GetSize();
 
   Rect renderBound(0, 0, size.width, size.height);
   renderBound.IntersectRect(renderBound, Rect(aClipRect));
   renderBound.MoveBy(offset);
 
   Rect destRect = aTransform.TransformAndClipBounds(aRect, renderBound);
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -207,16 +207,17 @@ RenderFrameParent::OwnerContentChanged(n
 {
   MOZ_ASSERT(!mFrameLoader || mFrameLoader->GetOwnerContent() == aContent,
              "Don't build new map if owner is same!");
 
   RefPtr<LayerManager> lm = mFrameLoader ? GetFrom(mFrameLoader) : nullptr;
   // Perhaps the document containing this frame currently has no presentation?
   if (lm && lm->AsClientLayerManager()) {
     lm->AsClientLayerManager()->GetRemoteRenderer()->SendAdoptChild(mLayersId);
+    FrameLayerBuilder::InvalidateAllLayers(lm);
   }
 }
 
 void
 RenderFrameParent::ActorDestroy(ActorDestroyReason why)
 {
   if (mLayersId != 0) {
     if (XRE_IsParentProcess()) {