Bug 1370117 - Update the external image status for reusing case. r=sotaro
authorJerryShih <hshih@mozilla.com>
Mon, 05 Jun 2017 15:30:10 +0800
changeset 412792 15c554f1a294dfdab0fbdda3a25a8467ef071b79
parent 412791 0534d36df322f8d1b806cef0705733cdf3f7b89f
child 412793 43383407d7c14ca3f1ee006e2b57ec5fe3ff0d3e
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1370117
milestone55.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 1370117 - Update the external image status for reusing case. r=sotaro When gecko go through the reusing case, the aUseExternalImage isn't set to the correct value. It is always false here. Then, gecko will use the non-external-image code path later. Add a new data member "mUseExternalImage" to save the previous status. MozReview-Commit-ID: KvzgIzYXNAB
gfx/layers/wr/WebRenderCompositableHolder.cpp
gfx/layers/wr/WebRenderCompositableHolder.h
--- a/gfx/layers/wr/WebRenderCompositableHolder.cpp
+++ b/gfx/layers/wr/WebRenderCompositableHolder.cpp
@@ -15,16 +15,17 @@ namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
 
 WebRenderCompositableHolder::AsyncImagePipelineHolder::AsyncImagePipelineHolder()
  : mInitialised(false)
  , mIsChanged(false)
+ , mUseExternalImage(false)
  , mFilter(WrImageRendering::Auto)
  , mMixBlendMode(WrMixBlendMode::Normal)
 {}
 
 WebRenderCompositableHolder::WebRenderCompositableHolder(uint32_t aIdNamespace)
  : mIdNamespace(aIdNamespace)
  , mResourceId(0)
  , mAsyncImageEpoch(0)
@@ -288,30 +289,31 @@ WebRenderCompositableHolder::UpdateImage
     return false;
   }
 
   aHolder->mIsChanged = false;
 
   if (texture == aHolder->mCurrentTexture) {
     // Reuse previous ImageKeys.
     aKeys.AppendElements(aHolder->mKeys);
+    aUseExternalImage = aHolder->mUseExternalImage;
     return true;
   }
 
   // Delete old ImageKeys
   aKeysToDelete.AppendElements(aHolder->mKeys);
   aHolder->mKeys.Clear();
   aHolder->mCurrentTexture = nullptr;
 
   // No txture to render
   if (!texture) {
     return true;
   }
 
-  aUseExternalImage = GetImageKeyForTextureHost(aApi, texture, aKeys);
+  aUseExternalImage = aHolder->mUseExternalImage = GetImageKeyForTextureHost(aApi, texture, aKeys);
   MOZ_ASSERT(!aKeys.IsEmpty());
   aHolder->mKeys.AppendElements(aKeys);
   aHolder->mCurrentTexture = texture;
   return true;
 }
 
 void
 WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
--- a/gfx/layers/wr/WebRenderCompositableHolder.h
+++ b/gfx/layers/wr/WebRenderCompositableHolder.h
@@ -117,16 +117,17 @@ private:
     Maybe<wr::Epoch> mDestroyedEpoch;
   };
 
   struct AsyncImagePipelineHolder {
     AsyncImagePipelineHolder();
 
     bool mInitialised;
     bool mIsChanged;
+    bool mUseExternalImage;
     LayerRect mScBounds;
     gfx::Matrix4x4 mScTransform;
     gfx::MaybeIntSize mScaleToSize;
     MaybeLayerRect mClipRect;
     MaybeImageMask mMask;
     WrImageRendering mFilter;
     WrMixBlendMode mMixBlendMode;
     RefPtr<WebRenderImageHost> mImageHost;