Bug 1652550 - Disable RenderExternalTextureHost when BufferTextureHost is wrapped with GPUVideoTextureHost r=mattwoodrow

This patch also re-enables client storage for Nightly builds (gfx.webrender.enable-client-storage=true).

Differential Revision: https://phabricator.services.mozilla.com/D83375
This commit is contained in:
Miko Mynttinen
2020-07-14 13:31:32 +00:00
parent c2e08b44fe
commit b799cd241a
3 changed files with 15 additions and 2 deletions

View File

@@ -39,7 +39,19 @@ TextureHost* GPUVideoTextureHost::EnsureWrappedTextureHost() {
mWrappedTextureHost =
VideoBridgeParent::GetSingleton(sd.source())->LookupTexture(sd.handle());
if (mWrappedTextureHost && mExternalImageId.isSome()) {
if (!mWrappedTextureHost) {
return nullptr;
}
if (mWrappedTextureHost->AsBufferTextureHost()) {
// TODO(miko): This code path is taken when WebRenderTextureHost wraps
// GPUVideoTextureHost, which wraps BufferTextureHost.
// Because this creates additional copies of the texture data, we should not
// do this.
mWrappedTextureHost->AsBufferTextureHost()->DisableExternalTextures();
}
if (mExternalImageId.isSome()) {
// External image id is allocated by mWrappedTextureHost.
mWrappedTextureHost->EnsureRenderTexture(Nothing());
MOZ_ASSERT(mWrappedTextureHost->mExternalImageId.isSome());

View File

@@ -830,6 +830,7 @@ class BufferTextureHost : public TextureHost {
};
bool CanUnlock() { return !mFirstSource || mFirstSource->Sync(false); }
void DisableExternalTextures() { mUseExternalTextures = false; }
protected:
bool UseExternalTextures() const { return mUseExternalTextures; }

View File

@@ -4507,7 +4507,7 @@
#ifdef XP_MACOSX
- name: gfx.webrender.enable-client-storage
type: bool
value: false
value: @IS_NIGHTLY_BUILD@
mirror: once
#endif