diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 17:01:24 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 17:01:24 +0000 |
commit | 38b6f04314682f2db1105dd6ffafb138204200f4 (patch) | |
tree | 74944c5ac68827aafdb46279596b9bfe24c53749 /ui/ui_unittests.gypi | |
parent | 2e6c6fc23a88c24a4760cbe62334f8f4ea661c4f (diff) | |
download | chromium_src-38b6f04314682f2db1105dd6ffafb138204200f4.zip chromium_src-38b6f04314682f2db1105dd6ffafb138204200f4.tar.gz chromium_src-38b6f04314682f2db1105dd6ffafb138204200f4.tar.bz2 |
ui: Create the gfx::QuadF class.
This class is composed of four points representing its corners. It does not
have to be axis-aligned, unlike a rectangle. The class supports the following
operations:
IsRectilinear()
- True if the quad is an axis-aligned rectangle.
IsCounterClockwise()
- True if the points of the quad are in counter-clockwise order.
Contains(Point)
- True if Point is inside the quad or on its boundary.
BoundingBox()
- A Rectangle whose edges are defined by the four points of the quad.
Scale()
- Scales each point on the quad by the given scale factors.
operator+/-
- Moves each point in the quad by the given offset.
The operations on this class are inspired by, but not copied from, the
FloatQuad class in WebCore. I've written my own implementation to match those
in WebCore for each of them, with exception of IsRectilinear() as I also
wrote the current method in WebCore.
Tests:
ui_unittests:QuadTest.Construction
ui_unittests:QuadTest.AddingVectors
ui_unittests:QuadTest.IsRectilinear
ui_unittests:QuadTest.IsCounterClockwise
ui_unittests:QuadTest.BoundingBox
ui_unittests:QuadTest.ContainsPoint
ui_unittests:QuadTest.Scale
BUG=147395
R=sky,pkasting
Review URL: https://codereview.chromium.org/11369043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/ui_unittests.gypi')
-rw-r--r-- | ui/ui_unittests.gypi | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi index 6f20e42..1f405e7 100644 --- a/ui/ui_unittests.gypi +++ b/ui/ui_unittests.gypi @@ -82,6 +82,7 @@ 'gfx/insets_unittest.cc', 'gfx/point_unittest.cc', 'gfx/point3_unittest.cc', + 'gfx/quad_unittest.cc', 'gfx/rect_unittest.cc', 'gfx/safe_integer_conversions_unittest.cc', 'gfx/screen_unittest.cc', |