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 11:50:05 +00:00
parent a2ea1a6a96
commit b76cb0a8b0
28 changed files with 313 additions and 352 deletions

View File

@@ -247,12 +247,13 @@ 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() ==
texture->SupportsExternalCompositing() &&
previousTexture->SupportsExternalCompositing(backend) ==
texture->SupportsExternalCompositing(backend) &&
aPipeline->mKeys.Length() == numKeys;
if (!canUpdate) {
@@ -405,7 +406,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
aPipeline->mIsChanged = false;
wr::DisplayListBuilder builder(aPipelineId);
wr::DisplayListBuilder builder(aPipelineId, mApi->GetBackendType());
float opacity = 1.0f;
wr::StackingContextParams params;
@@ -477,7 +478,7 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
if (!pipeline) {
return;
}
wr::TransactionBuilder fastTxn(/* aUseSceneBuilderThread */ false);
wr::TransactionBuilder fastTxn(mApi, /* aUseSceneBuilderThread */ false);
wr::AutoTransactionSender sender(mApi, &fastTxn);
// Transaction for async image pipeline that uses ImageBridge always need to
@@ -514,7 +515,7 @@ void AsyncImagePipelineManager::SetEmptyDisplayList(
auto& txn = pipeline->mImageHost->GetAsyncRef() ? aTxnForImageBridge : aTxn;
wr::Epoch epoch = GetNextImageEpoch();
wr::DisplayListBuilder builder(aPipelineId);
wr::DisplayListBuilder builder(aPipelineId, mApi->GetBackendType());
wr::BuiltDisplayList dl;
builder.Finalize(dl);