OLD | NEW |
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 CC_BASE_REGION_H_ | 5 #ifndef CC_BASE_REGION_H_ |
6 #define CC_BASE_REGION_H_ | 6 #define CC_BASE_REGION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 ~Region(); | 28 ~Region(); |
29 | 29 |
30 const Region& operator=(const gfx::Rect& rect); | 30 const Region& operator=(const gfx::Rect& rect); |
31 const Region& operator=(const Region& region); | 31 const Region& operator=(const Region& region); |
32 | 32 |
33 void Swap(Region* region); | 33 void Swap(Region* region); |
34 void Clear(); | 34 void Clear(); |
35 bool IsEmpty() const; | 35 bool IsEmpty() const; |
36 int GetRegionComplexity() const; | 36 int GetRegionComplexity() const; |
37 | 37 |
38 bool Contains(gfx::Point point) const; | 38 bool Contains(const gfx::Point& point) const; |
39 bool Contains(const gfx::Rect& rect) const; | 39 bool Contains(const gfx::Rect& rect) const; |
40 bool Contains(const Region& region) const; | 40 bool Contains(const Region& region) const; |
41 | 41 |
42 bool Intersects(const gfx::Rect& rect) const; | 42 bool Intersects(const gfx::Rect& rect) const; |
43 bool Intersects(const Region& region) const; | 43 bool Intersects(const Region& region) const; |
44 | 44 |
45 void Subtract(const gfx::Rect& rect); | 45 void Subtract(const gfx::Rect& rect); |
46 void Subtract(const Region& region); | 46 void Subtract(const Region& region); |
47 void Union(const gfx::Rect& rect); | 47 void Union(const gfx::Rect& rect); |
48 void Union(const Region& region); | 48 void Union(const Region& region); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 inline Region UnionRegions(const Region& a, const gfx::Rect& b) { | 127 inline Region UnionRegions(const Region& a, const gfx::Rect& b) { |
128 Region result = a; | 128 Region result = a; |
129 result.Union(b); | 129 result.Union(b); |
130 return result; | 130 return result; |
131 } | 131 } |
132 | 132 |
133 } // namespace cc | 133 } // namespace cc |
134 | 134 |
135 #endif // CC_BASE_REGION_H_ | 135 #endif // CC_BASE_REGION_H_ |
OLD | NEW |