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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-canvas.html

Issue 1809603004: Use ImageDecoder for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: halfRed-->darkRed Created 4 years, 9 months 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;
11 11
12 var wtu = WebGLTestUtils; 12 var wtu = WebGLTestUtils;
13 var tiu = TexImageUtils; 13 var tiu = TexImageUtils;
14 var gl = null; 14 var gl = null;
15 var internalFormat = "RGBA"; 15 var internalFormat = "RGBA";
16 var pixelFormat = "RGBA"; 16 var pixelFormat = "RGBA";
17 var pixelType = "UNSIGNED_BYTE"; 17 var pixelType = "UNSIGNED_BYTE";
18 var redColor = [255, 0, 0]; 18 var redColor = [255, 0, 0];
19 var greenColor = [0, 255, 0]; 19 var greenColor = [0, 255, 0];
20 var blackColor = [0, 0, 0]; 20 var blackColor = [0, 0, 0];
21 var halfRed = [128, 0, 0]; 21 var darkRed = [26, 0, 0];
22 var halfGreen = [0, 128, 0]; 22 var darkGreen = [0, 26, 0];
23 23
24 function promiseRejected() 24 function promiseRejected()
25 { 25 {
26 document.getElementById("results").innerHTML = "Promise <span style='color:r ed'>REJECTED</span>"; 26 document.getElementById("results").innerHTML = "Promise <span style='color:r ed'>REJECTED</span>";
27 } 27 }
28 28
29 function pass() 29 function pass()
30 { 30 {
31 document.getElementById("results").innerHTML = "Test <span style='color:gree n'>PASSED</span>"; 31 document.getElementById("results").innerHTML = "Test <span style='color:gree n'>PASSED</span>";
32 } 32 }
33 33
34 function setCanvasToRedGreen(ctx) { 34 function setCanvasToRedGreen(ctx) {
35 ctx.canvas.width = 2; 35 ctx.canvas.width = 2;
36 ctx.canvas.height = 2; 36 ctx.canvas.height = 2;
37 var width = ctx.canvas.width; 37 var width = ctx.canvas.width;
38 var halfWidth = Math.floor(width / 2); 38 var halfWidth = Math.floor(width / 2);
39 var height = ctx.canvas.height; 39 var height = ctx.canvas.height;
40 var halfHeight = Math.floor(height / 2); 40 var halfHeight = Math.floor(height / 2);
41 ctx.fillStyle = "rgba(255, 0, 0, 1)"; 41 ctx.fillStyle = "rgba(255, 0, 0, 1)";
42 ctx.fillRect(0, 0, halfWidth, halfHeight); 42 ctx.fillRect(0, 0, halfWidth, halfHeight);
43 ctx.fillStyle = "rgba(255, 0, 0, 0.5)"; 43 ctx.fillStyle = "rgba(255, 0, 0, 0.1)";
44 ctx.fillRect(halfWidth, 0, halfWidth, halfHeight); 44 ctx.fillRect(halfWidth, 0, halfWidth, halfHeight);
45 ctx.fillStyle = "rgba(0, 255, 0, 1)"; 45 ctx.fillStyle = "rgba(0, 255, 0, 1)";
46 ctx.fillRect(0, halfHeight, halfWidth, halfHeight); 46 ctx.fillRect(0, halfHeight, halfWidth, halfHeight);
47 ctx.fillStyle = "rgba(0, 255, 0, 0.5)"; 47 ctx.fillStyle = "rgba(0, 255, 0, 0.1)";
48 ctx.fillRect(halfWidth, halfHeight, halfWidth, halfHeight); 48 ctx.fillRect(halfWidth, halfHeight, halfWidth, halfHeight);
49 } 49 }
50 50
51 function generateTest() 51 function generateTest()
52 { 52 {
53 var bitmaps = []; 53 var bitmaps = [];
54 54
55 var canvas = document.getElementById("example"); 55 var canvas = document.getElementById("example");
56 gl = canvas.getContext("webgl"); 56 gl = canvas.getContext("webgl");
57 57
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 generateTest(); 93 generateTest();
94 } 94 }
95 </script> 95 </script>
96 </head> 96 </head>
97 <body onload="init()"> 97 <body onload="init()">
98 <canvas id="texcanvas" width="2" height="2"></canvas> 98 <canvas id="texcanvas" width="2" height="2"></canvas>
99 <canvas id="example" width="32" height="32"></canvas> 99 <canvas id="example" width="32" height="32"></canvas>
100 <div id="results">Test <span style="color:red">FAILED</span></div> 100 <div id="results">Test <span style="color:red">FAILED</span></div>
101 </body> 101 </body>
102 </html> 102 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698