Backed out changeset 67ca40453027 (bug 1393031) for failing e.g. reftest layout/reftests/image/image-srcset-basic-selection-2x-ref.html on QuantumRender. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 14 Sep 2017 23:18:49 +0200
changeset 665145 edddc72cb9a8b62fa6e921332c32128594fede6c
parent 665144 3428a9f92bf4bd18ee78946834a201a670a54752
child 665146 ac08b84acbcc781b4542ceca12bf417da73ac563
push id79943
push userbmo:tchiovoloni@mozilla.com
push dateThu, 14 Sep 2017 23:59:48 +0000
reviewersbackout
bugs1393031
milestone57.0a1
backs out67ca40453027d20fc50a475828f7b8089ff6cbeb
Backed out changeset 67ca40453027 (bug 1393031) for failing e.g. reftest layout/reftests/image/image-srcset-basic-selection-2x-ref.html on QuantumRender. r=backout
gfx/layers/ipc/WebRenderMessages.ipdlh
gfx/layers/wr/IpcResourceUpdateQueue.cpp
gfx/layers/wr/IpcResourceUpdateQueue.h
gfx/layers/wr/ScrollingLayersHelper.cpp
gfx/layers/wr/ScrollingLayersHelper.h
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.h
gfx/layers/wr/WebRenderCanvasLayer.cpp
gfx/layers/wr/WebRenderColorLayer.cpp
gfx/layers/wr/WebRenderContainerLayer.cpp
gfx/layers/wr/WebRenderDisplayItemLayer.cpp
gfx/layers/wr/WebRenderImageLayer.cpp
gfx/layers/wr/WebRenderImageLayer.h
gfx/layers/wr/WebRenderLayer.cpp
gfx/layers/wr/WebRenderLayer.h
gfx/layers/wr/WebRenderPaintedLayer.cpp
gfx/layers/wr/WebRenderPaintedLayer.h
gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
gfx/layers/wr/WebRenderTextLayer.cpp
layout/generic/nsHTMLCanvasFrame.cpp
--- a/gfx/layers/ipc/WebRenderMessages.ipdlh
+++ b/gfx/layers/ipc/WebRenderMessages.ipdlh
@@ -130,13 +130,12 @@ union OpUpdateResource {
   OpAddBlobImage;
   OpUpdateImage;
   OpUpdateBlobImage;
   OpDeleteImage;
   OpAddRawFont;
   OpDeleteFont;
   OpAddFontInstance;
   OpDeleteFontInstance;
-  OpAddExternalImage;
 };
 
 } // namespace
 } // namespace
--- a/gfx/layers/wr/IpcResourceUpdateQueue.cpp
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.cpp
@@ -168,22 +168,16 @@ void
 IpcResourceUpdateQueue::AddBlobImage(ImageKey key, const ImageDescriptor& aDescriptor,
                                      Range<uint8_t> aBytes)
 {
   auto bytes = mWriter.Write(aBytes);
   mUpdates.AppendElement(layers::OpAddBlobImage(aDescriptor, bytes, 0, key));
 }
 
 void
-IpcResourceUpdateQueue::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey)
-{
-  mUpdates.AppendElement(layers::OpAddExternalImage(aExtId, aKey));
-}
-
-void
 IpcResourceUpdateQueue::UpdateImageBuffer(ImageKey aKey,
                                           const ImageDescriptor& aDescriptor,
                                           Range<uint8_t> aBytes)
 {
   auto bytes = mWriter.Write(aBytes);
   mUpdates.AppendElement(layers::OpUpdateImage(aDescriptor, bytes, aKey));
 }
 
--- a/gfx/layers/wr/IpcResourceUpdateQueue.h
+++ b/gfx/layers/wr/IpcResourceUpdateQueue.h
@@ -58,18 +58,16 @@ public:
   void AddImage(wr::ImageKey aKey,
                 const ImageDescriptor& aDescriptor,
                 Range<uint8_t> aBytes);
 
   void AddBlobImage(wr::ImageKey aKey,
                     const ImageDescriptor& aDescriptor,
                     Range<uint8_t> aBytes);
 
-  void AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey);
-
   void UpdateImageBuffer(wr::ImageKey aKey,
                          const ImageDescriptor& aDescriptor,
                          Range<uint8_t> aBytes);
 
   void UpdateBlobImage(wr::ImageKey aKey,
                        const ImageDescriptor& aDescriptor,
                        Range<uint8_t> aBytes);
 
