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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferFromImageBitmap-drawImage.html

Issue 2267653005: Resolving drawImage issue with canvases that contain bitmap images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving the conflict with DCHECK on canvas type. Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('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 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script>
5
6 function testCanvas_0f0(ctx) {
7 var colorData = ctx.getImageData(50, 50, 1, 1).data;
8 assert_equals(colorData[0], 0);
9 assert_equals(colorData[1], 255);
10 assert_equals(colorData[2], 0);
11 assert_equals(colorData[3], 255);
12 }
13
14 function testDrawCanvasWithImageBitamp(image) {
15 var dstCanvas = document.createElement('canvas');
16 dstCanvas.width = dstCanvas.height = 100;
17 var dstCtx = dstCanvas.getContext('bitmaprenderer');
18 dstCtx.transferFromImageBitmap(image);
19
20 var myCanvas = document.createElement('canvas');
21 myCanvas.width = myCanvas.height = 100;
22 var myCtx = myCanvas.getContext('2d');
23 myCtx.drawImage(dstCanvas, 10, 10);
24 testCanvas_0f0(myCtx);
25 }
26
27 promise_test(function() {
28 var canvas = document.createElement('canvas');
29 canvas.width = canvas.height = 100;
30 var ctx = canvas.getContext('2d');
31 ctx.fillStyle = '#0f0';
32 ctx.fillRect(0, 0, 100, 100);
33 testCanvas_0f0(ctx);
34
35 return createImageBitmap(canvas).then(testDrawCanvasWithImageBitamp);
36 }, 'testDrawCanvasWithImageBitamp should not return any error');
37
38 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698