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

Unified Diff: LayoutTests/canvas/state-stack.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: Source code adjustements + [WIP] layout test problems 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/canvas/state-stack.html
diff --git a/LayoutTests/canvas/state-stack.html b/LayoutTests/canvas/state-stack.html
new file mode 100644
index 0000000000000000000000000000000000000000..710b897e832756da2ea3595c0e720ffc401ddd04
--- /dev/null
+++ b/LayoutTests/canvas/state-stack.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas.drawImage with narrow destination.</title>
zino 2014/09/03 10:50:17 nit: This should be in <head></head>.
Sergey 2014/09/11 12:58:52 Layout test re-written.
+<html>
+ <body>
+ <canvas id="myCanvas" width="100" height="100"></canvas>
+ <script>
+ var canvas = document.getElementById('myCanvas');
+ var context = canvas.getContext('2d');
+ var width = 100, height = 100;
+ var x1 = 0, y1 = 0, w = width, h = height;
+
+ function draw() {
+ context.restore();
+ context.clearRect(0, 0, width, height);
+ context.beginPath();
+ context.rect(x1, y1, w, h);
+ context.fillStyle = 'blue';
+ context.fill();
+ x1+=5;
+ y1+=5;
+ w-=10;
+ h-=10;
+
+ context.save();
+ context.beginPath();
+ context.rect(200, 200, 400, 400);
+ context.clip();
+
+ if (w > 0) {
+ setTimeout(draw, 1);
+ } else {
+ finishTest('PASS');
+ }
+ }
+
+ context.beginPath();
+ context.rect(0, 0, 800, 800);
+ context.fillStyle = 'blue';
+ context.fill();
+ context.save();
+ draw();
+ function finishTest(output) {
+ document.write(output);
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.notifyDone();
+ }
+ }
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/canvas/state-stack-expected.txt » ('j') | Source/platform/graphics/RecordingImageBufferSurface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698