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

Side by Side Diff: third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html

Issue 1834843002: [WIP] Plumbing for paint Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: \o/\o/ Created 4 years, 8 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 <head>
4 <script src="../resources/run-after-layout-and-paint.js"></script>
5 <style>
6 #output {
7 width: 200px;
8 height: 400px;
9 background-image: paint(paths);
10 }
11 </style>
12 </head>
13 <body>
14 <div id="output"></div>
15
16 <script id="code" type="text/worklet">
17 registerPaint('paths', class {
18 paint(ctx) {
19 ctx.beginPath();
20 ctx.lineWidth = '10';
21 ctx.strokeStyle = 'green';
22 ctx.lineJoin = 'round';
23 ctx.moveTo(15, 15);
24 ctx.lineTo(135, 15);
25 ctx.lineTo(70, 170);
26 ctx.closePath();
27 ctx.stroke();
28
29 var path1 = new Path2D();
30 path1.moveTo(150, 25);
31 path1.bezierCurveTo(10, 150, 10, 300, 100, 200);
32 ctx.strokeStyle = 'purple';
33 ctx.setLineDash([ 10, 5 ]);
34 ctx.stroke(path1);
35
36 ctx.fillStyle = 'red';
37 ctx.beginPath()
38 ctx.arc(75, 325, 50, 0, Math.PI * 2, true);
39 ctx.arc(75, 325, 20, 0, Math.PI * 2, true);
40 ctx.fill("evenodd");
41 }
42 });
43 </script>
44
45 <script>
46 if (window.testRunner) {
47 testRunner.waitUntilDone();
48 }
49
50 var blob = new Blob([document.getElementById('code').textContent]);
51 paintWorklet.import(URL.createObjectURL(blob)).then(function() {
52 runAfterLayoutAndPaint(function() {
53 if (window.testRunner) {
54 testRunner.notifyDone();
55 }
56 });
57 });
58 </script>
59 </body>
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698