Bug 1543359 - P6. Add backend for color range information. r=mattwoodrow.

Add code for YCbCr buffer and IOSurface backend.

Differential Revision: https://phabricator.services.mozilla.com/D27213
This commit is contained in:
Jean-Yves Avenard
2019-07-26 06:13:37 +00:00
parent 09c8db9fed
commit c97acded3d
29 changed files with 142 additions and 50 deletions

View File

@@ -122,6 +122,14 @@ gfx::YUVColorSpace MacIOSurfaceTextureHostOGL::GetYUVColorSpace() const {
return mSurface->GetYUVColorSpace();
}
gfx::ColorRange MacIOSurfaceTextureHostOGL::GetColorRange() const {
if (!mSurface) {
return gfx::ColorRange::LIMITED;
}
return mSurface->IsFullRange() ? gfx::ColorRange::FULL
: gfx::ColorRange::LIMITED;
}
void MacIOSurfaceTextureHostOGL::CreateRenderTexture(
const wr::ExternalImageId& aExternalImageId) {
RefPtr<wr::RenderTextureHost> texture =
@@ -229,7 +237,8 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
// which only supports 8 bits color depth.
aBuilder.PushYCbCrInterleavedImage(
aBounds, aClip, true, aImageKeys[0], wr::ColorDepth::Color8,
wr::ToWrYuvColorSpace(GetYUVColorSpace()), aFilter);
wr::ToWrYuvColorSpace(GetYUVColorSpace()),
wr::ToWrColorRange(GetColorRange()), aFilter);
break;
}
case gfx::SurfaceFormat::NV12: {
@@ -240,7 +249,7 @@ void MacIOSurfaceTextureHostOGL::PushDisplayItems(
aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
wr::ColorDepth::Color8,
wr::ToWrYuvColorSpace(GetYUVColorSpace()),
aFilter);
wr::ToWrColorRange(GetColorRange()), aFilter);
break;
}
default: {