Bug 1355898. Rename flag SFE_WANT_FIRST_FRAME to SFE_WANT_FIRST_FRAME_IF_IMAGE to represent what it does better. r=jgilbert

We only pay attention to the flag for images.
This commit is contained in:
Timothy Nikkel 2017-04-13 03:40:45 -05:00
parent ddb9ca5c6a
commit f2110e92fe
4 changed files with 6 additions and 6 deletions

View File

@ -2610,7 +2610,7 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource,
// of animated images
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromElement(htmlElement,
nsLayoutUtils::SFE_WANT_FIRST_FRAME, mTarget);
nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE, mTarget);
if (!res.GetSourceSurface()) {
return nullptr;
@ -5106,7 +5106,7 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
if (!srcSurf) {
// The canvas spec says that drawImage should draw the first frame
// of animated images. We also don't want to rasterize vector images.
uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME |
uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE |
nsLayoutUtils::SFE_NO_RASTERIZING_VECTORS;
nsLayoutUtils::SurfaceFromElementResult res =

View File

@ -388,7 +388,7 @@ static already_AddRefed<SourceSurface>
GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement, ErrorResult& aRv)
{
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromElement(&aElement, nsLayoutUtils::SFE_WANT_FIRST_FRAME);
nsLayoutUtils::SurfaceFromElement(&aElement, nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE);
// check origin-clean
if (!CheckSecurityForHTMLElements(res)) {
@ -734,7 +734,7 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromOffscreenCanvas(&aOffscreenCanvas,
nsLayoutUtils::SFE_WANT_FIRST_FRAME);
nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE);
RefPtr<SourceSurface> surface = res.GetSourceSurface();

View File

@ -7267,7 +7267,7 @@ nsLayoutUtils::SurfaceFromElement(nsIImageLoadingContent* aElement,
uint32_t noRasterize = aSurfaceFlags & SFE_NO_RASTERIZING_VECTORS;
uint32_t whichFrame = (aSurfaceFlags & SFE_WANT_FIRST_FRAME)
uint32_t whichFrame = (aSurfaceFlags & SFE_WANT_FIRST_FRAME_IF_IMAGE)
? (uint32_t) imgIContainer::FRAME_FIRST
: (uint32_t) imgIContainer::FRAME_CURRENT;
uint32_t frameFlags = imgIContainer::FLAG_SYNC_DECODE

View File

@ -2079,7 +2079,7 @@ public:
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 = 1 << 1,
SFE_WANT_FIRST_FRAME_IF_IMAGE = 1 << 1,
/* Whether we should skip colorspace/gamma conversion */
SFE_NO_COLORSPACE_CONVERSION = 1 << 2,
/* Specifies that the caller wants unpremultiplied pixel data.