From b64d13e2adbb551d6fa7fb1d8703f2ef918f57d1 Mon Sep 17 00:00:00 2001 From: JerryShih Date: Mon, 5 Jun 2017 15:30:10 +0800 Subject: [PATCH] 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 | 4 +++- gfx/layers/wr/WebRenderCompositableHolder.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gfx/layers/wr/WebRenderCompositableHolder.cpp b/gfx/layers/wr/WebRenderCompositableHolder.cpp index e27fd93e4d66..442513a47207 100644 --- a/gfx/layers/wr/WebRenderCompositableHolder.cpp +++ b/gfx/layers/wr/WebRenderCompositableHolder.cpp @@ -20,6 +20,7 @@ namespace layers { WebRenderCompositableHolder::AsyncImagePipelineHolder::AsyncImagePipelineHolder() : mInitialised(false) , mIsChanged(false) + , mUseExternalImage(false) , mFilter(WrImageRendering::Auto) , mMixBlendMode(WrMixBlendMode::Normal) {} @@ -293,6 +294,7 @@ WebRenderCompositableHolder::UpdateImageKeys(wr::WebRenderAPI* aApi, if (texture == aHolder->mCurrentTexture) { // Reuse previous ImageKeys. aKeys.AppendElements(aHolder->mKeys); + aUseExternalImage = aHolder->mUseExternalImage; return true; } @@ -306,7 +308,7 @@ WebRenderCompositableHolder::UpdateImageKeys(wr::WebRenderAPI* aApi, 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; diff --git a/gfx/layers/wr/WebRenderCompositableHolder.h b/gfx/layers/wr/WebRenderCompositableHolder.h index d7b9e12f1f34..7d437bc3993c 100644 --- a/gfx/layers/wr/WebRenderCompositableHolder.h +++ b/gfx/layers/wr/WebRenderCompositableHolder.h @@ -122,6 +122,7 @@ private: bool mInitialised; bool mIsChanged; + bool mUseExternalImage; LayerRect mScBounds; gfx::Matrix4x4 mScTransform; gfx::MaybeIntSize mScaleToSize;