mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
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:
parent
043a970708
commit
bd9e647162
@ -1102,8 +1102,7 @@ already_AddRefed<SourceSurface> VectorImage::CreateSurface(
|
|||||||
auto frame = MakeNotNull<RefPtr<imgFrame>>();
|
auto frame = MakeNotNull<RefPtr<imgFrame>>();
|
||||||
nsresult rv = frame->InitWithDrawable(
|
nsresult rv = frame->InitWithDrawable(
|
||||||
aSVGDrawable, aParams.size, SurfaceFormat::B8G8R8A8,
|
aSVGDrawable, aParams.size, SurfaceFormat::B8G8R8A8,
|
||||||
SamplingFilter::POINT, aParams.flags, backend,
|
SamplingFilter::POINT, aParams.flags, backend);
|
||||||
aParams.context ? aParams.context->GetDrawTarget() : nullptr);
|
|
||||||
|
|
||||||
// If we couldn't create the frame, it was probably because it would end
|
// 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
|
// up way too big. Generally it also wouldn't fit in the cache, but the prefs
|
||||||
|
@ -358,7 +358,7 @@ nsresult imgFrame::InitForDecoderRecycle(const AnimationParams& aAnimParams) {
|
|||||||
nsresult imgFrame::InitWithDrawable(
|
nsresult imgFrame::InitWithDrawable(
|
||||||
gfxDrawable* aDrawable, const nsIntSize& aSize, const SurfaceFormat aFormat,
|
gfxDrawable* aDrawable, const nsIntSize& aSize, const SurfaceFormat aFormat,
|
||||||
SamplingFilter aSamplingFilter, uint32_t aImageFlags,
|
SamplingFilter aSamplingFilter, uint32_t aImageFlags,
|
||||||
gfx::BackendType aBackend, DrawTarget* aTargetDT) {
|
gfx::BackendType aBackend) {
|
||||||
// Assert for properties that should be verified by decoders,
|
// Assert for properties that should be verified by decoders,
|
||||||
// warn for properties related to bad content.
|
// warn for properties related to bad content.
|
||||||
if (!SurfaceCache::IsLegalSize(aSize)) {
|
if (!SurfaceCache::IsLegalSize(aSize)) {
|
||||||
@ -407,16 +407,12 @@ nsresult imgFrame::InitWithDrawable(
|
|||||||
// the documentation for this method.
|
// the documentation for this method.
|
||||||
MOZ_ASSERT(!mOptSurface, "Called imgFrame::InitWithDrawable() twice?");
|
MOZ_ASSERT(!mOptSurface, "Called imgFrame::InitWithDrawable() twice?");
|
||||||
|
|
||||||
if (aTargetDT && !gfxVars::UseWebRender()) {
|
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(aBackend)) {
|
||||||
target = aTargetDT->CreateSimilarDrawTarget(mImageSize, mFormat);
|
target = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
|
||||||
|
aBackend, mImageSize, mFormat);
|
||||||
} else {
|
} else {
|
||||||
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(aBackend)) {
|
target = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
|
||||||
target = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
|
mImageSize, mFormat);
|
||||||
aBackend, mImageSize, mFormat);
|
|
||||||
} else {
|
|
||||||
target = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
|
|
||||||
mImageSize, mFormat);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,8 +81,7 @@ class imgFrame {
|
|||||||
nsresult InitWithDrawable(gfxDrawable* aDrawable, const nsIntSize& aSize,
|
nsresult InitWithDrawable(gfxDrawable* aDrawable, const nsIntSize& aSize,
|
||||||
const SurfaceFormat aFormat,
|
const SurfaceFormat aFormat,
|
||||||
SamplingFilter aSamplingFilter,
|
SamplingFilter aSamplingFilter,
|
||||||
uint32_t aImageFlags, gfx::BackendType aBackend,
|
uint32_t aImageFlags, gfx::BackendType aBackend);
|
||||||
DrawTarget* aTarget);
|
|
||||||
|
|
||||||
DrawableFrameRef DrawableRef();
|
DrawableFrameRef DrawableRef();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user