Backed out changeset 4ab352d967d9 (Bug 1701760) for causing flashes duing animations (bug 1708989). r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D114938
This commit is contained in:
Sebastian Hengst 2021-06-01 17:31:12 +00:00
Родитель 8d4c947c17
Коммит 8611b6737c
3 изменённых файлов: 2 добавлений и 10 удалений

Просмотреть файл

@ -2185,8 +2185,7 @@ already_AddRefed<CanvasPattern> CanvasRenderingContext2D::CreatePattern(
// The canvas spec says that createPattern should use the first frame
// of animated images
auto flags = nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE |
nsLayoutUtils::SFE_EXACT_SIZE_SURFACE |
nsLayoutUtils::SFE_TO_SRGB_COLORSPACE;
nsLayoutUtils::SFE_EXACT_SIZE_SURFACE;
SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromElement(element, flags, mTarget);
@ -4529,8 +4528,7 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
// of animated images. We also don't want to rasterize vector images.
uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME_IF_IMAGE |
nsLayoutUtils::SFE_NO_RASTERIZING_VECTORS |
nsLayoutUtils::SFE_EXACT_SIZE_SURFACE |
nsLayoutUtils::SFE_TO_SRGB_COLORSPACE;
nsLayoutUtils::SFE_EXACT_SIZE_SURFACE;
SurfaceFromElementResult res =
CanvasRenderingContext2D::CachedSurfaceFromElement(element);

Просмотреть файл

@ -7126,9 +7126,6 @@ SurfaceFromElementResult nsLayoutUtils::SurfaceFromElement(
imgIContainer::FLAG_SYNC_DECODE | imgIContainer::FLAG_ASYNC_NOTIFY;
if (aSurfaceFlags & SFE_NO_COLORSPACE_CONVERSION)
frameFlags |= imgIContainer::FLAG_DECODE_NO_COLORSPACE_CONVERSION;
if (aSurfaceFlags & SFE_TO_SRGB_COLORSPACE) {
frameFlags |= imgIContainer::FLAG_DECODE_TO_SRGB_COLORSPACE;
}
if (aSurfaceFlags & SFE_ALLOW_NON_PREMULT) {
frameFlags |= imgIContainer::FLAG_DECODE_NO_PREMULTIPLY_ALPHA;
}

Просмотреть файл

@ -2165,9 +2165,6 @@ class nsLayoutUtils {
/* 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 << 4,
/* Instead of converting the colorspace to the display's colorspace,
use sRGB. */
SFE_TO_SRGB_COLORSPACE = 1 << 5,
/* Ensure that the returned surface has a size that matches the
* SurfaceFromElementResult::mSize. This is mostly a convenience thing so
* that callers who want this don't have to deal with it themselves.