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:
@@ -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());
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -4507,7 +4507,7 @@
|
||||
#ifdef XP_MACOSX
|
||||
- name: gfx.webrender.enable-client-storage
|
||||
type: bool
|
||||
value: false
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: once
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user