diff options
author | xidachen <xidachen@chromium.org> | 2016-03-15 07:51:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-15 14:52:58 +0000 |
commit | 1e71ee33752db1b8817870cc25324ae40dbcd6d3 (patch) | |
tree | 4be173c6e2dc08bf135ee551dbb8a39dfb85ff49 /third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html | |
parent | 78c84b7a3c0440def42659d5866e357cc67c4ff8 (diff) | |
download | chromium_src-1e71ee33752db1b8817870cc25324ae40dbcd6d3.zip chromium_src-1e71ee33752db1b8817870cc25324ae40dbcd6d3.tar.gz chromium_src-1e71ee33752db1b8817870cc25324ae40dbcd6d3.tar.bz2 |
Add ColorspaceConversion in ImageBitmapOptions
This option is specifically for createImageBitmap from a Blob or a
HTMLImageElement. This CL adds support for this option, starting with
Blob. Layout tests are added to ensure the correctness.
BUG=592005
Review URL: https://codereview.chromium.org/1763043002
Cr-Commit-Position: refs/heads/master@{#381224}
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html index a3b109c..055cb09 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-blob.html @@ -21,7 +21,8 @@ var blackColor = [0, 0, 0]; var halfRed = [128, 0, 0]; var halfGreen = [0, 128, 0]; -var blob = null; +var blob1 = null; +var blob2 = null; function promiseRejected() { @@ -43,16 +44,19 @@ function generateTest() gl.clearColor(0,0,0,1); gl.clearDepth(1); - var p1 = createImageBitmap(blob).then(function(imageBitmap) { bitmaps.defaultOption = imageBitmap }); - var p2 = createImageBitmap(blob, {imageOrientation: "none", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap }); - var p3 = createImageBitmap(blob, {imageOrientation: "none", premultiplyAlpha: "default"}).then(function(imageBitmap) { bitmaps.noFlipYDefault = imageBitmap }); - var p4 = createImageBitmap(blob, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.noFlipYUnpremul = imageBitmap }); - var p5 = createImageBitmap(blob, {imageOrientation: "flipY", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.flipYPremul = imageBitmap }); - var p6 = createImageBitmap(blob, {imageOrientation: "flipY", premultiplyAlpha: "default"}).then(function(imageBitmap) { bitmaps.flipYDefault = imageBitmap }); - var p7 = createImageBitmap(blob, {imageOrientation: "flipY", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.flipYUnpremul = imageBitmap }); - Promise.all([p1, p2, p3, p4, p5, p6, p7]).then(function() { + var p1 = createImageBitmap(blob1).then(function(imageBitmap) { bitmaps.defaultOption = imageBitmap }); + var p2 = createImageBitmap(blob1, {imageOrientation: "none", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap }); + var p3 = createImageBitmap(blob1, {imageOrientation: "none", premultiplyAlpha: "default"}).then(function(imageBitmap) { bitmaps.noFlipYDefault = imageBitmap }); + var p4 = createImageBitmap(blob1, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.noFlipYUnpremul = imageBitmap }); + var p5 = createImageBitmap(blob1, {imageOrientation: "flipY", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.flipYPremul = imageBitmap }); + var p6 = createImageBitmap(blob1, {imageOrientation: "flipY", premultiplyAlpha: "default"}).then(function(imageBitmap) { bitmaps.flipYDefault = imageBitmap }); + var p7 = createImageBitmap(blob1, {imageOrientation: "flipY", premultiplyAlpha: "none"}).then(function(imageBitmap) { bitmaps.flipYUnpremul = imageBitmap }); + var p8 = createImageBitmap(blob2).then(function(imageBitmap) { bitmaps.colorspaceDef = imageBitmap }); + var p9 = createImageBitmap(blob2, {colorspaceConversion: "none"}).then(function(imageBitmap) { bitmaps.colorspaceNone = imageBitmap }); + var p10 = createImageBitmap(blob2, {colorspaceConversion: "default"}).then(function(imageBitmap) { bitmaps.colorspaceDefault = imageBitmap }); + Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]).then(function() { var alphaVal = 0.5; - var testPassed = runTest(bitmaps, alphaVal); + var testPassed = runTest(bitmaps, alphaVal, true); if (testPassed) pass(); finishJSTest(); @@ -68,13 +72,20 @@ function init() testRunner.overridePreference("WebKitWebGLEnabled", "1"); testRunner.dumpAsText(); } - var xhr = new XMLHttpRequest(); - xhr.open("GET", 'resources/red-green-semi-transparent.png'); - xhr.responseType = 'blob'; - xhr.send(); - xhr.onload = function() { - blob = xhr.response; - generateTest(); + var xhr1 = new XMLHttpRequest(); + xhr1.open("GET", 'resources/red-green-semi-transparent.png'); + xhr1.responseType = 'blob'; + xhr1.send(); + xhr1.onload = function() { + blob1 = xhr1.response; + var xhr2 = new XMLHttpRequest(); + xhr2.open("GET", 'resources/square-with-colorspin-profile.png'); + xhr2.responseType = 'blob'; + xhr2.send(); + xhr2.onload = function() { + blob2 = xhr2.response; + generateTest(); + } } } |