Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1111)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/texImage-imageBitmap-transferable.html

Issue 2522693002: Color correct ImageBitmap(HTMLImageElement*) constructor (Closed)
Patch Set: Addressing comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="./resources/webgl-test-utils-full.js"></script> 4 <script src="./resources/webgl-test-utils-full.js"></script>
5 <script src="./resources/tex-image-and-sub-image-utils.js"></script> 5 <script src="./resources/tex-image-and-sub-image-utils.js"></script>
6 <script src="./resources/tex-image-and-sub-image-image-bitmap-utils.js"></script > 6 <script src="./resources/tex-image-and-sub-image-image-bitmap-utils.js"></script >
7 <script src="../../../resources/js-test.js"></script> 7 <script src="../../../resources/js-test.js"></script>
8 <script> 8 <script>
9 9
10 window.jsTestIsAsync = true; 10 window.jsTestIsAsync = true;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 gl = canvas.getContext("webgl"); 53 gl = canvas.getContext("webgl");
54 54
55 gl.clearColor(0,0,0,1); 55 gl.clearColor(0,0,0,1);
56 gl.clearDepth(1); 56 gl.clearDepth(1);
57 57
58 // There is an existing layout test fast/canvas/canvas-ImageBitmap-transfera ble.html 58 // There is an existing layout test fast/canvas/canvas-ImageBitmap-transfera ble.html
59 // which tests the transferable logic for ImageBitmap with default options. 59 // which tests the transferable logic for ImageBitmap with default options.
60 // To test ImageBitmap with non-default options such as premultiplyAlpha=non e, 60 // To test ImageBitmap with non-default options such as premultiplyAlpha=non e,
61 // we need to use WebGL for testing because normal 2D canvas cannot tell the difference 61 // we need to use WebGL for testing because normal 2D canvas cannot tell the difference
62 // between a premultiplied/unpremultiplied ImageBitmap. 62 // between a premultiplied/unpremultiplied ImageBitmap.
63 createImageBitmap(image, {imageOrientation: "flipY", premultiplyAlpha: "none "}).then(function(imageBitmap) { 63 createImageBitmap(image, {imageOrientation: "flipY", premultiplyAlpha: "none ", colorSpaceConversion: "none"}).then(function(imageBitmap) {
64 var replyPromise = postToWorker(imageBitmap, [imageBitmap]); 64 var replyPromise = postToWorker(imageBitmap, [imageBitmap]);
65 replyPromise.then(reply => { 65 replyPromise.then(reply => {
66 var retVal = {testPassed: true, alpha: 0.5}; 66 var retVal = {testPassed: true, alpha: 0.5};
67 var program = tiu.setupTexturedQuad(gl, internalFormat); 67 var program = tiu.setupTexturedQuad(gl, internalFormat);
68 runOneIteration(false, gl.TEXTURE_2D, program, reply, true, false, r etVal); 68 runOneIteration(false, gl.TEXTURE_2D, program, reply, true, false, r etVal);
69 runOneIteration(true, gl.TEXTURE_2D, program, reply, true, false, re tVal); 69 runOneIteration(true, gl.TEXTURE_2D, program, reply, true, false, re tVal);
70 program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat); 70 program = tiu.setupTexturedQuadWithCubeMap(gl, internalFormat);
71 runOneIteration(false, gl.TEXTURE_CUBE_MAP, program, reply, true, fa lse, retVal); 71 runOneIteration(false, gl.TEXTURE_CUBE_MAP, program, reply, true, fa lse, retVal);
72 runOneIteration(true, gl.TEXTURE_CUBE_MAP, program, reply, true, fal se, retVal); 72 runOneIteration(true, gl.TEXTURE_CUBE_MAP, program, reply, true, fal se, retVal);
73 if (retVal.testPassed) 73 if (retVal.testPassed)
(...skipping 18 matching lines...) Expand all
92 image.src = "resources/red-green-semi-transparent.png"; 92 image.src = "resources/red-green-semi-transparent.png";
93 } 93 }
94 </script> 94 </script>
95 </head> 95 </head>
96 <body onload="init()"> 96 <body onload="init()">
97 <canvas id="texcanvas" width="2" height="2"></canvas> 97 <canvas id="texcanvas" width="2" height="2"></canvas>
98 <canvas id="example" width="32" height="32"></canvas> 98 <canvas id="example" width="32" height="32"></canvas>
99 <div id="results">Test <span style="color:red">FAILED</span></div> 99 <div id="results">Test <span style="color:red">FAILED</span></div>
100 </body> 100 </body>
101 </html> 101 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698