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

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 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
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-state-stack-simple-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..41ff360b5ef6dfea6afaf4f2afe3c13ea0dc7add
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-state-stack-simple.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script>
+ var context;
+
+ window.onload = function() {
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+ context = document.getElementById('c').getContext('2d');
+ context.scale(2,2);
+ 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,5,5);
+ context.clip();
+ 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>
+<p>Two green squares of different sizes should appear below</p>
+<canvas id="c" width="300" height="300"></canvas>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-state-stack-simple-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698