Bug 1562091 - Partial backout of bug 1521027. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D42468

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Silva 2019-08-19 11:16:27 +00:00
parent 043a970708
commit bd9e647162
3 changed files with 8 additions and 14 deletions

View File

@ -1102,8 +1102,7 @@ already_AddRefed<SourceSurface> VectorImage::CreateSurface(
auto frame = MakeNotNull<RefPtr<imgFrame>>();
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

View File

@ -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);
}
}

View File

@ -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();