Commit a2c09a7b authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Add AVIF to canvas-createImageBitmap-e_srgb.html

Add the AVIF image format to the canvas-createImageBitmap-e_srgb.html
test in wpt/html/canvas/element/manual/wide-gamut-canvas/.

Also update lint.ignore to have the wpt lint tool ignore *.avif files.

The AVIF test images pattern-srgb.avif and pattern-srgb-transparent.avif
were generated from pattern-srgb.png and pattern-srgb-transparent.png
using the 'avifenc' program in libavif v0.8.0 with the following command
lines:

avifenc --speed 0 --yuv 420 --cicp 1/13/1 --range full \
    pattern-srgb.png pattern-srgb.avif
avifenc --speed 0 --yuv 420 --cicp 1/13/1 --range full \
    pattern-srgb-transparent.png pattern-srgb-transparent.avif

Test:
third_party/blink/tools/run_web_tests.py -t Default \
external/wpt/html/canvas/element/manual/wide-gamut-canvas/canvas-createImageBitmap-e_srgb.html

Bug: 1099028
Change-Id: I3577682a0e23dd768af32907cf549270f331c7a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2304961Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#796189}
parent 6885ae93
...@@ -284,9 +284,9 @@ function initializeTestCanvasTransparent(canvasColorSpace, canvasPixelFormat) ...@@ -284,9 +284,9 @@ function initializeTestCanvasTransparent(canvasColorSpace, canvasPixelFormat)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// HTMLImageElement - Opaque sRGB // HTMLImageElement - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP // File formats: AVIF, Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() { promise_test(function() {
return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map( return Promise.all(['avif', 'bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => { ext => new Promise((resolve,reject) => {
var image = new Image(); var image = new Image();
image.onload = function() { image.onload = function() {
...@@ -294,13 +294,13 @@ promise_test(function() { ...@@ -294,13 +294,13 @@ promise_test(function() {
} }
image.src = 'resources/pattern-srgb.' + ext; image.src = 'resources/pattern-srgb.' + ext;
}).then(testImageBitmapOpaque))); }).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB HTMLImageElement (BMP, \ }, 'createImageBitmap in e-sRGB from an opaque sRGB HTMLImageElement (AVIF, \
GIF, ICO, JPG, PNG, WEBP) with resize.'); BMP, GIF, ICO, JPG, PNG, WEBP) with resize.');
// HTMLImageElement - Transparent sRGB // HTMLImageElement - Transparent sRGB
// File formats: Bitmap, ICO, PNG, WEBP // File formats: AVIF, Bitmap, ICO, PNG, WEBP
promise_test(function() { promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map( return Promise.all(['avif', 'bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => { ext => new Promise((resolve,reject) => {
var image = new Image(); var image = new Image();
image.onload = function() { image.onload = function() {
...@@ -309,7 +309,7 @@ promise_test(function() { ...@@ -309,7 +309,7 @@ promise_test(function() {
image.src = 'resources/pattern-srgb-transparent.' + ext; image.src = 'resources/pattern-srgb-transparent.' + ext;
}).then(testImageBitmapFromTransparentImage))); }).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB HTMLImageElement \ }, 'createImageBitmap in e-sRGB from a transparent sRGB HTMLImageElement \
(BMP, ICO, PNG, WEBP) with resize.'); (AVIF, BMP, ICO, PNG, WEBP) with resize.');
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -369,9 +369,9 @@ promise_test(function() { ...@@ -369,9 +369,9 @@ promise_test(function() {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// Blob from file - Opaque sRGB // Blob from file - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP // File formats: AVIF, Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() { promise_test(function() {
return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map( return Promise.all(['avif', 'bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => { ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.' + ext); xhr.open("GET", 'resources/pattern-srgb.' + ext);
...@@ -381,13 +381,13 @@ promise_test(function() { ...@@ -381,13 +381,13 @@ promise_test(function() {
resolve(xhr.response); resolve(xhr.response);
}; };
}).then(testImageBitmapOpaque))); }).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, \ }, 'createImageBitmap in e-sRGB from an opaque sRGB Blob (AVIF, BMP, GIF, ICO, \
PNG, WEBP) with resize.'); JPG, PNG, WEBP) with resize.');
// Blob form file - Transparent sRGB // Blob form file - Transparent sRGB
// File formats: Bitmap, ICO, PNG, WEBP // File formats: AVIF, Bitmap, ICO, PNG, WEBP
promise_test(function() { promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map( return Promise.all(['avif', 'bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => { ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.' + ext); xhr.open("GET", 'resources/pattern-srgb-transparent.' + ext);
...@@ -397,8 +397,8 @@ promise_test(function() { ...@@ -397,8 +397,8 @@ promise_test(function() {
resolve(xhr.response); resolve(xhr.response);
}; };
}).then(testImageBitmapFromTransparentImage))); }).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, \ }, 'createImageBitmap in e-sRGB from a transparent sRGB Blob (AVIF, BMP, ICO, \
WEBP) with resize.'); PNG, WEBP) with resize.');
// Color managed blob from canvas // Color managed blob from canvas
function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) { function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) {
......
...@@ -46,6 +46,7 @@ TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.wasm ...@@ -46,6 +46,7 @@ TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.wasm
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.bmp TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.bmp
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.sxg TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.sxg
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.wbn TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.wbn
TRAILING WHITESPACE, INDENT TABS, CR AT EOL: *.avif
## .gitignore ## .gitignore
W3C-TEST.ORG: .gitignore W3C-TEST.ORG: .gitignore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment