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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-no-context.html

Issue 2550443002: Fix a minor issue in OffscreenCanvas.drawImage (Closed)
Patch Set: address 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.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 test(function() {
6 var offscreenCanvas = new OffscreenCanvas(100, 50);
7 var ctx = offscreenCanvas.getContext('2d');
8 ctx.fillStyle = "#0f0";
9 ctx.fillRect(0, 0, 100, 50);
10 // The default globalCompositeOperation is source-over, that that will
11 // draw nothing in the next drawImage call. So we have to change it to copy
12 // so that it will actually draw transparent black in the next drawImage
13 // call.
14 ctx.globalCompositeOperation = 'copy';
15
16 var offscreenCanvas2 = new OffscreenCanvas(100, 50);
17 ctx.drawImage(offscreenCanvas2, 0, 0);
18
19 var clr = ctx.getImageData(50, 25, 1, 1).data;
20 assert_array_equals(clr, [0, 0, 0, 0]);
21 }, 'Use OffscreenCanvas without a context as ImageSource should draw transparent black');
22 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698