From f3335d09ea6a01a3d2cd9b7ff332b9a9246e340c Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Wed, 10 Nov 2021 16:23:17 +0000 Subject: [PATCH] Bug 1739661. Avoid using D2D when drawing SVG. r=aosmond This avoids using D2D when creating a cached SVG image. We can still hit D2D if we're not caching, but that should be less common. Differential Revision: https://phabricator.services.mozilla.com/D130513 --- image/VectorImage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp index 3167f47f729e..41f6a0285ebf 100644 --- a/image/VectorImage.cpp +++ b/image/VectorImage.cpp @@ -1080,6 +1080,12 @@ already_AddRefed VectorImage::CreateSurface( aParams.context ? aParams.context->GetDrawTarget()->GetBackendType() : gfxPlatform::GetPlatform()->GetDefaultContentBackend(); + if (backend == BackendType::DIRECT2D1_1) { + // We don't want to draw arbitrary content with D2D anymore + // because it doesn't support PushLayerWithBlend so switch to skia + backend = BackendType::SKIA; + } + // Try to create an imgFrame, initializing the surface it contains by drawing // our gfxDrawable into it. (We use FILTER_NEAREST since we never scale here.) auto frame = MakeNotNull>();