-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interface and test for the transform (concatenate) method
Bug: 1140535 Change-Id: I12fc6011ef36a98af8a98c41031a7075b800ad59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2659355 Reviewed-by: Yi Xu <yiyix@chromium.org> Reviewed-by: Xida Chen <xidachen@chromium.org> Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Cr-Commit-Position: refs/heads/master@{#849613}
- Loading branch information
1 parent
a92fea0
commit 284cfb0
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
html/canvas/element/transformations/2d.transformation.transform.3d.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.transformation.transform.3d</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/html/canvas/resources/canvas-tests.js"></script> | ||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> | ||
<body class="show_output"> | ||
|
||
<h1>2d.transformation.transform.3d</h1> | ||
<p class="desc">transform() with 4x4 matrix concatenates properly</p> | ||
|
||
|
||
<p class="output">Actual output:</p> | ||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> | ||
|
||
<ul id="d"></ul> | ||
<script> | ||
var t = async_test("transform() with 4x4 matrix concatenates properly"); | ||
_addTest(function(canvas, ctx) { | ||
|
||
const transform = new DOMMatrix([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); | ||
ctx.transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); | ||
let canvasTransform = ctx.getTransform(); | ||
_assert(transform.toLocaleString() == canvasTransform.toLocaleString(), "transform.toLocaleString() == canvasTransform.toLocaleString()"); | ||
ctx.transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); | ||
canvasTransform = ctx.getTransform(); | ||
transform.multiplySelf(transform); | ||
_assert(transform.toLocaleString() == canvasTransform.toLocaleString(), "transform.toLocaleString() == canvasTransform.toLocaleString()"); | ||
|
||
|
||
}); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters