From bd9e647162c3cdba57c2c40613263a5dd351cd2d Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 19 Aug 2019 11:16:27 +0000 Subject: [PATCH] Bug 1562091 - Partial backout of bug 1521027. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D42468 --HG-- extra : moz-landing-system : lando --- image/VectorImage.cpp | 3 +-- image/imgFrame.cpp | 16 ++++++---------- image/imgFrame.h | 3 +-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp index 11d3248fa7e9..63ab34bd6a76 100644 --- a/image/VectorImage.cpp +++ b/image/VectorImage.cpp @@ -1102,8 +1102,7 @@ already_AddRefed VectorImage::CreateSurface( auto frame = MakeNotNull>(); nsresult rv = frame->InitWithDrawable( aSVGDrawable, aParams.size, SurfaceFormat::B8G8R8A8, - SamplingFilter::POINT, aParams.flags, backend, - aParams.context ? aParams.context->GetDrawTarget() : nullptr); + SamplingFilter::POINT, aParams.flags, backend); // If we couldn't create the frame, it was probably because it would end // up way too big. Generally it also wouldn't fit in the cache, but the prefs diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index 23c6ff979770..cb3de0644b4f 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -358,7 +358,7 @@ nsresult imgFrame::InitForDecoderRecycle(const AnimationParams& aAnimParams) { nsresult imgFrame::InitWithDrawable( gfxDrawable* aDrawable, const nsIntSize& aSize, const SurfaceFormat aFormat, SamplingFilter aSamplingFilter, uint32_t aImageFlags, - gfx::BackendType aBackend, DrawTarget* aTargetDT) { + gfx::BackendType aBackend) { // Assert for properties that should be verified by decoders, // warn for properties related to bad content. if (!SurfaceCache::IsLegalSize(aSize)) { @@ -407,16 +407,12 @@ nsresult imgFrame::InitWithDrawable( // the documentation for this method. MOZ_ASSERT(!mOptSurface, "Called imgFrame::InitWithDrawable() twice?"); - if (aTargetDT && !gfxVars::UseWebRender()) { - target = aTargetDT->CreateSimilarDrawTarget(mImageSize, mFormat); + if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(aBackend)) { + target = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend( + aBackend, mImageSize, mFormat); } else { - if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(aBackend)) { - target = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend( - aBackend, mImageSize, mFormat); - } else { - target = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( - mImageSize, mFormat); - } + target = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( + mImageSize, mFormat); } } diff --git a/image/imgFrame.h b/image/imgFrame.h index 00e5271d6a78..3bb70457a048 100644 --- a/image/imgFrame.h +++ b/image/imgFrame.h @@ -81,8 +81,7 @@ class imgFrame { nsresult InitWithDrawable(gfxDrawable* aDrawable, const nsIntSize& aSize, const SurfaceFormat aFormat, SamplingFilter aSamplingFilter, - uint32_t aImageFlags, gfx::BackendType aBackend, - DrawTarget* aTarget); + uint32_t aImageFlags, gfx::BackendType aBackend); DrawableFrameRef DrawableRef();