Skip to content

Commit

Permalink
Bug 1633935 - P7 refactor bitmap test, r=jgilbert
Browse files Browse the repository at this point in the history
Given options in createImageBitmap is not supported, the test coverage is the same.

Depends on D76973

Differential Revision: https://phabricator.services.mozilla.com/D77749
  • Loading branch information
JuniorHsu committed Jun 30, 2020
1 parent 056c234 commit 87f9633
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,11 @@ function runImageBitmapTestInternal(bitmaps, alphaVal, internalFormat, pixelForm

function runImageBitmapTest(source, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D)
{
var p1 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "premultiply"})
.then(cur => { cur.flipY = false; cur.premultiply = true; return cur; });
var p2 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "none"})
.then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });
var p3 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "premultiply"})
.then(cur => { cur.flipY = true; cur.premultiply = true; return cur; });
var p4 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "none"})
.then(cur => { cur.flipY = true; cur.premultiply = false; return cur; });
return Promise.all([p1, p2, p3, p4])
.catch( () => {
testPassed("createImageBitmap with options may be rejected if it is not supported. Retrying without options.");
var p = createImageBitmap(source)
.then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });
return Promise.all([p]);
}).then( bitmaps => {
var p = createImageBitmap(source)
.then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });

return Promise.all([p])
.then( bitmaps => {
bufferedLogToConsole("All createImageBitmap promises are resolved");
runImageBitmapTestInternal(bitmaps, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D);
}, (e) => {
Expand Down

0 comments on commit 87f9633

Please sign in to comment.