Bug 1764477 - Fix propagation of video bit depth changes to the output. r=aosmond

Previously, AsyncImagePipelineManager::UpdateImageKeys did not check bit depth when updating image keys, and WebRenderTextureHost did not correctly wrap GetColorDepth(). This caused the configuration not to correctly update.

Differential Revision: https://phabricator.services.mozilla.com/D143558
This commit is contained in:
Zaggy1024 2022-04-14 19:14:17 +00:00
Родитель a9aac08790
Коммит 987956876c
3 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -251,13 +251,14 @@ Maybe<TextureHost::ResourceUpdateOp> AsyncImagePipelineManager::UpdateImageKeys(
// If we already had a texture and the format hasn't changed, better to reuse
// the image keys than create new ones.
auto backend = aSceneBuilderTxn.GetBackendType();
bool canUpdate = !!previousTexture &&
previousTexture->GetSize() == texture->GetSize() &&
previousTexture->GetFormat() == texture->GetFormat() &&
previousTexture->NeedsYFlip() == texture->NeedsYFlip() &&
previousTexture->SupportsExternalCompositing(backend) ==
texture->SupportsExternalCompositing(backend) &&
aPipeline->mKeys.Length() == numKeys;
bool canUpdate =
!!previousTexture && previousTexture->GetSize() == texture->GetSize() &&
previousTexture->GetFormat() == texture->GetFormat() &&
previousTexture->GetColorDepth() == texture->GetColorDepth() &&
previousTexture->NeedsYFlip() == texture->NeedsYFlip() &&
previousTexture->SupportsExternalCompositing(backend) ==
texture->SupportsExternalCompositing(backend) &&
aPipeline->mKeys.Length() == numKeys;
if (!canUpdate) {
for (auto key : aPipeline->mKeys) {

Просмотреть файл

@ -79,6 +79,10 @@ already_AddRefed<gfx::DataSourceSurface> WebRenderTextureHost::GetAsSurface() {
return mWrappedTextureHost->GetAsSurface();
}
gfx::ColorDepth WebRenderTextureHost::GetColorDepth() const {
return mWrappedTextureHost->GetColorDepth();
}
gfx::YUVColorSpace WebRenderTextureHost::GetYUVColorSpace() const {
return mWrappedTextureHost->GetYUVColorSpace();
}

Просмотреть файл

@ -46,6 +46,7 @@ class WebRenderTextureHost : public TextureHost {
already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override;
gfx::ColorDepth GetColorDepth() const override;
gfx::YUVColorSpace GetYUVColorSpace() const override;
gfx::ColorRange GetColorRange() const override;