Bug 1666055 - Disable buffer textures as external compositor surfaces on MacOS. r=lsalzman

When using the native RenderCompositor+SWGL on MacOS, we don't support passing buffer textures directly to the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D93179
This commit is contained in:
Matt Woodrow
2020-10-14 07:56:47 +00:00
parent 5e6d4a7772
commit d517b70ca2
21 changed files with 117 additions and 76 deletions

View File

@@ -699,17 +699,18 @@ void SurfaceTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
const wr::LayoutRect& aClip,
wr::ImageRendering aFilter,
const Range<wr::ImageKey>& aImageKeys,
const bool aPreferCompositorSurface) {
PushDisplayItemFlagSet aFlags) {
switch (GetFormat()) {
case gfx::SurfaceFormat::R8G8B8X8:
case gfx::SurfaceFormat::R8G8B8A8:
case gfx::SurfaceFormat::B8G8R8A8:
case gfx::SurfaceFormat::B8G8R8X8: {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aPreferCompositorSurface);
aBuilder.PushImage(
aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aFlags.contains(PushDisplayItemFlag::PREFER_COMPOSITOR_SURFACE));
break;
}
default: {
@@ -994,18 +995,18 @@ void AndroidHardwareBufferTextureHost::PushResourceUpdates(
void AndroidHardwareBufferTextureHost::PushDisplayItems(
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
const Range<wr::ImageKey>& aImageKeys,
const bool aPreferCompositorSurface) {
const Range<wr::ImageKey>& aImageKeys, PushDisplayItemFlagSet aFlags) {
switch (GetFormat()) {
case gfx::SurfaceFormat::R8G8B8X8:
case gfx::SurfaceFormat::R8G8B8A8:
case gfx::SurfaceFormat::B8G8R8A8:
case gfx::SurfaceFormat::B8G8R8X8: {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aPreferCompositorSurface);
aBuilder.PushImage(
aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aFlags.contains(PushDisplayItemFlag::PREFER_COMPOSITOR_SURFACE));
break;
}
default: {
@@ -1199,13 +1200,13 @@ void EGLImageTextureHost::PushResourceUpdates(
void EGLImageTextureHost::PushDisplayItems(
wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
const Range<wr::ImageKey>& aImageKeys,
const bool aPreferCompositorSurface) {
const Range<wr::ImageKey>& aImageKeys, PushDisplayItemFlagSet aFlags) {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aPreferCompositorSurface);
aBuilder.PushImage(
aBounds, aClip, true, aFilter, aImageKeys[0],
!(mFlags & TextureFlags::NON_PREMULTIPLIED),
wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f},
aFlags.contains(PushDisplayItemFlag::PREFER_COMPOSITOR_SURFACE));
}
//