forked from mirrors/gecko-dev
Backed out 2 changesets (bug 1446309) for build bustages at builds/worker/workspace/build/src/image/RasterImage.cpp on a CLOSED TREE
Backed out changeset 45e3f5d8e294 (bug 1446309) Backed out changeset 69a4c2a0aac6 (bug 1446309)
This commit is contained in:
parent
58a3b0b973
commit
0e3ad61a5d
23 changed files with 126 additions and 242 deletions
|
|
@ -365,12 +365,11 @@ ClippedImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
ClippedImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
ClippedImage::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
// XXX(seth): We currently don't have a way of clipping the result of
|
// XXX(seth): We currently don't have a way of clipping the result of
|
||||||
// GetImageContainer. We work around this by always returning null, but if it
|
// GetImageContainer. We work around this by always returning null, but if it
|
||||||
|
|
@ -379,11 +378,11 @@ ClippedImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
// that method for performance reasons.
|
// that method for performance reasons.
|
||||||
|
|
||||||
if (!ShouldClip()) {
|
if (!ShouldClip()) {
|
||||||
return InnerImage()->GetImageContainerAtSize(aManager, aSize, aSVGContext,
|
return InnerImage()->GetImageContainerAtSize(aManager, aSize,
|
||||||
aFlags, aOutContainer);
|
aSVGContext, aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImgDrawResult::NOT_SUPPORTED;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,11 @@ public:
|
||||||
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
NS_IMETHOD_(ImgDrawResult)
|
NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
|
||||||
GetImageContainerAtSize(layers::LayerManager* aManager,
|
GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags) override;
|
||||||
layers::ImageContainer** aOutContainer) override;
|
|
||||||
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
||||||
const nsIntSize& aSize,
|
const nsIntSize& aSize,
|
||||||
const ImageRegion& aRegion,
|
const ImageRegion& aRegion,
|
||||||
|
|
|
||||||
|
|
@ -234,14 +234,13 @@ DynamicImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
DynamicImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
DynamicImage::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aContainer)
|
|
||||||
{
|
{
|
||||||
return ImgDrawResult::NOT_SUPPORTED;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(ImgDrawResult)
|
||||||
|
|
|
||||||
|
|
@ -77,19 +77,18 @@ FrozenImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
FrozenImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
FrozenImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
// XXX(seth): GetImageContainer does not currently support anything but the
|
// XXX(seth): GetImageContainer does not currently support anything but the
|
||||||
// current frame. We work around this by always returning null, but if it ever
|
// current frame. We work around this by always returning null, but if it ever
|
||||||
// turns out that FrozenImage is widely used on codepaths that can actually
|
// turns out that FrozenImage is widely used on codepaths that can actually
|
||||||
// benefit from GetImageContainer, it would be a good idea to fix that method
|
// benefit from GetImageContainer, it would be a good idea to fix that method
|
||||||
// for performance reasons.
|
// for performance reasons.
|
||||||
return ImgDrawResult::NOT_SUPPORTED;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(ImgDrawResult)
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,11 @@ public:
|
||||||
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
NS_IMETHOD_(ImgDrawResult)
|
NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
|
||||||
GetImageContainerAtSize(layers::LayerManager* aManager,
|
GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags) override;
|
||||||
layers::ImageContainer** aOutContainer) override;
|
|
||||||
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
||||||
const nsIntSize& aSize,
|
const nsIntSize& aSize,
|
||||||
const ImageRegion& aRegion,
|
const ImageRegion& aRegion,
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,11 @@ ImageResource::SetCurrentImage(ImageContainer* aContainer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImgDrawResult
|
already_AddRefed<ImageContainer>
|
||||||
ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
const IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
MOZ_ASSERT(aManager);
|
MOZ_ASSERT(aManager);
|
||||||
|
|
@ -120,15 +119,11 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
== FLAG_NONE,
|
== FLAG_NONE,
|
||||||
"Unsupported flag passed to GetImageContainer");
|
"Unsupported flag passed to GetImageContainer");
|
||||||
|
|
||||||
ImgDrawResult drawResult;
|
IntSize size = GetImageContainerSize(aManager, aSize, aFlags);
|
||||||
IntSize size;
|
if (size.IsEmpty()) {
|
||||||
Tie(drawResult, size) = GetImageContainerSize(aManager, aSize, aFlags);
|
return nullptr;
|
||||||
if (drawResult != ImgDrawResult::SUCCESS) {
|
|
||||||
return drawResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(!size.IsEmpty());
|
|
||||||
|
|
||||||
if (mAnimationConsumers == 0) {
|
if (mAnimationConsumers == 0) {
|
||||||
SendOnUnlockedDraw(aFlags);
|
SendOnUnlockedDraw(aFlags);
|
||||||
}
|
}
|
||||||
|
|
@ -160,8 +155,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
case ImgDrawResult::SUCCESS:
|
case ImgDrawResult::SUCCESS:
|
||||||
case ImgDrawResult::BAD_IMAGE:
|
case ImgDrawResult::BAD_IMAGE:
|
||||||
case ImgDrawResult::BAD_ARGS:
|
case ImgDrawResult::BAD_ARGS:
|
||||||
container.forget(aOutContainer);
|
return container.forget();
|
||||||
return entry->mLastDrawResult;
|
|
||||||
case ImgDrawResult::NOT_READY:
|
case ImgDrawResult::NOT_READY:
|
||||||
case ImgDrawResult::INCOMPLETE:
|
case ImgDrawResult::INCOMPLETE:
|
||||||
case ImgDrawResult::TEMPORARY_ERROR:
|
case ImgDrawResult::TEMPORARY_ERROR:
|
||||||
|
|
@ -171,8 +165,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
// Unused by GetFrameInternal
|
// Unused by GetFrameInternal
|
||||||
default:
|
default:
|
||||||
MOZ_ASSERT_UNREACHABLE("Unhandled ImgDrawResult type!");
|
MOZ_ASSERT_UNREACHABLE("Unhandled ImgDrawResult type!");
|
||||||
container.forget(aOutContainer);
|
return container.forget();
|
||||||
return entry->mLastDrawResult;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,6 +173,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
NotifyDrawingObservers();
|
NotifyDrawingObservers();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ImgDrawResult drawResult;
|
||||||
IntSize bestSize;
|
IntSize bestSize;
|
||||||
RefPtr<SourceSurface> surface;
|
RefPtr<SourceSurface> surface;
|
||||||
Tie(drawResult, bestSize, surface) =
|
Tie(drawResult, bestSize, surface) =
|
||||||
|
|
@ -218,8 +212,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
case ImgDrawResult::SUCCESS:
|
case ImgDrawResult::SUCCESS:
|
||||||
case ImgDrawResult::BAD_IMAGE:
|
case ImgDrawResult::BAD_IMAGE:
|
||||||
case ImgDrawResult::BAD_ARGS:
|
case ImgDrawResult::BAD_ARGS:
|
||||||
container.forget(aOutContainer);
|
return container.forget();
|
||||||
return entry->mLastDrawResult;
|
|
||||||
case ImgDrawResult::NOT_READY:
|
case ImgDrawResult::NOT_READY:
|
||||||
case ImgDrawResult::INCOMPLETE:
|
case ImgDrawResult::INCOMPLETE:
|
||||||
case ImgDrawResult::TEMPORARY_ERROR:
|
case ImgDrawResult::TEMPORARY_ERROR:
|
||||||
|
|
@ -230,8 +223,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
// Unused by GetFrameInternal
|
// Unused by GetFrameInternal
|
||||||
default:
|
default:
|
||||||
MOZ_ASSERT_UNREACHABLE("Unhandled DrawResult type!");
|
MOZ_ASSERT_UNREACHABLE("Unhandled DrawResult type!");
|
||||||
container.forget(aOutContainer);
|
return container.forget();
|
||||||
return entry->mLastDrawResult;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -253,8 +245,7 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager,
|
||||||
|
|
||||||
SetCurrentImage(container, surface, true);
|
SetCurrentImage(container, surface, true);
|
||||||
entry->mLastDrawResult = drawResult;
|
entry->mLastDrawResult = drawResult;
|
||||||
container.forget(aOutContainer);
|
return container.forget();
|
||||||
return drawResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -353,19 +353,18 @@ protected:
|
||||||
* the same as the size of the surface in the image container, but it is the
|
* the same as the size of the surface in the image container, but it is the
|
||||||
* best effort estimate.
|
* best effort estimate.
|
||||||
*/
|
*/
|
||||||
virtual Tuple<ImgDrawResult, gfx::IntSize>
|
virtual gfx::IntSize GetImageContainerSize(layers::LayerManager* aManager,
|
||||||
GetImageContainerSize(layers::LayerManager* aManager,
|
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
{
|
{
|
||||||
return MakeTuple(ImgDrawResult::NOT_SUPPORTED, gfx::IntSize(0, 0));
|
return gfx::IntSize(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImgDrawResult GetImageContainerImpl(layers::LayerManager* aManager,
|
already_AddRefed<layers::ImageContainer>
|
||||||
|
GetImageContainerImpl(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags);
|
||||||
layers::ImageContainer** aContainer);
|
|
||||||
|
|
||||||
void UpdateImageContainer();
|
void UpdateImageContainer();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,15 +222,14 @@ ImageWrapper::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return mInnerImage->IsImageContainerAvailableAtSize(aManager, aSize, aFlags);
|
return mInnerImage->IsImageContainerAvailableAtSize(aManager, aSize, aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
ImageWrapper::GetImageContainerAtSize(layers::LayerManager* aManager,
|
ImageWrapper::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
return mInnerImage->GetImageContainerAtSize(aManager, aSize, aSVGContext,
|
return mInnerImage->GetImageContainerAtSize(aManager, aSize,
|
||||||
aFlags, aOutContainer);
|
aSVGContext, aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(ImgDrawResult)
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,6 @@ namespace image {
|
||||||
* permanent condition.
|
* permanent condition.
|
||||||
*
|
*
|
||||||
* BAD_ARGS: We failed to draw because bad arguments were passed to draw().
|
* BAD_ARGS: We failed to draw because bad arguments were passed to draw().
|
||||||
*
|
|
||||||
* NOT_SUPPORTED: The requested operation is not supported, but the image is
|
|
||||||
* otherwise valid.
|
|
||||||
*/
|
*/
|
||||||
enum class MOZ_MUST_USE_TYPE ImgDrawResult : uint8_t
|
enum class MOZ_MUST_USE_TYPE ImgDrawResult : uint8_t
|
||||||
{
|
{
|
||||||
|
|
@ -57,8 +54,7 @@ enum class MOZ_MUST_USE_TYPE ImgDrawResult : uint8_t
|
||||||
NOT_READY,
|
NOT_READY,
|
||||||
TEMPORARY_ERROR,
|
TEMPORARY_ERROR,
|
||||||
BAD_IMAGE,
|
BAD_IMAGE,
|
||||||
BAD_ARGS,
|
BAD_ARGS
|
||||||
NOT_SUPPORTED
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -182,12 +182,11 @@ OrientedImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
OrientedImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
OrientedImage::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
// XXX(seth): We currently don't have a way of orienting the result of
|
// XXX(seth): We currently don't have a way of orienting the result of
|
||||||
// GetImageContainer. We work around this by always returning null, but if it
|
// GetImageContainer. We work around this by always returning null, but if it
|
||||||
|
|
@ -196,11 +195,11 @@ OrientedImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
// that method for performance reasons.
|
// that method for performance reasons.
|
||||||
|
|
||||||
if (mOrientation.IsIdentity()) {
|
if (mOrientation.IsIdentity()) {
|
||||||
return InnerImage()->GetImageContainerAtSize(aManager, aSize, aSVGContext,
|
return InnerImage()->GetImageContainerAtSize(aManager, aSize,
|
||||||
aFlags, aOutContainer);
|
aSVGContext, aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImgDrawResult::NOT_SUPPORTED;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct MatrixBuilder
|
struct MatrixBuilder
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,11 @@ public:
|
||||||
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
NS_IMETHOD_(ImgDrawResult)
|
NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
|
||||||
GetImageContainerAtSize(layers::LayerManager* aManager,
|
GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags) override;
|
||||||
layers::ImageContainer** aOutContainer) override;
|
|
||||||
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
|
||||||
const nsIntSize& aSize,
|
const nsIntSize& aSize,
|
||||||
const ImageRegion& aRegion,
|
const ImageRegion& aRegion,
|
||||||
|
|
|
||||||
|
|
@ -627,34 +627,20 @@ RasterImage::GetFrameInternal(const IntSize& aSize,
|
||||||
return MakeTuple(ImgDrawResult::SUCCESS, suggestedSize, std::move(surface));
|
return MakeTuple(ImgDrawResult::SUCCESS, suggestedSize, std::move(surface));
|
||||||
}
|
}
|
||||||
|
|
||||||
Tuple<ImgDrawResult, IntSize>
|
IntSize
|
||||||
RasterImage::GetImageContainerSize(LayerManager* aManager,
|
RasterImage::GetImageContainerSize(LayerManager* aManager,
|
||||||
const IntSize& aSize,
|
const IntSize& aSize,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
{
|
{
|
||||||
if (!mHasSize) {
|
if (!IsImageContainerAvailableAtSize(aManager, aSize, aFlags)) {
|
||||||
return MakeTuple(ImgDrawResult::NOT_READY, IntSize(0, 0));
|
return IntSize(0, 0);
|
||||||
}
|
|
||||||
|
|
||||||
if (aSize.IsEmpty()) {
|
|
||||||
return MakeTuple(ImgDrawResult::BAD_ARGS, IntSize(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// We check the minimum size because while we support downscaling, we do not
|
|
||||||
// support upscaling. If aSize > mSize, we will never give a larger surface
|
|
||||||
// than mSize. If mSize > aSize, and mSize > maxTextureSize, we still want to
|
|
||||||
// use image containers if aSize <= maxTextureSize.
|
|
||||||
int32_t maxTextureSize = aManager->GetMaxTextureSize();
|
|
||||||
if (min(mSize.width, aSize.width) > maxTextureSize ||
|
|
||||||
min(mSize.height, aSize.height) > maxTextureSize) {
|
|
||||||
return MakeTuple(ImgDrawResult::NOT_SUPPORTED, IntSize(0, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CanDownscaleDuringDecode(aSize, aFlags)) {
|
if (!CanDownscaleDuringDecode(aSize, aFlags)) {
|
||||||
return MakeTuple(ImgDrawResult::SUCCESS, mSize);
|
return mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MakeTuple(ImgDrawResult::SUCCESS, aSize);
|
return aSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(bool)
|
NS_IMETHODIMP_(bool)
|
||||||
|
|
@ -666,10 +652,7 @@ RasterImage::IsImageContainerAvailable(LayerManager* aManager, uint32_t aFlags)
|
||||||
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
RasterImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags)
|
RasterImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags)
|
||||||
{
|
{
|
||||||
RefPtr<ImageContainer> container;
|
return GetImageContainerImpl(aManager, mSize, Nothing(), aFlags);
|
||||||
GetImageContainerImpl(aManager, mSize, Nothing(), aFlags,
|
|
||||||
getter_AddRefs(container));
|
|
||||||
return container.forget();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(bool)
|
NS_IMETHODIMP_(bool)
|
||||||
|
|
@ -691,18 +674,16 @@ RasterImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
RasterImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
RasterImage::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
// We do not pass in the given SVG context because in theory it could differ
|
// We do not pass in the given SVG context because in theory it could differ
|
||||||
// between calls, but actually have no impact on the actual contents of the
|
// between calls, but actually have no impact on the actual contents of the
|
||||||
// image container.
|
// image container.
|
||||||
return GetImageContainerImpl(aManager, aSize, Nothing(),
|
return GetImageContainerImpl(aManager, aSize, Nothing(), aFlags);
|
||||||
aFlags, aOutContainer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
|
|
||||||
|
|
@ -312,8 +312,7 @@ private:
|
||||||
uint32_t aWhichFrame,
|
uint32_t aWhichFrame,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
|
|
||||||
Tuple<ImgDrawResult, gfx::IntSize>
|
gfx::IntSize GetImageContainerSize(layers::LayerManager* aManager,
|
||||||
GetImageContainerSize(layers::LayerManager* aManager,
|
|
||||||
const gfx::IntSize& aSize,
|
const gfx::IntSize& aSize,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -849,31 +849,16 @@ VectorImage::GetFrameInternal(const IntSize& aSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
Tuple<ImgDrawResult, IntSize>
|
IntSize
|
||||||
VectorImage::GetImageContainerSize(LayerManager* aManager,
|
VectorImage::GetImageContainerSize(LayerManager* aManager,
|
||||||
const IntSize& aSize,
|
const IntSize& aSize,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
{
|
{
|
||||||
if (mError) {
|
if (!IsImageContainerAvailableAtSize(aManager, aSize, aFlags)) {
|
||||||
return MakeTuple(ImgDrawResult::BAD_IMAGE, IntSize(0, 0));
|
return IntSize(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mIsFullyLoaded) {
|
return aSize;
|
||||||
return MakeTuple(ImgDrawResult::NOT_READY, IntSize(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mHaveAnimations ||
|
|
||||||
aManager->GetBackendType() != LayersBackend::LAYERS_WR) {
|
|
||||||
return MakeTuple(ImgDrawResult::NOT_SUPPORTED, IntSize(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// We don't need to check if the size is too big since we only support
|
|
||||||
// WebRender backends.
|
|
||||||
if (aSize.IsEmpty()) {
|
|
||||||
return MakeTuple(ImgDrawResult::BAD_ARGS, IntSize(0, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return MakeTuple(ImgDrawResult::SUCCESS, aSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(bool)
|
NS_IMETHODIMP_(bool)
|
||||||
|
|
@ -908,12 +893,11 @@ VectorImage::IsImageContainerAvailableAtSize(LayerManager* aManager,
|
||||||
}
|
}
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
NS_IMETHODIMP_(ImgDrawResult)
|
NS_IMETHODIMP_(already_AddRefed<ImageContainer>)
|
||||||
VectorImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
VectorImage::GetImageContainerAtSize(LayerManager* aManager,
|
||||||
const gfx::IntSize& aSize,
|
const IntSize& aSize,
|
||||||
const Maybe<SVGImageContext>& aSVGContext,
|
const Maybe<SVGImageContext>& aSVGContext,
|
||||||
uint32_t aFlags,
|
uint32_t aFlags)
|
||||||
layers::ImageContainer** aOutContainer)
|
|
||||||
{
|
{
|
||||||
Maybe<SVGImageContext> newSVGContext;
|
Maybe<SVGImageContext> newSVGContext;
|
||||||
MaybeRestrictSVGContext(newSVGContext, aSVGContext, aFlags);
|
MaybeRestrictSVGContext(newSVGContext, aSVGContext, aFlags);
|
||||||
|
|
@ -926,7 +910,7 @@ VectorImage::GetImageContainerAtSize(layers::LayerManager* aManager,
|
||||||
FLAG_FORCE_PRESERVEASPECTRATIO_NONE);
|
FLAG_FORCE_PRESERVEASPECTRATIO_NONE);
|
||||||
return GetImageContainerImpl(aManager, aSize,
|
return GetImageContainerImpl(aManager, aSize,
|
||||||
newSVGContext ? newSVGContext : aSVGContext,
|
newSVGContext ? newSVGContext : aSVGContext,
|
||||||
flags, aOutContainer);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,7 @@ private:
|
||||||
uint32_t aWhichFrame,
|
uint32_t aWhichFrame,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
|
|
||||||
Tuple<ImgDrawResult, IntSize>
|
IntSize GetImageContainerSize(layers::LayerManager* aManager,
|
||||||
GetImageContainerSize(layers::LayerManager* aManager,
|
|
||||||
const IntSize& aSize,
|
const IntSize& aSize,
|
||||||
uint32_t aFlags) override;
|
uint32_t aFlags) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ native nsIntRectByVal(nsIntRect);
|
||||||
native nsSize(nsSize);
|
native nsSize(nsSize);
|
||||||
[ptr] native nsIFrame(nsIFrame);
|
[ptr] native nsIFrame(nsIFrame);
|
||||||
native TempRefImageContainer(already_AddRefed<mozilla::layers::ImageContainer>);
|
native TempRefImageContainer(already_AddRefed<mozilla::layers::ImageContainer>);
|
||||||
[ptr] native ImageContainer(mozilla::layers::ImageContainer);
|
|
||||||
[ref] native ImageRegion(mozilla::image::ImageRegion);
|
[ref] native ImageRegion(mozilla::image::ImageRegion);
|
||||||
[ptr] native LayerManager(mozilla::layers::LayerManager);
|
[ptr] native LayerManager(mozilla::layers::LayerManager);
|
||||||
native Orientation(mozilla::image::Orientation);
|
native Orientation(mozilla::image::Orientation);
|
||||||
|
|
@ -296,6 +295,15 @@ interface imgIContainer : nsISupports
|
||||||
[noscript, notxpcom] TempRefImageContainer getImageContainer(in LayerManager aManager,
|
[noscript, notxpcom] TempRefImageContainer getImageContainer(in LayerManager aManager,
|
||||||
in uint32_t aFlags);
|
in uint32_t aFlags);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if getImageContainer() is expected to return a valid
|
||||||
|
* ImageContainer when passed the given @Manager, @Size and @Flags
|
||||||
|
* parameters.
|
||||||
|
*/
|
||||||
|
[noscript, notxpcom] boolean isImageContainerAvailableAtSize(in LayerManager aManager,
|
||||||
|
[const] in nsIntSize aSize,
|
||||||
|
in uint32_t aFlags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to create an ImageContainer (and Image) containing the current
|
* Attempts to create an ImageContainer (and Image) containing the current
|
||||||
* frame at the given size. Match the requested size is best effort; it's
|
* frame at the given size. Match the requested size is best effort; it's
|
||||||
|
|
@ -314,23 +322,12 @@ interface imgIContainer : nsISupports
|
||||||
* @param aFlags Decoding / drawing flags (in other words, FLAG_* flags).
|
* @param aFlags Decoding / drawing flags (in other words, FLAG_* flags).
|
||||||
* Currently only FLAG_SYNC_DECODE and FLAG_SYNC_DECODE_IF_FAST
|
* Currently only FLAG_SYNC_DECODE and FLAG_SYNC_DECODE_IF_FAST
|
||||||
* are supported.
|
* are supported.
|
||||||
* @param aContainer Return value for ImageContainer for the current frame.
|
* @return An ImageContainer for the current frame, or nullptr if one could
|
||||||
* May be null depending on the draw result.
|
* not be created.
|
||||||
* @return The draw result for the current frame.
|
|
||||||
*/
|
*/
|
||||||
[noscript, notxpcom] ImgDrawResult getImageContainerAtSize(in LayerManager aManager,
|
[noscript, notxpcom] TempRefImageContainer getImageContainerAtSize(in LayerManager aManager,
|
||||||
[const] in nsIntSize aSize,
|
[const] in nsIntSize aSize,
|
||||||
[const] in MaybeSVGImageContext aSVGContext,
|
[const] in MaybeSVGImageContext aSVGContext,
|
||||||
in uint32_t aFlags,
|
|
||||||
out ImageContainer aOutContainer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if getImageContainer() is expected to return a valid
|
|
||||||
* ImageContainer when passed the given @Manager, @Size and @Flags
|
|
||||||
* parameters.
|
|
||||||
*/
|
|
||||||
[noscript, notxpcom] boolean isImageContainerAvailableAtSize(in LayerManager aManager,
|
|
||||||
[const] in nsIntSize aSize,
|
|
||||||
in uint32_t aFlags);
|
in uint32_t aFlags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,12 @@ TEST_F(ImageContainers, RasterImageContainer)
|
||||||
// Upscaling should give the native size.
|
// Upscaling should give the native size.
|
||||||
IntSize requestedSize = testCase.mSize;
|
IntSize requestedSize = testCase.mSize;
|
||||||
requestedSize.Scale(2, 2);
|
requestedSize.Scale(2, 2);
|
||||||
RefPtr<layers::ImageContainer> upscaleContainer;
|
RefPtr<layers::ImageContainer> upscaleContainer =
|
||||||
image->GetImageContainerAtSize(layerManager,
|
image->GetImageContainerAtSize(layerManager,
|
||||||
requestedSize,
|
requestedSize,
|
||||||
Nothing(),
|
Nothing(),
|
||||||
imgIContainer::FLAG_SYNC_DECODE |
|
imgIContainer::FLAG_SYNC_DECODE |
|
||||||
imgIContainer::FLAG_HIGH_QUALITY_SCALING,
|
imgIContainer::FLAG_HIGH_QUALITY_SCALING);
|
||||||
getter_AddRefs(upscaleContainer));
|
|
||||||
ASSERT_TRUE(upscaleContainer != nullptr);
|
ASSERT_TRUE(upscaleContainer != nullptr);
|
||||||
containerSize = upscaleContainer->GetCurrentSize();
|
containerSize = upscaleContainer->GetCurrentSize();
|
||||||
EXPECT_EQ(testCase.mSize.width, containerSize.width);
|
EXPECT_EQ(testCase.mSize.width, containerSize.width);
|
||||||
|
|
@ -86,23 +85,21 @@ TEST_F(ImageContainers, RasterImageContainer)
|
||||||
requestedSize = testCase.mSize;
|
requestedSize = testCase.mSize;
|
||||||
requestedSize.width /= 2;
|
requestedSize.width /= 2;
|
||||||
requestedSize.height /= 2;
|
requestedSize.height /= 2;
|
||||||
RefPtr<layers::ImageContainer> downscaleContainer;
|
RefPtr<layers::ImageContainer> downscaleContainer =
|
||||||
image->GetImageContainerAtSize(layerManager,
|
image->GetImageContainerAtSize(layerManager,
|
||||||
requestedSize,
|
requestedSize,
|
||||||
Nothing(),
|
Nothing(),
|
||||||
imgIContainer::FLAG_SYNC_DECODE |
|
imgIContainer::FLAG_SYNC_DECODE |
|
||||||
imgIContainer::FLAG_HIGH_QUALITY_SCALING,
|
imgIContainer::FLAG_HIGH_QUALITY_SCALING);
|
||||||
getter_AddRefs(downscaleContainer));
|
|
||||||
containerSize = downscaleContainer->GetCurrentSize();
|
containerSize = downscaleContainer->GetCurrentSize();
|
||||||
EXPECT_EQ(requestedSize.width, containerSize.width);
|
EXPECT_EQ(requestedSize.width, containerSize.width);
|
||||||
EXPECT_EQ(requestedSize.height, containerSize.height);
|
EXPECT_EQ(requestedSize.height, containerSize.height);
|
||||||
|
|
||||||
// Get at native size again. Should give same container.
|
// Get at native size again. Should give same container.
|
||||||
RefPtr<layers::ImageContainer> againContainer;
|
RefPtr<layers::ImageContainer> againContainer =
|
||||||
image->GetImageContainerAtSize(layerManager,
|
image->GetImageContainerAtSize(layerManager,
|
||||||
testCase.mSize,
|
testCase.mSize,
|
||||||
Nothing(),
|
Nothing(),
|
||||||
imgIContainer::FLAG_SYNC_DECODE,
|
imgIContainer::FLAG_SYNC_DECODE);
|
||||||
getter_AddRefs(againContainer));
|
|
||||||
ASSERT_EQ(nativeContainer.get(), againContainer.get());
|
ASSERT_EQ(nativeContainer.get(), againContainer.get());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -479,10 +479,8 @@ BulletRenderer::CreateWebRenderCommandsForImage(nsDisplayItem* aItem,
|
||||||
gfx::IntSize decodeSize =
|
gfx::IntSize decodeSize =
|
||||||
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImage, aItem->Frame(), destRect,
|
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImage, aItem->Frame(), destRect,
|
||||||
aSc, flags, svgContext);
|
aSc, flags, svgContext);
|
||||||
|
RefPtr<layers::ImageContainer> container =
|
||||||
RefPtr<layers::ImageContainer> container;
|
mImage->GetImageContainerAtSize(aManager, decodeSize, svgContext, flags);
|
||||||
mImage->GetImageContainerAtSize(aManager, decodeSize, svgContext,
|
|
||||||
flags, getter_AddRefs(container));
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1811,50 +1811,8 @@ nsDisplayImage::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilde
|
||||||
IntSize decodeSize =
|
IntSize decodeSize =
|
||||||
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImage, mFrame, destRect,
|
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImage, mFrame, destRect,
|
||||||
aSc, flags, svgContext);
|
aSc, flags, svgContext);
|
||||||
|
RefPtr<ImageContainer> container =
|
||||||
RefPtr<layers::ImageContainer> container;
|
mImage->GetImageContainerAtSize(aManager, decodeSize, svgContext, flags);
|
||||||
ImgDrawResult drawResult =
|
|
||||||
mImage->GetImageContainerAtSize(aManager, decodeSize, svgContext,
|
|
||||||
flags, getter_AddRefs(container));
|
|
||||||
|
|
||||||
// While we got a container, it may not contain a fully decoded surface. If
|
|
||||||
// that is the case, and we have an image we were previously displaying which
|
|
||||||
// has a fully decoded surface, then we should prefer the previous image.
|
|
||||||
bool updatePrevImage = false;
|
|
||||||
switch (drawResult) {
|
|
||||||
case ImgDrawResult::NOT_READY:
|
|
||||||
case ImgDrawResult::INCOMPLETE:
|
|
||||||
case ImgDrawResult::TEMPORARY_ERROR:
|
|
||||||
if (mPrevImage && mPrevImage != mImage) {
|
|
||||||
RefPtr<ImageContainer> prevContainer;
|
|
||||||
drawResult = mPrevImage->GetImageContainerAtSize(aManager, decodeSize,
|
|
||||||
svgContext, flags,
|
|
||||||
getter_AddRefs(prevContainer));
|
|
||||||
if (prevContainer && drawResult == ImgDrawResult::SUCCESS) {
|
|
||||||
container = std::move(prevContainer);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Previous image was unusable; we can forget about it.
|
|
||||||
updatePrevImage = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
updatePrevImage = mPrevImage != mImage;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The previous image was not used, and is different from the current image.
|
|
||||||
// We should forget about it. We need to update the frame as well because the
|
|
||||||
// display item may get recreated.
|
|
||||||
if (updatePrevImage) {
|
|
||||||
mPrevImage = mImage;
|
|
||||||
if (mFrame->IsImageFrame()) {
|
|
||||||
nsImageFrame* f = static_cast<nsImageFrame*>(mFrame);
|
|
||||||
f->mPrevImage = f->mImage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3721,10 +3721,8 @@ nsCSSBorderImageRenderer::CreateWebRenderCommands(nsDisplayItem* aItem,
|
||||||
gfx::IntSize decodeSize =
|
gfx::IntSize decodeSize =
|
||||||
nsLayoutUtils::ComputeImageContainerDrawingParameters(img, aForFrame, destRect,
|
nsLayoutUtils::ComputeImageContainerDrawingParameters(img, aForFrame, destRect,
|
||||||
aSc, flags, svgContext);
|
aSc, flags, svgContext);
|
||||||
|
RefPtr<layers::ImageContainer> container =
|
||||||
RefPtr<layers::ImageContainer> container;
|
img->GetImageContainerAtSize(aManager, decodeSize, svgContext, flags);
|
||||||
img->GetImageContainerAtSize(aManager, decodeSize, svgContext,
|
|
||||||
flags, getter_AddRefs(container));
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -618,10 +618,8 @@ nsImageRenderer::BuildWebRenderDisplayItems(nsPresContext* aPresContext,
|
||||||
gfx::IntSize decodeSize =
|
gfx::IntSize decodeSize =
|
||||||
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImageContainer, mForFrame, destRect,
|
nsLayoutUtils::ComputeImageContainerDrawingParameters(mImageContainer, mForFrame, destRect,
|
||||||
aSc, containerFlags, svgContext);
|
aSc, containerFlags, svgContext);
|
||||||
|
RefPtr<layers::ImageContainer> container =
|
||||||
RefPtr<layers::ImageContainer> container;
|
mImageContainer->GetImageContainerAtSize(aManager, decodeSize, svgContext, containerFlags);
|
||||||
mImageContainer->GetImageContainerAtSize(aManager, decodeSize, svgContext,
|
|
||||||
containerFlags, getter_AddRefs(container));
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
NS_WARNING("Failed to get image container");
|
NS_WARNING("Failed to get image container");
|
||||||
return ImgDrawResult::NOT_READY;
|
return ImgDrawResult::NOT_READY;
|
||||||
|
|
|
||||||
|
|
@ -452,10 +452,8 @@ nsImageBoxFrame::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuild
|
||||||
gfx::IntSize decodeSize =
|
gfx::IntSize decodeSize =
|
||||||
nsLayoutUtils::ComputeImageContainerDrawingParameters(imgCon, aItem->Frame(), fillRect,
|
nsLayoutUtils::ComputeImageContainerDrawingParameters(imgCon, aItem->Frame(), fillRect,
|
||||||
aSc, containerFlags, svgContext);
|
aSc, containerFlags, svgContext);
|
||||||
|
RefPtr<layers::ImageContainer> container =
|
||||||
RefPtr<layers::ImageContainer> container;
|
imgCon->GetImageContainerAtSize(aManager, decodeSize, svgContext, containerFlags);
|
||||||
imgCon->GetImageContainerAtSize(aManager, decodeSize, svgContext,
|
|
||||||
containerFlags, getter_AddRefs(container));
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
NS_WARNING("Failed to get image container");
|
NS_WARNING("Failed to get image container");
|
||||||
return Nothing();
|
return Nothing();
|
||||||
|
|
|
||||||
|
|
@ -789,8 +789,7 @@ nsBaseDragService::DrawDragForImage(nsPresContext* aPresContext,
|
||||||
imgIContainer::FRAME_CURRENT,
|
imgIContainer::FRAME_CURRENT,
|
||||||
SamplingFilter::GOOD, /* no SVGImageContext */ Nothing(),
|
SamplingFilter::GOOD, /* no SVGImageContext */ Nothing(),
|
||||||
imgIContainer::FLAG_SYNC_DECODE, 1.0);
|
imgIContainer::FLAG_SYNC_DECODE, 1.0);
|
||||||
if (res == ImgDrawResult::BAD_IMAGE || res == ImgDrawResult::BAD_ARGS ||
|
if (res == ImgDrawResult::BAD_IMAGE || res == ImgDrawResult::BAD_ARGS) {
|
||||||
res == ImgDrawResult::NOT_SUPPORTED) {
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
*aSurface = dt->Snapshot();
|
*aSurface = dt->Snapshot();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue