Bug 1688096 - Part 1. Merge SW-WR and WR render texture host paths to allow mixed compositors. r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D104854
This commit is contained in:
Andrew Osmond
2021-02-18 15:37:46 +00:00
parent be5cb5d474
commit cd218bcf63
28 changed files with 313 additions and 352 deletions

View File

@@ -673,7 +673,7 @@ void SurfaceTextureHost::PushResourceUpdates(
? &wr::TransactionBuilder::AddExternalImage
: &wr::TransactionBuilder::UpdateExternalImage;
auto imageType = gfx::gfxVars::UseSoftwareWebRender()
auto imageType = aResources.GetBackendType() == WebRenderBackend::SOFTWARE
? wr::ExternalImageType::TextureHandle(
wr::ImageBufferKind::TextureRect)
: wr::ExternalImageType::TextureHandle(
@@ -707,10 +707,8 @@ void SurfaceTextureHost::PushDisplayItems(wr::DisplayListBuilder& aBuilder,
PushDisplayItemFlagSet aFlags) {
bool preferCompositorSurface =
aFlags.contains(PushDisplayItemFlag::PREFER_COMPOSITOR_SURFACE);
bool supportsExternalCompositing = false;
if (gfx::gfxVars::UseSoftwareWebRender()) {
supportsExternalCompositing = true;
}
bool supportsExternalCompositing =
SupportsExternalCompositing(aBuilder.GetBackendType());
switch (GetFormat()) {
case gfx::SurfaceFormat::R8G8B8X8: