mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1709622 - Remove no-op FLAG_WANT_DATA_SURFACE. r=tnikkel,jgilbert
Depends on D114685 Differential Revision: https://phabricator.services.mozilla.com/D114686
This commit is contained in:
parent
9180254463
commit
6d91a5484a
@ -1564,9 +1564,8 @@ CreateImageBitmapFromBlob::OnImageReady(imgIContainer* aImgContainer,
|
||||
MOZ_ASSERT(aImgContainer);
|
||||
|
||||
// Get the surface out.
|
||||
uint32_t frameFlags = imgIContainer::FLAG_SYNC_DECODE |
|
||||
imgIContainer::FLAG_ASYNC_NOTIFY |
|
||||
imgIContainer::FLAG_WANT_DATA_SURFACE;
|
||||
uint32_t frameFlags =
|
||||
imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY;
|
||||
uint32_t whichFrame = imgIContainer::FRAME_FIRST;
|
||||
RefPtr<SourceSurface> surface =
|
||||
aImgContainer->GetFrame(whichFrame, frameFlags);
|
||||
|
@ -164,7 +164,6 @@ Maybe<webgl::TexUnpackBlobDesc> FromDomElem(const ClientWebGLContext& webgl,
|
||||
// animated images. The webgl spec doesn't mention the issue, so we do the
|
||||
// same as drawImage.
|
||||
uint32_t flags = nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE |
|
||||
nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
|
||||
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR |
|
||||
nsLayoutUtils::SFE_ALLOW_NON_PREMULT;
|
||||
const auto& unpacking = webgl.State().mPixelUnpackState;
|
||||
|
@ -204,11 +204,6 @@ interface imgIContainer : nsISupports
|
||||
* frame of any size (it could be neither the requested size, nor the
|
||||
* intrinsic size) to be substituted.
|
||||
*
|
||||
* FLAG_WANT_DATA_SURFACE: Can be passed to GetFrame when the caller wants a
|
||||
* DataSourceSurface instead of a hardware accelerated surface. This can be
|
||||
* important for performance (by avoiding an upload to/readback from the GPU)
|
||||
* when the caller knows they want a SourceSurface of type DATA.
|
||||
*
|
||||
* FLAG_BYPASS_SURFACE_CACHE: Forces drawing to happen rather than taking
|
||||
* cached rendering from the surface cache. This is used when we are printing,
|
||||
* for example, where we want the vector commands from VectorImages to end up
|
||||
@ -248,12 +243,11 @@ interface imgIContainer : nsISupports
|
||||
const unsigned long FLAG_DECODE_NO_COLORSPACE_CONVERSION = 0x10;
|
||||
const unsigned long FLAG_CLAMP = 0x20;
|
||||
const unsigned long FLAG_HIGH_QUALITY_SCALING = 0x40;
|
||||
const unsigned long FLAG_WANT_DATA_SURFACE = 0x80;
|
||||
const unsigned long FLAG_BYPASS_SURFACE_CACHE = 0x100;
|
||||
const unsigned long FLAG_FORCE_PRESERVEASPECTRATIO_NONE = 0x200;
|
||||
const unsigned long FLAG_FORCE_UNIFORM_SCALING = 0x400;
|
||||
const unsigned long FLAG_AVOID_REDECODE_FOR_SIZE = 0x800;
|
||||
const unsigned long FLAG_DECODE_TO_SRGB_COLORSPACE = 0x1000;
|
||||
const unsigned long FLAG_BYPASS_SURFACE_CACHE = 0x80;
|
||||
const unsigned long FLAG_FORCE_PRESERVEASPECTRATIO_NONE = 0x100;
|
||||
const unsigned long FLAG_FORCE_UNIFORM_SCALING = 0x200;
|
||||
const unsigned long FLAG_AVOID_REDECODE_FOR_SIZE = 0x400;
|
||||
const unsigned long FLAG_DECODE_TO_SRGB_COLORSPACE = 0x800;
|
||||
|
||||
/**
|
||||
* A constant specifying the default set of decode flags (i.e., the default
|
||||
|
@ -7071,9 +7071,6 @@ SurfaceFromElementResult nsLayoutUtils::SurfaceFromElement(
|
||||
result.mIntrinsicSize = IntSize(imgWidth, imgHeight);
|
||||
|
||||
if (!noRasterize || imgContainer->GetType() == imgIContainer::TYPE_RASTER) {
|
||||
if (aSurfaceFlags & SFE_WANT_IMAGE_SURFACE) {
|
||||
frameFlags |= imgIContainer::FLAG_WANT_DATA_SURFACE;
|
||||
}
|
||||
result.mSourceSurface =
|
||||
imgContainer->GetFrameAtSize(result.mSize, whichFrame, frameFlags);
|
||||
if (!result.mSourceSurface) {
|
||||
|
@ -2149,24 +2149,22 @@ class nsLayoutUtils {
|
||||
*/
|
||||
|
||||
enum {
|
||||
/* When creating a new surface, create an image surface */
|
||||
SFE_WANT_IMAGE_SURFACE = 1 << 0,
|
||||
/* Whether to extract the first frame (as opposed to the
|
||||
current frame) in the case that the element is an image. */
|
||||
SFE_WANT_FIRST_FRAME_IF_IMAGE = 1 << 1,
|
||||
SFE_WANT_FIRST_FRAME_IF_IMAGE = 1 << 0,
|
||||
/* Whether we should skip colorspace/gamma conversion */
|
||||
SFE_NO_COLORSPACE_CONVERSION = 1 << 2,
|
||||
SFE_NO_COLORSPACE_CONVERSION = 1 << 1,
|
||||
/* Caller handles SFER::mAlphaType = NonPremult */
|
||||
SFE_ALLOW_NON_PREMULT = 1 << 3,
|
||||
SFE_ALLOW_NON_PREMULT = 1 << 2,
|
||||
/* Whether we should skip getting a surface for vector images and
|
||||
return a DirectDrawInfo containing an imgIContainer instead. */
|
||||
SFE_NO_RASTERIZING_VECTORS = 1 << 4,
|
||||
SFE_NO_RASTERIZING_VECTORS = 1 << 3,
|
||||
/* If image type is vector, the return surface size will same as
|
||||
element size, not image's intrinsic size. */
|
||||
SFE_USE_ELEMENT_SIZE_IF_VECTOR = 1 << 5,
|
||||
SFE_USE_ELEMENT_SIZE_IF_VECTOR = 1 << 4,
|
||||
/* Instead of converting the colorspace to the display's colorspace,
|
||||
use sRGB. */
|
||||
SFE_TO_SRGB_COLORSPACE = 1 << 6
|
||||
SFE_TO_SRGB_COLORSPACE = 1 << 5,
|
||||
};
|
||||
|
||||
// This function can be called on any thread.
|
||||
|
Loading…
Reference in New Issue
Block a user