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

Side by Side Diff: ui/gfx/quad_f.h

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/range/range.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef UI_GFX_QUAD_F_H_ 5 #ifndef UI_GFX_QUAD_F_H_
6 #define UI_GFX_QUAD_F_H_ 6 #define UI_GFX_QUAD_F_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <string> 10 #include <string>
11 11
12 #include "ui/gfx/gfx_export.h" 12 #include "ui/gfx/gfx_export.h"
13 #include "ui/gfx/point_f.h" 13 #include "ui/gfx/point_f.h"
14 #include "ui/gfx/rect_f.h" 14 #include "ui/gfx/rect_f.h"
15 15
16 namespace gfx { 16 namespace gfx {
17 17
18 // A Quad is defined by four corners, allowing it to have edges that are not 18 // A Quad is defined by four corners, allowing it to have edges that are not
19 // axis-aligned, unlike a Rect. 19 // axis-aligned, unlike a Rect.
20 class UI_EXPORT QuadF { 20 class GFX_EXPORT QuadF {
21 public: 21 public:
22 QuadF() {} 22 QuadF() {}
23 QuadF(const PointF& p1, const PointF& p2, const PointF& p3, const PointF& p4) 23 QuadF(const PointF& p1, const PointF& p2, const PointF& p3, const PointF& p4)
24 : p1_(p1), 24 : p1_(p1),
25 p2_(p2), 25 p2_(p2),
26 p3_(p3), 26 p3_(p3),
27 p4_(p4) {} 27 p4_(p4) {}
28 28
29 explicit QuadF(const RectF& rect) 29 explicit QuadF(const RectF& rect)
30 : p1_(rect.x(), rect.y()), 30 : p1_(rect.x(), rect.y()),
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return 92 return
93 lhs.p1() == rhs.p1() && lhs.p2() == rhs.p2() && 93 lhs.p1() == rhs.p1() && lhs.p2() == rhs.p2() &&
94 lhs.p3() == rhs.p3() && lhs.p4() == rhs.p4(); 94 lhs.p3() == rhs.p3() && lhs.p4() == rhs.p4();
95 } 95 }
96 96
97 inline bool operator!=(const QuadF& lhs, const QuadF& rhs) { 97 inline bool operator!=(const QuadF& lhs, const QuadF& rhs) {
98 return !(lhs == rhs); 98 return !(lhs == rhs);
99 } 99 }
100 100
101 // Add a vector to a quad, offseting each point in the quad by the vector. 101 // Add a vector to a quad, offseting each point in the quad by the vector.
102 UI_EXPORT QuadF operator+(const QuadF& lhs, const Vector2dF& rhs); 102 GFX_EXPORT QuadF operator+(const QuadF& lhs, const Vector2dF& rhs);
103 // Subtract a vector from a quad, offseting each point in the quad by the 103 // Subtract a vector from a quad, offseting each point in the quad by the
104 // inverse of the vector. 104 // inverse of the vector.
105 UI_EXPORT QuadF operator-(const QuadF& lhs, const Vector2dF& rhs); 105 GFX_EXPORT QuadF operator-(const QuadF& lhs, const Vector2dF& rhs);
106 106
107 } // namespace gfx 107 } // namespace gfx
108 108
109 #endif // UI_GFX_QUAD_F_H_ 109 #endif // UI_GFX_QUAD_F_H_
OLDNEW
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/range/range.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698