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

Side by Side Diff: LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html

Issue 22408008: Allow creation of ImageBitmaps from WebGL canvases. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-createImageBitmap-webgl-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../js/resources/js-test-pre.js"></script>
4 </head>
5 <body onload="start();">
6 <script>
7 window.jsTestIsAsync = true;
8
9 var canvas = document.createElement("canvas");
10 canvas.width = 200;
11 canvas.height = 200;
12 var ctx = canvas.getContext("2d");
13 function shouldBeGreen(x, y) {
14 d = ctx.getImageData(x, y, 1, 1).data;
15 shouldBeTrue("d[0] == 0");
16 shouldBeTrue("d[1] == 255");
17 shouldBeTrue("d[2] == 0");
18 shouldBeTrue("d[3] == 255");
19 }
20
21 function start() {
22 var aCanvas = document.createElement("canvas");
23 aCanvas.width = 200;
24 aCanvas.height = 200;
25 var gl = aCanvas.getContext("webgl");
26 gl.clearColor(0.0, 1.0, 0.0, 1.0);
27 gl.clear(gl.COLOR_BUFFER_BIT);
28
29 createImageBitmap(aCanvas).then(function (imageBitmap) {
30 ctx.drawImage(imageBitmap, 0, 0);
31 shouldBeGreen(50, 50);
32 shouldBeGreen(150, 150);
33 finishJSTest();
34 }, function() {
35 testFailed("Promise was rejected.");
36 finishJSTest();
37 });
38 }
39 </script>
40 <script src="../js/resources/js-test-post.js"></script>
41 </body>
42 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-createImageBitmap-webgl-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698