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

Unified Diff: LayoutTests/fast/canvas/canvas-unbalanced-save.html

Issue 661763003: Ensure canvas state is preserved when 2d canvas falls out of display list mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixup Created 6 years, 2 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-unbalanced-save-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-unbalanced-save.html
diff --git a/LayoutTests/fast/canvas/canvas-unbalanced-save.html b/LayoutTests/fast/canvas/canvas-unbalanced-save.html
new file mode 100644
index 0000000000000000000000000000000000000000..c942a4d2ac08bbd00ab0f55e43ab2a9d25570482
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-unbalanced-save.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script>
+var ctx;
+window.onload = function () {
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ }
+ ctx = document.getElementById('c').getContext('2d');
+ ctx.fillStyle = 'green';
+ ctx.fillRect(0, 0, 100, 100);
+ ctx.save();
+ ctx.translate(10, 0);
+ requestAnimationFrame(blueSquare);
+}
+
+function blueSquare() {
+ ctx.fillStyle = 'blue';
+ ctx.fillRect(0, 10, 80, 80);
+ requestAnimationFrame(redSquare);
+}
+
+function redSquare() {
+ ctx.fillStyle = 'red';
+ ctx.fillRect(10, 20, 60, 60);
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
+}
+</script>
+<p>The canvas below should contain green, blue and red nested squares, all centered with respect to each other.</p>
+<canvas id="c" width="100" height="100"></canvas>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-unbalanced-save-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698