Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko

Differential Revision: https://phabricator.services.mozilla.com/D120920
This commit is contained in:
Matt Woodrow
2021-07-28 20:58:22 +00:00
parent 2ad605e75d
commit 5436ad0e68
20 changed files with 220 additions and 186 deletions

View File

@@ -6438,6 +6438,8 @@ void PresShell::Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
return;
}
bgcolor = NS_ComposeColors(bgcolor, mCanvasBackgroundColor);
if (!layerManager) {
// TODO: Once we support WindowRenderers that aren't a LayerManager,
// then we need to handle this single color case for them.
@@ -6445,10 +6447,8 @@ void PresShell::Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
}
if (layerManager->GetBackendType() == layers::LayersBackend::LAYERS_WR) {
nsPresContext* pc = GetPresContext();
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
pc->GetVisibleArea(), pc->AppUnitsPerDevPixel());
bgcolor = NS_ComposeColors(bgcolor, mCanvasBackgroundColor);
presContext->GetVisibleArea(), presContext->AppUnitsPerDevPixel());
WebRenderBackgroundData data(wr::ToLayoutRect(bounds),
wr::ToColorF(ToDeviceColor(bgcolor)));
WrFiltersHolder wrFilters;
@@ -6461,10 +6461,8 @@ void PresShell::Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
RefPtr<ColorLayer> root = layerManager->CreateColorLayer();
if (root) {
nsPresContext* pc = GetPresContext();
nsIntRect bounds =
pc->GetVisibleArea().ToOutsidePixels(pc->AppUnitsPerDevPixel());
bgcolor = NS_ComposeColors(bgcolor, mCanvasBackgroundColor);
nsIntRect bounds = presContext->GetVisibleArea().ToOutsidePixels(
presContext->AppUnitsPerDevPixel());
root->SetColor(ToDeviceColor(bgcolor));
root->SetVisibleRegion(LayerIntRegion::FromUnknownRegion(bounds));
layerManager->SetRoot(root);