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

Side by Side Diff: cc/test/geometry_test_utils.cc

Issue 11644008: Migrate from MathUtil::inverse() to gfx::Transform::GetInverse() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved uninvertible matrix identity-initialization into gfx::Transform Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/geometry_test_utils.h" 5 #include "cc/test/geometry_test_utils.h"
6 6
7 #include "base/logging.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa trix.h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa trix.h"
9 #include "ui/gfx/transform.h" 10 #include "ui/gfx/transform.h"
10 11
11 namespace cc { 12 namespace cc {
12 13
13 // NOTE: even though transform data types use double precision, we only check 14 // NOTE: even though transform data types use double precision, we only check
14 // for equality within single-precision error bounds because many transforms 15 // for equality within single-precision error bounds because many transforms
15 // originate from single-precision data types such as quads/rects/etc. 16 // originate from single-precision data types such as quads/rects/etc.
16 17
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 2), (actual).matrix().getDo uble(0, 2)); 50 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 2), (actual).matrix().getDo uble(0, 2));
50 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 2), (actual).matrix().getDo uble(1, 2)); 51 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 2), (actual).matrix().getDo uble(1, 2));
51 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 2), (actual).matrix().getDo uble(2, 2)); 52 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 2), (actual).matrix().getDo uble(2, 2));
52 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 2), (actual).matrix().getDo uble(3, 2)); 53 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 2), (actual).matrix().getDo uble(3, 2));
53 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 3), (actual).matrix().getDo uble(0, 3)); 54 EXPECT_FLOAT_EQ((expected).matrix().getDouble(0, 3), (actual).matrix().getDo uble(0, 3));
54 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 3), (actual).matrix().getDo uble(1, 3)); 55 EXPECT_FLOAT_EQ((expected).matrix().getDouble(1, 3), (actual).matrix().getDo uble(1, 3));
55 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 3), (actual).matrix().getDo uble(2, 3)); 56 EXPECT_FLOAT_EQ((expected).matrix().getDouble(2, 3), (actual).matrix().getDo uble(2, 3));
56 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 3), (actual).matrix().getDo uble(3, 3)); 57 EXPECT_FLOAT_EQ((expected).matrix().getDouble(3, 3), (actual).matrix().getDo uble(3, 3));
57 } 58 }
58 59
60 gfx::Transform inverse(const gfx::Transform& transform)
61 {
62 gfx::Transform result;
danakj 2013/01/04 21:56:07 SkipInitialization?
63 bool invertedSuccessfully = transform.GetInverse(&result);
64 DCHECK(invertedSuccessfully);
65 return result;
66 }
67
59 } // namespace cc 68 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698