--- a/gfx/layers/wr/ScrollingLayersHelper.cpp
+++ b/gfx/layers/wr/ScrollingLayersHelper.cpp
@@ -12,60 +12,59 @@
 #include "mozilla/webrender/WebRenderAPI.h"
 #include "UnitTransforms.h"
 
 namespace mozilla {
 namespace layers {
 
 ScrollingLayersHelper::ScrollingLayersHelper(WebRenderLayer* aLayer,
                                              wr::DisplayListBuilder& aBuilder,
-                                             wr::IpcResourceUpdateQueue& aResources,
                                              const StackingContextHelper& aStackingContext)
   : mLayer(aLayer)
   , mBuilder(&aBuilder)
   , mPushedLayerLocalClip(false)
   , mPushedClipAndScroll(false)
 {
   if (!mLayer->WrManager()->AsyncPanZoomEnabled()) {
     // If APZ is disabled then we don't need to push the scrolling clips. We
     // still want to push the layer's local clip though.
-    PushLayerLocalClip(aStackingContext, aResources);
+    PushLayerLocalClip(aStackingContext);
     return;
   }
 
   Layer* layer = mLayer->GetLayer();
   for (uint32_t i = layer->GetScrollMetadataCount(); i > 0; i--) {
     const ScrollMetadata& metadata = layer->GetScrollMetadata(i - 1);
     // The scroll clip on a given metadata is affected by all async transforms
     // from metadatas "above" it, but not the async transform on the metadata
     // itself. Therefore we need to push this clip before we push the
     // corresponding scroll layer, so that when we set an async scroll position
     // on the scroll layer, the clip isn't affected by it.
     if (const Maybe<LayerClip>& clip = metadata.GetScrollClip()) {
-      PushLayerClip(clip.ref(), aStackingContext, aResources);
+      PushLayerClip(clip.ref(), aStackingContext);
     }
 
     const FrameMetrics& fm = layer->GetFrameMetrics(i - 1);
     if (layer->GetIsFixedPosition() &&
         layer->GetFixedPositionScrollContainerId() == fm.GetScrollId()) {
       // If the layer contents are fixed for this metadata onwards, we need
       // to insert the layer's local clip at this point in the clip tree,
       // as a child of whatever's on the stack.
-      PushLayerLocalClip(aStackingContext, aResources);
+      PushLayerLocalClip(aStackingContext);
     }
 
     DefineAndPushScrollLayer(fm, aStackingContext);
   }
 
   // The scrolled clip on the layer is "inside" all of the scrollable metadatas
   // on that layer. That is, the clip scrolls along with the content in
   // child layers. So we need to apply this after pushing all the scroll layers,
   // which we do above.
   if (const Maybe<LayerClip>& scrolledClip = layer->GetScrolledClip()) {
-    PushLayerClip(scrolledClip.ref(), aStackingContext, aResources);
+    PushLayerClip(scrolledClip.ref(), aStackingContext);
   }
 
   // If the layer is marked as fixed-position, it is fixed relative to something
   // (the scroll layer referred to by GetFixedPositionScrollContainerId, hereafter
   // referred to as the "scroll container"). What this really means is that we
   // don't want this content to scroll with any scroll layer on the stack up to
   // and including the scroll container, but we do want it to scroll with any
   // ancestor scroll layers.
@@ -78,17 +77,17 @@ ScrollingLayersHelper::ScrollingLayersHe
   // to the ancestor of the scroll container.
   if (layer->GetIsFixedPosition()) {
     FrameMetrics::ViewID fixedFor = layer->GetFixedPositionScrollContainerId();
     Maybe<FrameMetrics::ViewID> scrollsWith = mBuilder->ParentScrollIdFor(fixedFor);
     Maybe<wr::WrClipId> clipId = mBuilder->TopmostClipId();
     // Default to 0 if there is no ancestor, because 0 refers to the root scrollframe.
     mBuilder->PushClipAndScrollInfo(scrollsWith.valueOr(0), clipId.ptrOr(nullptr));
   } else {
-    PushLayerLocalClip(aStackingContext, aResources);
+    PushLayerLocalClip(aStackingContext);
   }
 }
 
 ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
                                              wr::DisplayListBuilder& aBuilder,
                                              const StackingContextHelper& aStackingContext,
                                              WebRenderLayerManager::ClipIdMap& aCache,
                                              bool aApzEnabled)
@@ -269,51 +268,49 @@ ScrollingLayersHelper::DefineAndPushScro
   mBuilder->DefineScrollLayer(aMetrics.GetScrollId(),
       aStackingContext.ToRelativeLayoutRect(contentRect),
       aStackingContext.ToRelativeLayoutRect(clipBounds));
   mBuilder->PushScrollLayer(aMetrics.GetScrollId());
   return true;
 }
 
 void
-ScrollingLayersHelper::PushLayerLocalClip(const StackingContextHelper& aStackingContext,
-                                          wr::IpcResourceUpdateQueue& aResources)
+ScrollingLayersHelper::PushLayerLocalClip(const StackingContextHelper& aStackingContext)
 {
   Layer* layer = mLayer->GetLayer();
   Maybe<ParentLayerRect> clip;
   if (const Maybe<ParentLayerIntRect>& rect = layer->GetClipRect()) {
     clip = Some(IntRectToRect(rect.ref()));
   } else if (layer->GetMaskLayer()) {
     // this layer has a mask, but no clip rect. so let's use the transformed
     // visible bounds as the clip rect.
     clip = Some(layer->GetLocalTransformTyped().TransformBounds(mLayer->Bounds()));
   }
   if (clip) {
-    Maybe<wr::WrImageMask> mask = mLayer->BuildWrMaskLayer(aStackingContext, aResources);
+    Maybe<wr::WrImageMask> mask = mLayer->BuildWrMaskLayer(aStackingContext);
     LayerRect clipRect = ViewAs<LayerPixel>(clip.ref(),
         PixelCastJustification::MovingDownToChildren);
     mBuilder->PushClip(mBuilder->DefineClip(
         aStackingContext.ToRelativeLayoutRect(clipRect), nullptr, mask.ptrOr(nullptr)));
     mPushedLayerLocalClip = true;
   }
 }
 
 void
 ScrollingLayersHelper::PushLayerClip(const LayerClip& aClip,
-                                     const StackingContextHelper& aSc,
-                                     wr::IpcResourceUpdateQueue& aResources)
+                                     const StackingContextHelper& aSc)
 {
   LayerRect clipRect = IntRectToRect(ViewAs<LayerPixel>(aClip.GetClipRect(),
         PixelCastJustification::MovingDownToChildren));
   Maybe<wr::WrImageMask> mask;
   if (Maybe<size_t> maskLayerIndex = aClip.GetMaskLayerIndex()) {
     Layer* maskLayer = mLayer->GetLayer()->GetAncestorMaskLayerAt(maskLayerIndex.value());
     WebRenderLayer* maskWrLayer = WebRenderLayer::ToWebRenderLayer(maskLayer);
     // TODO: check this transform is correct in all cases
-    mask = maskWrLayer->RenderMaskLayer(aSc, maskLayer->GetTransform(), aResources);
+    mask = maskWrLayer->RenderMaskLayer(aSc, maskLayer->GetTransform());
   }
   mBuilder->PushClip(mBuilder->DefineClip(
       aSc.ToRelativeLayoutRect(clipRect), nullptr, mask.ptrOr(nullptr)));
 }
 
 ScrollingLayersHelper::~ScrollingLayersHelper()
 {
   if (!mLayer) {
--- a/gfx/layers/wr/ScrollingLayersHelper.h
+++ b/gfx/layers/wr/ScrollingLayersHelper.h
@@ -24,17 +24,16 @@ struct LayerClip;
 class StackingContextHelper;
 class WebRenderLayer;
 
 class MOZ_RAII ScrollingLayersHelper
 {
 public:
   ScrollingLayersHelper(WebRenderLayer* aLayer,
                         wr::DisplayListBuilder& aBuilder,
-                        wr::IpcResourceUpdateQueue& aResources,
                         const StackingContextHelper& aSc);
   ScrollingLayersHelper(nsDisplayItem* aItem,
                         wr::DisplayListBuilder& aBuilder,
                         const StackingContextHelper& aStackingContext,
                         WebRenderLayerManager::ClipIdMap& aCache,
                         bool aApzEnabled);
   ~ScrollingLayersHelper();
 
@@ -48,21 +47,19 @@ private:
                                  WebRenderLayerManager::ClipIdMap& aCache);
   void DefineAndPushChain(const DisplayItemClipChain* aChain,
                           wr::DisplayListBuilder& aBuilder,
                           const StackingContextHelper& aStackingContext,
                           int32_t aAppUnitsPerDevPixel,
                           WebRenderLayerManager::ClipIdMap& aCache);
   bool DefineAndPushScrollLayer(const FrameMetrics& aMetrics,
                                 const StackingContextHelper& aStackingContext);
-  void PushLayerLocalClip(const StackingContextHelper& aStackingContext,
-                          wr::IpcResourceUpdateQueue& aResources);
+  void PushLayerLocalClip(const StackingContextHelper& aStackingContext);
   void PushLayerClip(const LayerClip& aClip,
-                     const StackingContextHelper& aSc,
-                     wr::IpcResourceUpdateQueue& aResources);
+                     const StackingContextHelper& aSc);
 
   WebRenderLayer* mLayer;
   wr::DisplayListBuilder* mBuilder;
   bool mPushedLayerLocalClip;
   bool mPushedClipAndScroll;
   std::vector<wr::ScrollOrClipId> mPushedClips;
 };
 
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -273,23 +273,16 @@ WebRenderBridgeParent::UpdateResources(c
         const auto& op = cmd.get_OpUpdateBlobImage();
         wr::Vec_u8 bytes;
         if (!reader.Read(op.bytes(), bytes)) {
           return false;
         }
         aUpdates.UpdateBlobImage(op.key(), op.descriptor(), bytes);
         break;
       }
