Bug 1418999 - Update PipelineId to associate the latest ImageContainer. r=sotaro
authorvincentliu <vliu@mozilla.com>
Thu, 11 Jan 2018 09:45:02 +0800
changeset 450457 a4e1e729857b87d51e7f3f47c1ac414fb6233036
parent 450456 24b4c8683fc4c8c8a43c73c08b11dd7f4c63947c
child 450458 d8d5e13766642e0559cb45c5d93dc7de3548798c
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1418999
milestone59.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 1418999 - Update PipelineId to associate the latest ImageContainer. r=sotaro
gfx/layers/wr/WebRenderUserData.cpp
--- a/gfx/layers/wr/WebRenderUserData.cpp
+++ b/gfx/layers/wr/WebRenderUserData.cpp
@@ -180,21 +180,30 @@ WebRenderImageData::CreateAsyncImageWebR
                                                       const LayoutDeviceRect& aSCBounds,
                                                       const gfx::Matrix4x4& aSCTransform,
                                                       const gfx::MaybeIntSize& aScaleToSize,
                                                       const wr::ImageRendering& aFilter,
                                                       const wr::MixBlendMode& aMixBlendMode,
                                                       bool aIsBackfaceVisible)
 {
   MOZ_ASSERT(aContainer->IsAsync());
+
+  if (mPipelineId.isSome() && mContainer != aContainer) {
+    // In this case, we need to remove the existed pipeline and create new one
+    // because the ImageContainer is changed.
+    WrBridge()->RemovePipelineIdForCompositable(mPipelineId.ref());
+    mPipelineId.reset();
+  }
+
   if (!mPipelineId) {
     // Alloc async image pipeline id.
     mPipelineId = Some(WrBridge()->GetCompositorBridgeChild()->GetNextPipelineId());
     WrBridge()->AddPipelineIdForAsyncCompositable(mPipelineId.ref(),
                                                   aContainer->GetAsyncContainerHandle());
+    mContainer = aContainer;
   }
   MOZ_ASSERT(!mImageClient);
   MOZ_ASSERT(!mExternalImageId);
 
   // Push IFrame for async image pipeline.
   //
   // 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,