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

Unified Diff: LayoutTests/fast/canvas/canvas-state-stack-simple.html

Issue 501353002: Transfer canvas state to the next frame with noticable restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Release candidate Created 6 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/canvas-state-stack-simple.html
diff --git a/LayoutTests/fast/canvas/canvas-state-stack-simple.html b/LayoutTests/fast/canvas/canvas-state-stack-simple.html
new file mode 100644
index 0000000000000000000000000000000000000000..c186d9998c35946ff24503c623beb31e728f17b4
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-state-stack-simple.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
zino 2014/09/13 16:00:28 These tags are normally omitted. <html>, <head>, <
Sergey 2014/09/15 02:45:35 This is probably a recommendation, when you are go
zino 2014/09/15 09:51:03 I don't think the rule is related to "js-test" fra
+ <script>
+ var context;
+
+ window.onload = function() {
+ if (window.testRunner)
+ testRunner.waitUntilDone();
zino 2014/09/13 16:00:28 fix indentation? Either of 2 space and 4 space in
Sergey 2014/09/15 02:45:36 Done.
+ context = document.getElementById("c").getContext("2d");
zino 2014/09/13 16:00:28 "c" -> 'c' "2d" -> '2d' Some tests use double quo
Sergey 2014/09/15 02:45:36 Done.
+ context.scale(2,2);
zino 2014/09/13 16:00:28 fix spacing?
Sergey 2014/09/15 02:45:36 Here everything seems fine... Please, explain.
zino 2014/09/15 09:51:03 It is not important but it is better to have a con
+ context.beginPath();
+ context.rect(0,0,75,75);
+ context.clip();
+ context.fillStyle = 'red';
+ context.fillRect(0, 0, 30, 30);
+ context.fillRect(50, 50, 30, 30);
+ context.save();
+ context.scale(0.5,0.5);
+ context.beginPath();
+ context.rect(0,0,300,300);
Justin Novosad 2014/09/12 14:54:35 This test would be more interesting if you used a
zino 2014/09/13 16:00:28 good point.
Sergey 2014/09/15 02:45:36 Done.
+ context.clip();
zino 2014/09/13 16:00:28 Also, I think it is better to add context.fillRect
Sergey 2014/09/15 02:45:36 May be that would be excessive, wouldn't it?
+ requestAnimationFrame(drawSecondFrame);
+ }
+
+ function drawSecondFrame() {
+ context.restore();
+ context.fillStyle = 'green';
+ context.fillRect(0, 0, 30, 30);
+ context.fillRect(50, 50, 30, 30);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+ </script>
+</head>
+<body>
+ <p>Two green squares of different sizes should appear below</p>
+ <canvas id="c" width=300 height=300></canvas>
zino 2014/09/13 16:00:28 width="300" height="300"
Sergey 2014/09/15 02:45:36 Done.
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698