-      case OpUpdateResource::TOpAddExternalImage: {
-        const auto& op = cmd.get_OpAddExternalImage();
-        if (!AddExternalImage(op.externalImageId(), op.key(), aUpdates)) {
-          return false;
-        }
-        break;
-      }
       case OpUpdateResource::TOpAddRawFont: {
         const auto& op = cmd.get_OpAddRawFont();
         wr::Vec_u8 bytes;
         if (!reader.Read(op.bytes(), bytes)) {
           return false;
         }
         aUpdates.AddRawFont(op.key(), bytes, op.fontIndex());
         break;
@@ -319,66 +312,16 @@ WebRenderBridgeParent::UpdateResources(c
       }
       case OpUpdateResource::T__None: break;
     }
   }
 
   return true;
 }
 
-bool
-WebRenderBridgeParent::AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
-                                        wr::ResourceUpdateQueue& aResources)
-{
-  Range<const wr::ImageKey> keys(&aKey, 1);
-  // Check if key is obsoleted.
-  if (keys[0].mNamespace != mIdNamespace) {
-    return true;
-  }
-  MOZ_ASSERT(mExternalImageIds.Get(wr::AsUint64(aExtId)).get());
-
-  RefPtr<WebRenderImageHost> host = mExternalImageIds.Get(wr::AsUint64(aExtId));
-  if (!host) {
-    NS_ERROR("CompositableHost does not exist");
-    return false;
-  }
-  if (!gfxEnv::EnableWebRenderRecording()) {
-    TextureHost* texture = host->GetAsTextureHostForComposite();
-    if (!texture) {
-      NS_ERROR("TextureHost does not exist");
-      return false;
-    }
-    WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
-    if (wrTexture) {
-      wrTexture->AddWRImage(aResources, keys, wrTexture->GetExternalImageKey());
-      return true;
-    }
-  }
-  RefPtr<DataSourceSurface> dSurf = host->GetAsSurface();
-  if (!dSurf) {
-    NS_ERROR("TextureHost does not return DataSourceSurface");
-    return false;
-  }
-
-  DataSourceSurface::MappedSurface map;
-  if (!dSurf->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
-    NS_ERROR("DataSourceSurface failed to map");
-    return false;
-  }
-
-  IntSize size = dSurf->GetSize();
-  wr::ImageDescriptor descriptor(size, map.mStride, dSurf->GetFormat());
-  wr::Vec_u8 data;
-  data.PushBytes(Range<uint8_t>(map.mData, size.height * map.mStride));
-  aResources.AddImage(keys[0], descriptor, data);
-  dSurf->Unmap();
-
-  return true;
-}
-
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvUpdateResources(nsTArray<OpUpdateResource>&& aResourceUpdates,
                                            nsTArray<ipc::Shmem>&& aResourceData)
 {
   if (mDestroyed) {
     DeallocShmems(aResourceData);
     return IPC_OK();
   }
@@ -513,47 +456,22 @@ WebRenderBridgeParent::RecvSetDisplayLis
   AutoProfilerTracing tracing("Paint", "SetDisplayList");
   UpdateFwdTransactionId(aFwdTransactionId);
   AutoClearReadLocks clearLocks(mReadLocks);
 
   // This ensures that destroy operations are always processed. It is not safe
   // to early-return from RecvDPEnd without doing so.
   AutoWebRenderBridgeParentAsyncMessageSender autoAsyncMessageSender(this, &aToDestroy);
 
-  uint32_t wrEpoch = GetNextWrEpoch();
-
-
   wr::ResourceUpdateQueue resources;
-
-  mAsyncImageManager->SetCompositionTime(TimeStamp::Now());
-  ProcessWebRenderParentCommands(aCommands, resources);
-
   UpdateResources(aResourceUpdates, aResourceData, resources);
 
-  // If id namespaces do not match, it means the command is obsolete, probably
-  // because the tab just moved to a new window.
-  // In that case do not send the commands to webrender.
-  if (mIdNamespace == aIdNamespace) {
-    if (mWidget) {
-      LayoutDeviceIntSize size = mWidget->GetClientSize();
-      mApi->SetWindowParameters(size);
-    }
-    gfx::Color color = mWidget ? gfx::Color(0.3f, 0.f, 0.f, 1.f) : gfx::Color(0.f, 0.f, 0.f, 0.f);
-    mApi->SetDisplayList(color, wr::NewEpoch(wrEpoch), LayerSize(aSize.width, aSize.height),
-                        mPipelineId, aContentSize,
-                        dlDesc, dl.mData, dl.mLength,
-                        resources);
-
-    ScheduleComposition();
-
-    if (ShouldParentObserveEpoch()) {
-      mCompositorBridge->ObserveLayerUpdate(GetLayersId(), GetChildLayerObserverEpoch(), true);
-    }
-  }
-
+  uint32_t wrEpoch = GetNextWrEpoch();
+  ProcessWebRenderCommands(aSize, aCommands, wr::NewEpoch(wrEpoch),
+                           aContentSize, dl, dlDesc, resources, aIdNamespace);
   HoldPendingTransactionId(wrEpoch, aTransactionId, aTxnStartTime, aFwdTime);
 
   mScrollData = aScrollData;
   UpdateAPZ();
 
   if (mIdNamespace != aIdNamespace) {
     // Pretend we composited since someone is wating for this event,
     // though DisplayList was not pushed to webrender.
@@ -604,19 +522,59 @@ void
 WebRenderBridgeParent::ProcessWebRenderParentCommands(const InfallibleTArray<WebRenderParentCommand>& aCommands,
                                                       wr::ResourceUpdateQueue& aResources)
 {
   for (InfallibleTArray<WebRenderParentCommand>::index_type i = 0; i < aCommands.Length(); ++i) {
     const WebRenderParentCommand& cmd = aCommands[i];
     switch (cmd.type()) {
       case WebRenderParentCommand::TOpAddExternalImage: {
         const OpAddExternalImage& op = cmd.get_OpAddExternalImage();
-        if (!AddExternalImage(op.externalImageId(), op.key(), aResources)) {
-          NS_ERROR("AddExternalImage failed");
+        Range<const wr::ImageKey> keys(&op.key(), 1);
+        // Check if key is obsoleted.
+        if (keys[0].mNamespace != mIdNamespace) {
+          break;
+        }
+        MOZ_ASSERT(mExternalImageIds.Get(wr::AsUint64(op.externalImageId())).get());
+
+        RefPtr<WebRenderImageHost> host = mExternalImageIds.Get(wr::AsUint64(op.externalImageId()));
+        if (!host) {
+          NS_ERROR("CompositableHost does not exist");
+          break;
         }
+        if (!gfxEnv::EnableWebRenderRecording()) {
+          TextureHost* texture = host->GetAsTextureHostForComposite();
+          if (!texture) {
+            NS_ERROR("TextureHost does not exist");
+            break;
+          }
+          WebRenderTextureHost* wrTexture = texture->AsWebRenderTextureHost();
+          if (wrTexture) {
+            wrTexture->AddWRImage(aResources, keys, wrTexture->GetExternalImageKey());
+            break;
+          }
+        }
+        RefPtr<DataSourceSurface> dSurf = host->GetAsSurface();
+        if (!dSurf) {
+          NS_ERROR("TextureHost does not return DataSourceSurface");
+          break;
+        }
+
+        DataSourceSurface::MappedSurface map;
+        if (!dSurf->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
+          NS_ERROR("DataSourceSurface failed to map");
+          break;
+        }
+
+        IntSize size = dSurf->GetSize();
+        wr::ImageDescriptor descriptor(size, map.mStride, dSurf->GetFormat());
+        wr::Vec_u8 data;
+        data.PushBytes(Range<uint8_t>(map.mData, size.height * map.mStride));
+        aResources.AddImage(keys[0], descriptor, data);
+
+        dSurf->Unmap();
         break;
       }
       case WebRenderParentCommand::TOpUpdateAsyncImagePipeline: {
         const OpUpdateAsyncImagePipeline& op = cmd.get_OpUpdateAsyncImagePipeline();
         mAsyncImageManager->UpdateAsyncImagePipeline(op.pipelineId(),
                                                       op.scBounds(),
                                                       op.scTransform(),
                                                       op.scaleToSize(),
@@ -651,16 +609,50 @@ WebRenderBridgeParent::ProcessWebRenderP
       default: {
         // other commands are handle on the child
         break;
       }
     }
   }
 }
 
+void
+WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
+                                                InfallibleTArray<WebRenderParentCommand>& aCommands, const wr::Epoch& aEpoch,
+                                                const wr::LayoutSize& aContentSize, const wr::ByteBuffer& dl,
+                                                const wr::BuiltDisplayListDescriptor& dlDesc,
+                                                wr::ResourceUpdateQueue& aResourceUpdates,
+                                                const wr::IdNamespace& aIdNamespace)
+{
+  mAsyncImageManager->SetCompositionTime(TimeStamp::Now());
+  ProcessWebRenderParentCommands(aCommands, aResourceUpdates);
+
+  // The command is obsoleted.
+  // Do not set the command to webrender since it causes crash in webrender.
+  if (mIdNamespace != aIdNamespace) {
+    return;
+  }
+
+  if (mWidget) {
+    LayoutDeviceIntSize size = mWidget->GetClientSize();
+    mApi->SetWindowParameters(size);
+  }
+  gfx::Color color = mWidget ? gfx::Color(0.3f, 0.f, 0.f, 1.f) : gfx::Color(0.f, 0.f, 0.f, 0.f);
+  mApi->SetDisplayList(color, aEpoch, LayerSize(aSize.width, aSize.height),
+                       mPipelineId, aContentSize,
+                       dlDesc, dl.mData, dl.mLength,
+                       aResourceUpdates);
+
+  ScheduleComposition();
+
+  if (ShouldParentObserveEpoch()) {
+    mCompositorBridge->ObserveLayerUpdate(GetLayersId(), GetChildLayerObserverEpoch(), true);
+  }
+}
+
 mozilla::ipc::IPCResult
 WebRenderBridgeParent::RecvGetSnapshot(PTextureParent* aTexture)
 {
   if (mDestroyed) {
     return IPC_OK();
   }
   MOZ_ASSERT(!mPaused);
 
--- a/gfx/layers/wr/WebRenderBridgeParent.h
+++ b/gfx/layers/wr/WebRenderBridgeParent.h
@@ -187,23 +187,28 @@ private:
   void DeallocShmems(nsTArray<ipc::Shmem>& aShmems);
 
   explicit WebRenderBridgeParent(const wr::PipelineId& aPipelineId);
   virtual ~WebRenderBridgeParent();
 
   bool UpdateResources(const nsTArray<OpUpdateResource>& aResourceUpdates,
                        const nsTArray<ipc::Shmem>& aResourceData,
                        wr::ResourceUpdateQueue& aUpdates);
-  bool AddExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
-                        wr::ResourceUpdateQueue& aResources);
 
   uint64_t GetLayersId() const;
   void ProcessWebRenderParentCommands(const InfallibleTArray<WebRenderParentCommand>& aCommands,
                                       wr::ResourceUpdateQueue& aResources);
-
+  void ProcessWebRenderCommands(const gfx::IntSize &aSize,
+                                InfallibleTArray<WebRenderParentCommand>& commands,
+                                const wr::Epoch& aEpoch,
+                                const wr::LayoutSize& aContentSize,
+                                const wr::ByteBuffer& dl,
+                                const wr::BuiltDisplayListDescriptor& dlDesc,
+                                wr::ResourceUpdateQueue& aResourceUpdates,
+                                const wr::IdNamespace& aIdNamespace);
   void ClearResources();
   uint64_t GetChildLayerObserverEpoch() const { return mChildLayerObserverEpoch; }
   bool ShouldParentObserveEpoch();
   mozilla::ipc::IPCResult HandleShutdown();
 
   void AdvanceAnimations();
   void SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
                         nsTArray<wr::WrTransformProperty>& aTransformArray);
--- a/gfx/layers/wr/WebRenderCanvasLayer.cpp
+++ b/gfx/layers/wr/WebRenderCanvasLayer.cpp
@@ -45,17 +45,17 @@ WebRenderCanvasLayer::RenderLayer(wr::Di
   MOZ_ASSERT(canvasRenderer);
   canvasRenderer->UpdateCompositableClient();
 
   Maybe<gfx::Matrix4x4> transform;
   if (canvasRenderer->NeedsYFlip()) {
     transform = Some(GetTransform().PreTranslate(0, mBounds.Height(), 0).PreScale(1, -1, 1));
   }
 
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this, transform);
 
   LayerRect rect(0, 0, mBounds.Width(), mBounds.Height());
   DumpLayerInfo("CanvasLayer", rect);
 
   wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);
 
   if (gfxPrefs::LayersDump()) {
--- a/gfx/layers/wr/WebRenderColorLayer.cpp
+++ b/gfx/layers/wr/WebRenderColorLayer.cpp
@@ -18,17 +18,17 @@ namespace layers {
 
 using namespace mozilla::gfx;
 
 void
 WebRenderColorLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
                                  wr::IpcResourceUpdateQueue& aResources,
                                  const StackingContextHelper& aSc)
 {
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
 
   LayerRect rect = Bounds();
   DumpLayerInfo("ColorLayer", rect);
 
   wr::LayoutRect r = sc.ToRelativeLayoutRect(rect);
   aBuilder.PushRect(r, r, wr::ToColorF(mColor));
 }
--- a/gfx/layers/wr/WebRenderContainerLayer.cpp
+++ b/gfx/layers/wr/WebRenderContainerLayer.cpp
@@ -102,17 +102,17 @@ WebRenderContainerLayer::RenderLayer(wr:
     transformForSC = nullptr;
   }
 
   nsTArray<wr::WrFilterOp> filters;
   for (const CSSFilter& filter : this->GetFilterChain()) {
     filters.AppendElement(wr::ToWrFilterOp(filter));
   }
 
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this, animationsId, opacityForSC, transformForSC, filters);
 
   LayerRect rect = Bounds();
   DumpLayerInfo("ContainerLayer", rect);
 
   for (LayerPolygon& child : children) {
     if (child.layer->IsBackfaceHidden()) {
       continue;
@@ -121,17 +121,17 @@ WebRenderContainerLayer::RenderLayer(wr:
   }
 }
 
 void
 WebRenderRefLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
                                wr::IpcResourceUpdateQueue& aResources,
                                const StackingContextHelper& aSc)
 {
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
 
   ParentLayerRect bounds = GetLocalTransformTyped().TransformBounds(Bounds());
   // As with WebRenderTextLayer, because we don't push a stacking context for
   // this layer, WR doesn't know about the transform on this layer. Therefore
   // we need to apply that transform to the bounds before we pass it on to WR.
   // The conversion from ParentLayerPixel to LayerPixel below is a result of
   // changing the reference layer from "this layer" to the "the layer that
   // created aSc".
--- a/gfx/layers/wr/WebRenderDisplayItemLayer.cpp
+++ b/gfx/layers/wr/WebRenderDisplayItemLayer.cpp
@@ -27,17 +27,17 @@ void
 WebRenderDisplayItemLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
                                        wr::IpcResourceUpdateQueue& aResources,
                                        const StackingContextHelper& aSc)
 {
   if (mVisibleRegion.IsEmpty()) {
     return;
   }
 
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
 
   if (mItem) {
     wr::LayoutSize contentSize; // this won't actually be used by anything
     wr::DisplayListBuilder builder(WrBridge()->GetPipeline(), contentSize);
     // We might have recycled this layer. Throw away the old commands.
     mParentCommands.Clear();
 
     mItem->CreateWebRenderCommands(builder, aResources, aSc, mParentCommands, WrManager(),
--- a/gfx/layers/wr/WebRenderImageLayer.cpp
+++ b/gfx/layers/wr/WebRenderImageLayer.cpp
@@ -5,32 +5,30 @@
 
 #include "WebRenderImageLayer.h"
 
 #include "gfxPrefs.h"
 #include "LayersLogging.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/ImageClient.h"
-#include "mozilla/layers/IpcResourceUpdateQueue.h"
 #include "mozilla/layers/ScrollingLayersHelper.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/TextureClientRecycleAllocator.h"
 #include "mozilla/layers/TextureWrapperImage.h"
 #include "mozilla/layers/WebRenderBridgeChild.h"
 #include "mozilla/webrender/WebRenderTypes.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace gfx;
 
 WebRenderImageLayer::WebRenderImageLayer(WebRenderLayerManager* aLayerManager)
   : ImageLayer(aLayerManager, static_cast<WebRenderLayer*>(this))
-  , mKey(Nothing())
   , mImageClientContainerType(CompositableType::UNKNOWN)
 {
   MOZ_COUNT_CTOR(WebRenderImageLayer);
 }
 
 WebRenderImageLayer::~WebRenderImageLayer()
 {
   MOZ_COUNT_DTOR(WebRenderImageLayer);
@@ -105,45 +103,16 @@ WebRenderImageLayer::SupportsAsyncUpdate
 {
   if (GetImageClientType() == CompositableType::IMAGE_BRIDGE &&
       mPipelineId.isSome()) {
     return true;
   }
   return false;
 }
 
-Maybe<wr::ImageKey>
-WebRenderImageLayer::UpdateImageKey(ImageClientSingle* aImageClient,
-                                    ImageContainer* aContainer,
-                                    Maybe<wr::ImageKey>& aOldKey,
-                                    wr::ExternalImageId& aExternalImageId,
-                                    wr::IpcResourceUpdateQueue& aResources)
-{
-  MOZ_ASSERT(aImageClient);
-  MOZ_ASSERT(aContainer);
-
-  bool ret = aImageClient->UpdateImage(aContainer, /* unused */0);
-  if (!ret || aImageClient->IsEmpty()) {
-    // Something failed and/or there is no image to show.
-    if (aOldKey.isSome()) {
-      aResources.DeleteImage(aOldKey.value());
-    }
-    return Nothing();
-  }
-
-  if (aOldKey.isSome()) {
-    return aOldKey;
-  }
-
-  wr::WrImageKey key = GenerateImageKey();
-
-  aResources.AddExternalImage(aExternalImageId, key);
-  return Some(key);
-}
-
 void
 WebRenderImageLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
                                  wr::IpcResourceUpdateQueue& aResources,
                                  const StackingContextHelper& aSc)
 {
   if (!mContainer) {
      return;
   }
@@ -179,17 +148,17 @@ WebRenderImageLayer::RenderLayer(wr::Dis
 
   if (GetImageClientType() == CompositableType::IMAGE_BRIDGE) {
     MOZ_ASSERT(!mImageClient);
     MOZ_ASSERT(mExternalImageId.isNothing());
 
     // Push IFrame for async image pipeline.
     // XXX Remove this once partial display list update is supported.
 
-    ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+    ScrollingLayersHelper scroller(this, aBuilder, aSc);
 
     ParentLayerRect bounds = GetLocalTransformTyped().TransformBounds(Bounds());
 
     // We don't push a stacking context for this async image pipeline here.
     // Instead, we do it inside the iframe that hosts the image. As a result,
     // a bunch of the calculations normally done as part of that stacking
     // context need to be done manually and pushed over to the parent side,
     // where it will be done when we build the display list for the iframe.
@@ -235,23 +204,22 @@ WebRenderImageLayer::RenderLayer(wr::Dis
   Image* image = autoLock.GetImage();
   if (!image) {
     return;
   }
   gfx::IntSize size = image->GetSize();
   mKey = UpdateImageKey(mImageClient->AsImageClientSingle(),
                         mContainer,
                         mKey,
-                        mExternalImageId.ref(),
-                        aResources);
+                        mExternalImageId.ref());
   if (mKey.isNothing()) {
     return;
   }
 
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
 
   LayerRect rect(0, 0, size.width, size.height);
   if (mScaleMode != ScaleMode::SCALE_NONE) {
     NS_ASSERTION(mScaleMode == ScaleMode::STRETCH,
                  "No other scalemodes than stretch and none supported yet.");
     rect = LayerRect(0, 0, mScaleToSize.width, mScaleToSize.height);
   }
@@ -265,18 +233,17 @@ WebRenderImageLayer::RenderLayer(wr::Dis
                   Stringify(filter).c_str());
   }
   wr::LayoutRect r = sc.ToRelativeLayoutRect(rect);
   aBuilder.PushImage(r, r, filter, mKey.value());
 }
 
 Maybe<wr::WrImageMask>
 WebRenderImageLayer::RenderMaskLayer(const StackingContextHelper& aSc,
-                                     const gfx::Matrix4x4& aTransform,
-                                     wr::IpcResourceUpdateQueue& aResources)
+                                     const gfx::Matrix4x4& aTransform)
 {
   if (!mContainer) {
      return Nothing();
   }
 
   CompositableType type = GetImageClientType();
   if (type == CompositableType::UNKNOWN) {
     return Nothing();
@@ -306,18 +273,17 @@ WebRenderImageLayer::RenderMaskLayer(con
   if (!image) {
     return Nothing();
   }
 
   MOZ_ASSERT(mImageClient->AsImageClientSingle());
   mKey = UpdateImageKey(mImageClient->AsImageClientSingle(),
                         mContainer,
                         mKey,
-                        mExternalImageId.ref(),
-                        aResources);
+                        mExternalImageId.ref());
   if (mKey.isNothing()) {
     return Nothing();
   }
 
   gfx::IntSize size = image->GetSize();
   wr::WrImageMask imageMask;
   imageMask.image = mKey.value();
   Rect maskRect = aTransform.TransformBounds(Rect(0, 0, size.width, size.height));
--- a/gfx/layers/wr/WebRenderImageLayer.h
+++ b/gfx/layers/wr/WebRenderImageLayer.h
@@ -30,32 +30,24 @@ protected:
   virtual ~WebRenderImageLayer();
 
 public:
   Layer* GetLayer() override { return this; }
   void RenderLayer(wr::DisplayListBuilder& aBuilder,
                    wr::IpcResourceUpdateQueue& aResources,
                    const StackingContextHelper& aSc) override;
   Maybe<wr::WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
-                                         const gfx::Matrix4x4& aTransform,
-                                         wr::IpcResourceUpdateQueue& aResources) override;
+                                         const gfx::Matrix4x4& aTransform) override;
 
 protected:
   CompositableType GetImageClientType();
   void ClearWrResources();
 
   void AddWRVideoImage(size_t aChannelNumber);
 
-  Maybe<wr::ImageKey>
-  UpdateImageKey(ImageClientSingle* aImageClient,
-                 ImageContainer* aContainer,
-                 Maybe<wr::ImageKey>& aOldKey,
-                 wr::ExternalImageId& aExternalImageId,
-                 wr::IpcResourceUpdateQueue& aResources);
-
   wr::MaybeExternalImageId mExternalImageId;
   Maybe<wr::ImageKey> mKey;
   RefPtr<ImageClient> mImageClient;
   CompositableType mImageClientContainerType;
   Maybe<wr::PipelineId> mPipelineId;
 };
 
 } // namespace layers
--- a/gfx/layers/wr/WebRenderLayer.cpp
+++ b/gfx/layers/wr/WebRenderLayer.cpp
@@ -36,23 +36,22 @@ WebRenderLayer::GenerateImageKey()
 {
   wr::WrImageKey key;
   key.mNamespace = WrBridge()->GetNamespace();
   key.mHandle = WrBridge()->GetNextResourceId();
   return key;
 }
 
 Maybe<wr::WrImageMask>
-WebRenderLayer::BuildWrMaskLayer(const StackingContextHelper& aRelativeTo,
-                                 wr::IpcResourceUpdateQueue& aResources)
+WebRenderLayer::BuildWrMaskLayer(const StackingContextHelper& aRelativeTo)
 {
   if (GetLayer()->GetMaskLayer()) {
     WebRenderLayer* maskLayer = ToWebRenderLayer(GetLayer()->GetMaskLayer());
     gfx::Matrix4x4 transform = maskLayer->GetLayer()->GetTransform();
-    return maskLayer->RenderMaskLayer(aRelativeTo, transform, aResources);
+    return maskLayer->RenderMaskLayer(aRelativeTo, transform);
   }
 
   return Nothing();
 }
 
 LayerRect
 WebRenderLayer::Bounds()
 {
@@ -77,16 +76,51 @@ WebRenderLayer::BoundsForStackingContext
   if (!transform.IsIdentity()) {
     // WR will only apply the 'translate' of the transform, so we need to do the scale/rotation manually.
     bounds.MoveTo(transform.TransformPoint(bounds.TopLeft()));
   }
 
   return bounds;
 }
 
+Maybe<wr::ImageKey>
+WebRenderLayer::UpdateImageKey(ImageClientSingle* aImageClient,
+                               ImageContainer* aContainer,
+                               Maybe<wr::ImageKey>& aOldKey,
+                               wr::ExternalImageId& aExternalImageId)
+{
+  MOZ_ASSERT(aImageClient);
+  MOZ_ASSERT(aContainer);
+
+  uint32_t oldCounter = aImageClient->GetLastUpdateGenerationCounter();
+
+  bool ret = aImageClient->UpdateImage(aContainer, /* unused */0);
+  if (!ret || aImageClient->IsEmpty()) {
+    // Delete old key
+    if (aOldKey.isSome()) {
+      WrManager()->AddImageKeyForDiscard(aOldKey.value());
+    }
+    return Nothing();
+  }
+
+  // Reuse old key if generation is not updated.
+  if (oldCounter == aImageClient->GetLastUpdateGenerationCounter() && aOldKey.isSome()) {
+    return aOldKey;
+  }
+
+  // Delete old key, we are generating a new key.
+  if (aOldKey.isSome()) {
+    WrManager()->AddImageKeyForDiscard(aOldKey.value());
+  }
+
+  wr::WrImageKey key = GenerateImageKey();
+  WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(aExternalImageId, key));
+  return Some(key);
+}
+
 void
 WebRenderLayer::DumpLayerInfo(const char* aLayerType, const LayerRect& aRect)
 {
   if (!gfxPrefs::LayersDump()) {
     return;
   }
 
   Layer* layer = GetLayer();
--- a/gfx/layers/wr/WebRenderLayer.h
+++ b/gfx/layers/wr/WebRenderLayer.h
@@ -23,44 +23,47 @@ typedef gfx::Matrix4x4Typed<LayerPixel, 
 class WebRenderLayer
 {
 public:
   virtual Layer* GetLayer() = 0;
   virtual void RenderLayer(wr::DisplayListBuilder& aBuilder,
                            wr::IpcResourceUpdateQueue& aResources,
                            const StackingContextHelper& aSc) = 0;
   virtual Maybe<wr::WrImageMask> RenderMaskLayer(const StackingContextHelper& aSc,
-                                                 const gfx::Matrix4x4& aTransform,
-                                                 wr::IpcResourceUpdateQueue& aResources)
+                                             const gfx::Matrix4x4& aTransform)
   {
     MOZ_ASSERT(false);
     return Nothing();
   }
 
   virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() { return nullptr; }
   static inline WebRenderLayer*
   ToWebRenderLayer(Layer* aLayer)
   {
     return static_cast<WebRenderLayer*>(aLayer->ImplData());
   }
 
+  Maybe<wr::ImageKey> UpdateImageKey(ImageClientSingle* aImageClient,
+                                     ImageContainer* aContainer,
+                                     Maybe<wr::ImageKey>& aOldKey,
+                                     wr::ExternalImageId& aExternalImageId);
+
   WebRenderLayerManager* WrManager();
   WebRenderBridgeChild* WrBridge();
   wr::WrImageKey GenerateImageKey();
 
   LayerRect Bounds();
   LayerRect BoundsForStackingContext();
 
   // Builds a WrImageMask from the mask layer on this layer, if there is one.
   // The |aRelativeTo| parameter should be a reference to the stacking context
   // that we want this mask to be relative to. This is usually the stacking
   // context of the *parent* layer of |this|, because that is what the mask
   // is relative to in the layer tree.
-  Maybe<wr::WrImageMask> BuildWrMaskLayer(const StackingContextHelper& aRelativeTo,
-                                          wr::IpcResourceUpdateQueue& aResources);
+  Maybe<wr::WrImageMask> BuildWrMaskLayer(const StackingContextHelper& aRelativeTo);
 
 protected:
   BoundsTransformMatrix BoundsTransform();
 
   void DumpLayerInfo(const char* aLayerType, const LayerRect& aRect);
 };
 
 } // namespace layers
--- a/gfx/layers/wr/WebRenderPaintedLayer.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayer.cpp
@@ -86,28 +86,26 @@ WebRenderPaintedLayer::UpdateImageClient
     return false;
   }
 
   return true;
 }
 
 void
 WebRenderPaintedLayer::CreateWebRenderDisplayList(wr::DisplayListBuilder& aBuilder,
-                                                  wr::IpcResourceUpdateQueue& aResources,
                                                   const StackingContextHelper& aSc)
 {
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
 
   LayerRect rect = Bounds();
   DumpLayerInfo("PaintedLayer", rect);
 
   wr::WrImageKey key = GenerateImageKey();
-  aResources.AddExternalImage(mExternalImageId.value(), key);
-  // TODO: reuse image keys!
+  WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
   WrManager()->AddImageKeyForDiscard(key);
 
   wr::LayoutRect r = sc.ToRelativeLayoutRect(rect);
   aBuilder.PushImage(r, r, wr::ImageRendering::Auto, key);
 }
 
 void
 WebRenderPaintedLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
@@ -158,17 +156,17 @@ WebRenderPaintedLayer::RenderLayer(wr::D
     mPaintedRect = visibleBounds;
     SetValidRegion(visibleRegion);
   } else {
     // We have an empty transaction, just reuse the old image we had before.
     MOZ_ASSERT(mExternalImageId);
     MOZ_ASSERT(mImageContainer->HasCurrentImage());
   }
 
-  CreateWebRenderDisplayList(aBuilder, aResources, aSc);
+  CreateWebRenderDisplayList(aBuilder, aSc);
 }
 
 void
 WebRenderPaintedLayer::ClearCachedResources()
 {
   ClearWrResources();
   if (mImageClient) {
     mImageClient->FlushAllImages();
--- a/gfx/layers/wr/WebRenderPaintedLayer.h
+++ b/gfx/layers/wr/WebRenderPaintedLayer.h
@@ -52,17 +52,16 @@ public:
 
   RefPtr<ImageContainer> mImageContainer;
   RefPtr<ImageClient> mImageClient;
 
 private:
   bool SetupExternalImages();
   bool UpdateImageClient();
   void CreateWebRenderDisplayList(wr::DisplayListBuilder& aBuilder,
-                                  wr::IpcResourceUpdateQueue& aResources,
                                   const StackingContextHelper& aSc);
   void ClearWrResources();
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // GFX_WEBRENDERPAINTEDLAYER_H
--- a/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
@@ -81,17 +81,17 @@ WebRenderPaintedLayerBlob::RenderLayer(w
     }
     mImageKey = Some(GenerateImageKey());
 
     wr::ImageDescriptor descriptor(imageSize, 0, dt->GetFormat());
     aResources.AddBlobImage(mImageKey.value(), descriptor, bytes.AsSlice());
     mImageBounds = visibleRegion.GetBounds();
   }
 
-  ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+  ScrollingLayersHelper scroller(this, aBuilder, aSc);
   StackingContextHelper sc(aSc, aBuilder, this);
   LayerRect rect = Bounds();
   DumpLayerInfo("PaintedLayer", rect);
 
   aBuilder.PushImage(sc.ToRelativeLayoutRect(LayerRect(mImageBounds)),
                      sc.ToRelativeLayoutRect(rect),
                      wr::ImageRendering::Auto, mImageKey.value());
 }
