Back out 9fb78d71f361, 28f8ce199bed, 78ffaa79a3de, 9f6f9b74d685 (bug 779940 and bug 778036) because of Android failures
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 06 Aug 2012 21:59:01 -0700
changeset 101633 a525ac9349eb4bf29d4c2c650517791dea282669
parent 101632 5a6ac05db368df50b92e501801436c127733ff25
child 101634 e677fd2a66ddcbd5977ca36cea7b3e3271dc6107
push idunknown
push userunknown
push dateunknown
bugs779940, 778036
milestone17.0a1
backs out9fb78d71f3614a9dc79a6b52c54b15aa5c19b66a
Back out 9fb78d71f361, 28f8ce199bed, 78ffaa79a3de, 9f6f9b74d685 (bug 779940 and bug 778036) because of Android failures
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
gfx/layers/Layers.h
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/CompositorParent.h
gfx/layers/ipc/ShadowLayers.h
gfx/layers/opengl/LayerManagerOGL.cpp
gfx/layers/opengl/LayerManagerOGL.h
layout/ipc/RenderFrameParent.cpp
layout/ipc/RenderFrameParent.h
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -97,17 +97,16 @@ TabChild::TabChild(PRUint32 aChromeFlags
   : mRemoteFrame(nullptr)
   , mTabChildGlobal(nullptr)
   , mChromeFlags(aChromeFlags)
   , mOuterRect(0, 0, 0, 0)
   , mLastBackgroundColor(NS_RGB(255, 255, 255))
   , mDidFakeShow(false)
   , mIsBrowserElement(aIsBrowserElement)
   , mAppId(aAppId)
-  , mNotified(false)
 {
     printf("creating %d!\n", NS_IsMainThread());
 }
 
 nsresult
 TabChild::Init()
 {
   nsCOMPtr<nsIWebBrowser> webBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
@@ -1179,19 +1178,27 @@ TabChild::SetBackgroundColor(const nscol
     mLastBackgroundColor = aColor;
     SendSetBackgroundColor(mLastBackgroundColor);
   }
 }
 
 void
 TabChild::NotifyPainted()
 {
-    if (UseDirectCompositor() && !mNotified) {
+    if (UseDirectCompositor()) {
+        // FIXME/bug XXXXXX: in theory, we should only have to push a
+        // txn to our remote frame once, and the
+        // display-list/FrameLayerBuilder code there will manage the
+        // tree from there on.  But in practice, that doesn't work for
+        // some unknown reason.  So for now, always notify the content
+        // thread in the parent process.  It's wasteful but won't
+        // result in unnecessary repainting or even composites
+        // (usually, unless timing is unlucky), since they're
+        // throttled.
         mRemoteFrame->SendNotifyCompositorTransaction();
-        mNotified = true;
     }
 }
 
 bool
 TabChild::IsAsyncPanZoomEnabled()
 {
     return mScrolling == ASYNC_PAN_ZOOM;
 }
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -300,17 +300,16 @@ private:
     RenderFrameChild* mRemoteFrame;
     nsRefPtr<TabChildGlobal> mTabChildGlobal;
     PRUint32 mChromeFlags;
     nsIntRect mOuterRect;
     nscolor mLastBackgroundColor;
     ScrollingBehavior mScrolling;
     bool mDidFakeShow;
     bool mIsBrowserElement;
-    bool mNotified;
     PRUint32 mAppId;
 
     DISALLOW_EVIL_CONSTRUCTORS(TabChild);
 };
 
 inline TabChild*
 GetTabChildFrom(nsIDocShell* aDocShell)
 {
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -534,86 +534,66 @@ public:
    * visible region of the ThebesLayer. This enables internal quality
    * and performance optimizations.
    */
   void SetContentFlags(PRUint32 aFlags)
   {
     NS_ASSERTION((aFlags & (CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA)) !=
                  (CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA),
                  "Can't be opaque and require component alpha");
-    if (mContentFlags != aFlags) {
-      mContentFlags = aFlags;
-      Mutated();
-    }
+    mContentFlags = aFlags;
+    Mutated();
   }
   /**
    * CONSTRUCTION PHASE ONLY
    * Tell this layer which region will be visible. The visible region
    * is a region which contains all the contents of the layer that can
    * actually affect the rendering of the window. It can exclude areas
    * that are covered by opaque contents of other layers, and it can
    * exclude areas where this layer simply contains no content at all.
    * (This can be an overapproximation to the "true" visible region.)
    * 
    * There is no general guarantee that drawing outside the bounds of the
    * visible region will be ignored. So if a layer draws outside the bounds
    * of its visible region, it needs to ensure that what it draws is valid.
    */
   virtual void SetVisibleRegion(const nsIntRegion& aRegion)
   {
-    if (!mVisibleRegion.IsEqual(aRegion)) {
-      mVisibleRegion = aRegion;
-      Mutated();
-    }
+    mVisibleRegion = aRegion;
+    Mutated();
   }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the opacity which will be applied to this layer as it
    * is composited to the destination.
    */
   void SetOpacity(float aOpacity)
   {
-    if (mOpacity != aOpacity) {
-      mOpacity = aOpacity;
-      Mutated();
-    }
+    mOpacity = aOpacity;
+    Mutated();
   }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set a clip rect which will be applied to this layer as it is
    * composited to the destination. The coordinates are relative to
    * the parent layer (i.e. the contents of this layer
    * are transformed before this clip rect is applied).
    * For the root layer, the coordinates are relative to the widget,
    * in device pixels.
    * If aRect is null no clipping will be performed. 
    */
   void SetClipRect(const nsIntRect* aRect)
   {
-    if (mUseClipRect) {
-      if (!aRect) {
-        mUseClipRect = false;
-        Mutated();
-      } else {
-        if (!aRect->IsEqualEdges(mClipRect)) {
-          mClipRect = *aRect;
-          Mutated();
-        }
-      }
-    } else {
-      if (aRect) {
-        Mutated();
-        mUseClipRect = true;
-        if (!aRect->IsEqualEdges(mClipRect)) {
-          mClipRect = *aRect;
-        }
-      }
+    mUseClipRect = aRect != nullptr;
+    if (aRect) {
+      mClipRect = *aRect;
     }
+    Mutated();
   }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set a clip rect which will be applied to this layer as it is
    * composited to the destination. The coordinates are relative to
    * the parent layer (i.e. the contents of this layer
    * are transformed before this clip rect is applied).
@@ -652,34 +632,29 @@ public:
 #ifdef DEBUG
     if (aMaskLayer) {
       gfxMatrix maskTransform;
       bool maskIs2D = aMaskLayer->GetTransform().CanDraw2D(&maskTransform);
       NS_ASSERTION(maskIs2D, "Mask layer has invalid transform.");
     }
 #endif
 
-    if (mMaskLayer != aMaskLayer) {
-      mMaskLayer = aMaskLayer;
-      Mutated();
-    }
+    mMaskLayer = aMaskLayer;
+    Mutated();
   }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Tell this layer what its transform should be. The transformation
    * is applied when compositing the layer into its parent container.
    * XXX Currently only transformations corresponding to 2D affine transforms
    * are supported.
    */
   void SetBaseTransform(const gfx3DMatrix& aMatrix)
   {
-    if (mTransform == aMatrix) {
-      return;
-    }
     mTransform = aMatrix;
     Mutated();
   }
 
   void SetPostScale(float aXScale, float aYScale)
   {
     mPostXScale = aXScale;
     mPostYScale = aYScale;
@@ -1124,20 +1099,18 @@ public:
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the (sub)document metrics used to render the Layer subtree
    * rooted at this.
    */
   void SetFrameMetrics(const FrameMetrics& aFrameMetrics)
   {
-    if (mFrameMetrics != aFrameMetrics) {
-      mFrameMetrics = aFrameMetrics;
-      Mutated();
-    }
+    mFrameMetrics = aFrameMetrics;
+    Mutated();
   }
 
   void SetPreScale(float aXScale, float aYScale)
   {
     mPreXScale = aXScale;
     mPreYScale = aYScale;
     Mutated();
   }
@@ -1417,20 +1390,17 @@ private:
 public:
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the ID of the layer's referent.
    */
   void SetReferentId(uint64_t aId)
   {
     MOZ_ASSERT(aId != 0);
-    if (mId != aId) {
-      mId = aId;
-      Mutated();
-    }
+    mId = aId;
   }
   /**
    * CONSTRUCTION PHASE ONLY
    * Connect this ref layer to its referent, temporarily.
    * ClearReferentLayer() must be called after composition.
    */
   void ConnectReferentLayer(Layer* aLayer)
   {
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -316,26 +316,16 @@ CompositorParent::ScheduleTask(Cancelabl
   if (time == 0) {
     MessageLoop::current()->PostTask(FROM_HERE, task);
   } else {
     MessageLoop::current()->PostDelayedTask(FROM_HERE, task, time);
   }
 }
 
 void
-CompositorParent::NotifyShadowTreeTransaction()
-{
-  ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
-  if (shadow) {
-    shadow->NotifyShadowTreeTransaction();
-  }
-  ScheduleComposition();
-}
-
-void
 CompositorParent::ScheduleComposition()
 {
   if (mCurrentCompositeTask) {
     return;
   }
 
   bool initialComposition = mLastCompose.IsNull();
   TimeDuration delta;
@@ -891,20 +881,16 @@ CompositorParent::ShadowLayersUpdated(Sh
   mIsFirstPaint = mIsFirstPaint || isFirstPaint;
   mLayersUpdated = true;
   Layer* root = aLayerTree->GetRoot();
   mLayerManager->SetRoot(root);
   if (root) {
     SetShadowProperties(root);
   }
   ScheduleComposition();
-  ShadowLayerManager *shadow = mLayerManager->AsShadowManager();
-  if (shadow) {
-    shadow->NotifyShadowTreeTransaction();
-  }
 }
 
 PLayersParent*
 CompositorParent::AllocPLayers(const LayersBackend& aBackendHint,
                                const uint64_t& aId,
                                LayersBackend* aBackend,
                                int32_t* aMaxTextureSize)
 {
@@ -1202,17 +1188,17 @@ CrossProcessCompositorParent::ShadowLaye
   uint64_t id = aLayerTree->GetId();
   MOZ_ASSERT(id != 0);
   Layer* shadowRoot = aLayerTree->GetRoot();
   if (shadowRoot) {
     SetShadowProperties(shadowRoot);
   }
   UpdateIndirectTree(id, shadowRoot, isFirstPaint);
 
-  sCurrentCompositor->NotifyShadowTreeTransaction();
+  sCurrentCompositor->ScheduleComposition();
 }
 
 void
 CrossProcessCompositorParent::DeferredDestroy()
 {
   mSelfRef = NULL;
   // |this| was just destroyed, hands off
 }
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -81,17 +81,16 @@ public:
   void AsyncRender();
 
   // Can be called from any thread
   void ScheduleRenderOnCompositorThread();
   void SchedulePauseOnCompositorThread();
   void ScheduleResumeOnCompositorThread(int width, int height);
 
   virtual void ScheduleComposition();
-  void NotifyShadowTreeTransaction();
   
   /**
    * Returns a pointer to the compositor corresponding to the given ID. 
    */
   static CompositorParent* GetCompositor(PRUint64 id);
 
   /**
    * Returns the compositor thread's message loop.
--- a/gfx/layers/ipc/ShadowLayers.h
+++ b/gfx/layers/ipc/ShadowLayers.h
@@ -406,18 +406,16 @@ public:
   virtual already_AddRefed<ShadowImageLayer> CreateShadowImageLayer() = 0;
   /** CONSTRUCTION PHASE ONLY */
   virtual already_AddRefed<ShadowColorLayer> CreateShadowColorLayer() = 0;
   /** CONSTRUCTION PHASE ONLY */
   virtual already_AddRefed<ShadowCanvasLayer> CreateShadowCanvasLayer() = 0;
   /** CONSTRUCTION PHASE ONLY */
   virtual already_AddRefed<ShadowRefLayer> CreateShadowRefLayer() { return nullptr; }
 
-  virtual void NotifyShadowTreeTransaction() {}
-
   /**
    * Try to open |aDescriptor| for direct texturing.  If the
    * underlying surface supports direct texturing, a non-null
    * TextureImage is returned.  Otherwise null is returned.
    */
   static already_AddRefed<TextureImage>
   OpenDescriptorForDirectTexturing(GLContext* aContext,
                                    const SurfaceDescriptor& aDescriptor,
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -501,44 +501,31 @@ LayerManagerOGL::RootLayer() const
     return nullptr;
   }
 
   return static_cast<LayerOGL*>(mRoot->ImplData());
 }
 
 bool LayerManagerOGL::sDrawFPS = false;
 
-void
-LayerManagerOGL::FPSState::NotifyShadowTreeTransaction()
-{
-  contentFCount++;
-}
-
 /* This function tries to stick to portable C89 as much as possible
  * so that it can be easily copied into other applications */
 void
 LayerManagerOGL::FPSState::DrawFPS(GLContext* context, ShaderProgramOGL* copyprog)
 {
   fcount++;
 
   int rate = 30;
   if (fcount >= rate) {
     TimeStamp now = TimeStamp::Now();
     TimeDuration duration = now - last;
     last = now;
     fps = rate / duration.ToSeconds() + .5;
     fcount = 0;
   }
-  if (contentFCount >= rate) {
-    TimeStamp now = TimeStamp::Now();
-    TimeDuration duration = now - contentLast;
-    contentLast = now;
-    contentFps = contentFCount / duration.ToSeconds() + .5;
-    contentFCount = 0;
-  }
 
   GLint viewport[4];
   context->fGetIntegerv(LOCAL_GL_VIEWPORT, viewport);
 
   static GLuint texture;
   if (!initialized) {
     // Bind the number of textures we need, in this case one.
     context->fGenTextures(1, &texture);
@@ -583,44 +570,23 @@ LayerManagerOGL::FPSState::DrawFPS(GLCon
     {  -1.0f + 22.f / viewport[2], 1.0f - 42.f / viewport[3] },
     {  -1.0f + 22.f / viewport[2], 1.0f },
     {  -1.0f + 44.f / viewport[2], 1.0f - 42.f / viewport[3] },
     {  -1.0f + 44.f / viewport[2], 1.0f },
 
     { -1.0f + 44.f / viewport[2], 1.0f - 42.f / viewport[3] },
     { -1.0f + 44.f / viewport[2], 1.0f },
     { -1.0f + 66.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 66.f / viewport[2], 1.0f },
-  };
-    
-  const Vertex2D vertices2[] = {
-    { -1.0f + 80.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 80.f / viewport[2], 1.0f },
-    { -1.0f + 102.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 102.f / viewport[2], 1.0f },
-    
-    { -1.0f + 102.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 102.f / viewport[2], 1.0f },
-    { -1.0f + 124.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 124.f / viewport[2], 1.0f },
-    
-    { -1.0f + 124.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 124.f / viewport[2], 1.0f },
-    { -1.0f + 146.f / viewport[2], 1.0f - 42.f / viewport[3] },
-    { -1.0f + 146.f / viewport[2], 1.0f },
+    { -1.0f + 66.f / viewport[2], 1.0f }
   };
 
   int v1   = fps % 10;
   int v10  = (fps % 100) / 10;
   int v100 = (fps % 1000) / 100;
 
-  int content1 = contentFps % 10;
-  int content10  = (contentFps % 100) / 10;
-  int content100 = (contentFps % 1000) / 100;
-
   // Feel free to comment these texture coordinates out and use one
   // of the ones below instead, or play around with your own values.
   const GLfloat texCoords[] = {
     (v100 * 4.f) / 64, 7.f / 8,
     (v100 * 4.f) / 64, 0.0f,
     (v100 * 4.f + 4) / 64, 7.f / 8,
     (v100 * 4.f + 4) / 64, 0.0f,
 
@@ -629,33 +595,16 @@ LayerManagerOGL::FPSState::DrawFPS(GLCon
     (v10 * 4.f + 4) / 64, 7.f / 8,
     (v10 * 4.f + 4) / 64, 0.0f,
 
     (v1 * 4.f) / 64, 7.f / 8,
     (v1 * 4.f) / 64, 0.0f,
     (v1 * 4.f + 4) / 64, 7.f / 8,
     (v1 * 4.f + 4) / 64, 0.0f,
   };
-    
-  const GLfloat texCoords2[] = {
-    (content100 * 4.f) / 64, 7.f / 8,
-    (content100 * 4.f) / 64, 0.0f,
-    (content100 * 4.f + 4) / 64, 7.f / 8,
-    (content100 * 4.f + 4) / 64, 0.0f,
-
-    (content10 * 4.f) / 64, 7.f / 8,
-    (content10 * 4.f) / 64, 0.0f,
-    (content10 * 4.f + 4) / 64, 7.f / 8,
-    (content10 * 4.f + 4) / 64, 0.0f,
-
-    (content1 * 4.f) / 64, 7.f / 8,
-    (content1 * 4.f) / 64, 0.0f,
-    (content1 * 4.f + 4) / 64, 7.f / 8,
-    (content1 * 4.f + 4) / 64, 0.0f,
-  };
 
   // Turn necessary features on
   context->fEnable(LOCAL_GL_BLEND);
   context->fBlendFunc(LOCAL_GL_ONE, LOCAL_GL_SRC_COLOR);
 
   context->fActiveTexture(LOCAL_GL_TEXTURE0);
   context->fBindTexture(LOCAL_GL_TEXTURE_2D, texture);
 
@@ -683,28 +632,16 @@ LayerManagerOGL::FPSState::DrawFPS(GLCon
                                 0, vertices);
 
   context->fVertexAttribPointer(tcattr,
                                 2, LOCAL_GL_FLOAT,
                                 LOCAL_GL_FALSE,
                                 0, texCoords);
 
   context->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 12);
-  
-  context->fVertexAttribPointer(vcattr,
-                                2, LOCAL_GL_FLOAT,
-                                LOCAL_GL_FALSE,
-                                0, vertices2);
-
-  context->fVertexAttribPointer(tcattr,
-                                2, LOCAL_GL_FLOAT,
-                                LOCAL_GL_FALSE,
-                                0, texCoords2);
-
-  context->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 12);
 }
 
 // |aTexCoordRect| is the rectangle from the texture that we want to
 // draw using the given program.  The program already has a necessary
 // offset and scale, so the geometry that needs to be drawn is a unit
 // square from 0,0 to 1,1.
 //
 // |aTexSize| is the actual size of the texture, as it can be larger
@@ -773,22 +710,16 @@ LayerManagerOGL::BindAndDrawQuadWithText
 
       mGLContext->fDisableVertexAttribArray(vertAttribIndex);
     }
     mGLContext->fDisableVertexAttribArray(texCoordAttribIndex);
   }
 }
 
 void
-LayerManagerOGL::NotifyShadowTreeTransaction()
-{
-  mFPS.NotifyShadowTreeTransaction();
-}
-
-void
 LayerManagerOGL::Render()
 {
   SAMPLE_LABEL("LayerManagerOGL", "Render");
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return;
   }
 
--- a/gfx/layers/opengl/LayerManagerOGL.h
+++ b/gfx/layers/opengl/LayerManagerOGL.h
@@ -98,17 +98,16 @@ public:
 
   void BeginTransaction();
 
   void BeginTransactionWithTarget(gfxContext* aTarget);
 
   void EndConstruction();
 
   virtual bool EndEmptyTransaction();
-  virtual void NotifyShadowTreeTransaction();
   virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData,
                               EndTransactionFlags aFlags = END_DEFAULT);
 
   virtual void SetRoot(Layer* aLayer) { mRoot = aLayer; }
 
   virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
   {
@@ -438,32 +437,25 @@ private:
   struct FPSState
   {
       GLuint texture;
       int fps;
       bool initialized;
       int fcount;
       TimeStamp last;
 
-      int contentFps;
-      int contentFCount;
-      TimeStamp contentLast;
-
       FPSState()
         : texture(0)
         , fps(0)
         , initialized(false)
         , fcount(0)
-        , contentFps(0)
-        , contentFCount(0)
       {
-        contentLast = last = TimeStamp::Now();
+        last = TimeStamp::Now();
       }
       void DrawFPS(GLContext*, ShaderProgramOGL*);
-      void NotifyShadowTreeTransaction();
   } mFPS;
 
   static bool sDrawFPS;
 };
 
 /**
  * General information and tree management for OGL layers.
  */
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -579,18 +579,17 @@ RenderFrameParent::ShadowLayersUpdated(S
 
   TriggerRepaint();
 }
 
 already_AddRefed<Layer>
 RenderFrameParent::BuildLayer(nsDisplayListBuilder* aBuilder,
                               nsIFrame* aFrame,
                               LayerManager* aManager,
-                              const nsIntRect& aVisibleRect,
-                              nsDisplayItem* aItem)
+                              const nsIntRect& aVisibleRect)
 {
   NS_ABORT_IF_FALSE(aFrame,
                     "makes no sense to have a shadow tree without a frame");
   NS_ABORT_IF_FALSE(!mContainer ||
                     IsTempLayerManager(aManager) ||
                     mContainer->Manager() == aManager,
                     "retaining manager changed out from under us ... HELP!");
 
@@ -603,27 +602,23 @@ RenderFrameParent::BuildLayer(nsDisplayL
     // here will just cause the shadow subtree not to be rendered.
     return nullptr;
   }
 
   uint64_t id = GetLayerTreeId();
   if (0 != id) {
     MOZ_ASSERT(!GetRootLayer());
 
-    nsRefPtr<Layer> layer =
-      (GetLayerBuilderForManager(aManager)->GetLeafLayerFor(aBuilder, aManager, aItem));
-    if (!layer) {
-      layer = aManager->CreateRefLayer();
-    }
+    nsRefPtr<RefLayer> layer = aManager->CreateRefLayer();
     if (!layer) {
       // Probably a temporary layer manager that doesn't know how to
       // use ref layers.
       return nullptr;
     }
-    static_cast<RefLayer*>(layer.get())->SetReferentId(id);
+    layer->SetReferentId(id);
     layer->SetVisibleRegion(aVisibleRect);
     nsIntPoint rootFrameOffset = GetRootFrameOffset(aFrame, aBuilder);
     layer->SetBaseTransform(
       gfx3DMatrix::Translation(rootFrameOffset.x, rootFrameOffset.y, 0.0));
 
     return layer.forget();
   }
 
@@ -862,17 +857,17 @@ RenderFrameParent::BuildDisplayList(nsDi
 
 already_AddRefed<Layer>
 nsDisplayRemote::BuildLayer(nsDisplayListBuilder* aBuilder,
                             LayerManager* aManager,
                             const ContainerParameters& aContainerParameters)
 {
   PRInt32 appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
   nsIntRect visibleRect = GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
-  nsRefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, visibleRect, this);
+  nsRefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, visibleRect);
   return layer.forget();
 }
 
 
 void
 nsDisplayRemoteShadow::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
                          HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames)
 {
--- a/layout/ipc/RenderFrameParent.h
+++ b/layout/ipc/RenderFrameParent.h
@@ -77,18 +77,17 @@ public:
   NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
                               nsSubDocumentFrame* aFrame,
                               const nsRect& aDirtyRect,
                               const nsDisplayListSet& aLists);
 
   already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                      nsIFrame* aFrame,
                                      LayerManager* aManager,
-                                     const nsIntRect& aVisibleRect,
-                                     nsDisplayItem* aItem);
+                                     const nsIntRect& aVisibleRect);
 
   void OwnerContentChanged(nsIContent* aContent);
 
   void SetBackgroundColor(nscolor aColor) { mBackgroundColor = gfxRGBA(aColor); };
 
   void NotifyInputEvent(const nsInputEvent& aEvent,
                         nsInputEvent* aOutEvent);