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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-pattern-in-worker-expected.html

Issue 1919363002: Add createGradient and createPattern to OffscreenCanvas2D in worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ScriptState Created 4 years, 7 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <canvas id ='output' width='150' height='150'></canvas>
5 <script>
6 var aCanvas = document.getElementById('output');
7 var ctx = aCanvas.getContext('2d');
8
9 var patternCanvas = document.createElement('canvas');
10 patternCanvas.width = 30;
11 patternCanvas.height = 30;
12 var patternCtx = patternCanvas.getContext('2d');
13 patternCtx.fillStyle = '#f00';
14 patternCtx.fillRect(0, 0, 15, 15);
15 patternCtx.fillStyle = '#0f0';
16 patternCtx.fillRect(15, 0, 15, 15);
17 patternCtx.fillStyle = '#00f';
18 patternCtx.fillRect(0, 15, 15, 15);
19 patternCtx.fillStyle = "#ff0";
20 patternCtx.fillRect(15, 15, 15, 15);
21
22 var myPattern = ctx.createPattern(patternCanvas, 'repeat');
23 ctx.fillStyle = myPattern;
24 ctx.fillRect(0, 0, aCanvas.width, aCanvas.height);
25 </script>
26 </body>
27 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698