diff options
author | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 22:09:05 +0000 |
---|---|---|
committer | wjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 22:09:05 +0000 |
commit | 6bb8b6cf1266334cafc39847abb06c9f7c35060c (patch) | |
tree | eb6e160a051a7c252e0ebe75bde40a6f545af0c4 /ui | |
parent | a5acf97edfe6ac555e35ecc279e0c0d3e9f9ffc9 (diff) | |
download | chromium_src-6bb8b6cf1266334cafc39847abb06c9f7c35060c.zip chromium_src-6bb8b6cf1266334cafc39847abb06c9f7c35060c.tar.gz chromium_src-6bb8b6cf1266334cafc39847abb06c9f7c35060c.tar.bz2 |
Fix transform concatenation order in GetTransformRelativeTo, improve/add tests.
Add basic test of transform ordering.
Revised GetTransformRelativeTo to get concatenation correct.
Make numbers less coincidental in unit test.
BUG=none
TEST=views/view_unittest.cc
Review URL: http://codereview.chromium.org/7044025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/transform.cc | 10 | ||||
-rw-r--r-- | ui/gfx/transform.h | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc index c84d199..d335166 100644 --- a/ui/gfx/transform.cc +++ b/ui/gfx/transform.cc @@ -53,19 +53,15 @@ void Transform::ConcatScale(float x, float y) { } void Transform::ConcatTranslate(float x, float y) { - // Temporary workaround for bug in Skia. - ui::Transform t; - t.SetTranslate(x, y); - ConcatTransform(t); - // matrix_.postTranslate(SkFloatToScalar(x), SkFloatToScalar(y)); + matrix_.postTranslate(SkFloatToScalar(x), SkFloatToScalar(y)); } bool Transform::PreconcatTransform(const Transform& transform) { - return matrix_.setConcat(transform.matrix_, matrix_); + return matrix_.setConcat(matrix_, transform.matrix_); } bool Transform::ConcatTransform(const Transform& transform) { - return matrix_.setConcat(matrix_, transform.matrix_); + return matrix_.setConcat(transform.matrix_, matrix_); } bool Transform::HasChange() const { diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h index 1002e71..39b2159 100644 --- a/ui/gfx/transform.h +++ b/ui/gfx/transform.h @@ -57,12 +57,12 @@ class Transform { void ConcatTranslate(float x, float y); // Applies a transformation on the current transformation - // (i.e. 'this = transform * this;'). Returns true if the result can be + // (i.e. 'this = this * transform;'). Returns true if the result can be // represented. bool PreconcatTransform(const Transform& transform); // Applies a transformation on the current transformation - // (i.e. 'this = this * transform;'). Returns true if the result can be + // (i.e. 'this = transform * this;'). Returns true if the result can be // represented. bool ConcatTransform(const Transform& transform); |