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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-createImageBitmap-webgl-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html
diff --git a/LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html b/LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html
new file mode 100644
index 0000000000000000000000000000000000000000..50a5b0e495e15eab07a9683cb44df2a0f04cba7e
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-createImageBitmap-webgl.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="start();">
+<script>
+ window.jsTestIsAsync = true;
+
+ var canvas = document.createElement("canvas");
+ canvas.width = 200;
+ canvas.height = 200;
+ var ctx = canvas.getContext("2d");
+ function shouldBeGreen(x, y) {
+ d = ctx.getImageData(x, y, 1, 1).data;
+ shouldBeTrue("d[0] == 0");
+ shouldBeTrue("d[1] == 255");
+ shouldBeTrue("d[2] == 0");
+ shouldBeTrue("d[3] == 255");
+ }
+
+ function start() {
+ var aCanvas = document.createElement("canvas");
+ aCanvas.width = 200;
+ aCanvas.height = 200;
+ var gl = aCanvas.getContext("webgl");
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ createImageBitmap(aCanvas).then(function (imageBitmap) {
+ ctx.drawImage(imageBitmap, 0, 0);
+ shouldBeGreen(50, 50);
+ shouldBeGreen(150, 150);
+ finishJSTest();
+ }, function() {
+ testFailed("Promise was rejected.");
+ finishJSTest();
+ });
+ }
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
« 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