--- a/gfx/layers/wr/WebRenderTextLayer.cpp
+++ b/gfx/layers/wr/WebRenderTextLayer.cpp
@@ -22,17 +22,17 @@ void
 WebRenderTextLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
                                 wr::IpcResourceUpdateQueue& aResources,
                                 const StackingContextHelper& aSc)
 {
     if (mBounds.IsEmpty()) {
         return;
     }
 
-    ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc);
+    ScrollingLayersHelper scroller(this, aBuilder, aSc);
 
     LayerRect rect = LayerRect::FromUnknownRect(
         // I am not 100% sure this is correct, but it probably is. Because:
         // the bounds are in layer space, and when gecko composites layers it
         // applies the transform to the layer before compositing. However with
         // WebRender compositing, we don't pass the transform on this layer to
         // WR, so WR has no way of knowing about the transformed bounds unless
         // we apply it here. The glyphs that we push to WR should already be
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -150,17 +150,17 @@ public:
           }
         }
 
         data->UpdateCompositableClient();
 
         // Push IFrame for async image pipeline.
         // XXX Remove this once partial display list update is supported.
 
-        /* ScrollingLayersHelper scroller(this, aBuilder, aResources, aSc); */
+        /* ScrollingLayersHelper scroller(this, aBuilder, aSc); */
         nsIntSize canvasSizeInPx = data->GetSize();
         IntrinsicSize intrinsicSize = IntrinsicSizeFromCanvasSize(canvasSizeInPx);
         nsSize intrinsicRatio = IntrinsicRatioFromCanvasSize(canvasSizeInPx);
 
         nsRect area = mFrame->GetContentRectRelativeToSelf() + ToReferenceFrame();
         nsRect dest =
           nsLayoutUtils::ComputeObjectDestRect(area, intrinsicSize, intrinsicRatio,
                                                mFrame->StylePosition());