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_REGION_H_ | 5 #ifndef CC_REGION_H_ |
6 #define CC_REGION_H_ | 6 #define CC_REGION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "cc/cc_export.h" | 11 #include "cc/cc_export.h" |
12 #include "third_party/skia/include/core/SkRegion.h" | 12 #include "third_party/skia/include/core/SkRegion.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class CC_EXPORT Region { | 17 class CC_EXPORT Region { |
18 public: | 18 public: |
19 Region(); | 19 Region(); |
20 Region(const Region& region); | 20 Region(const Region& region); |
21 Region(gfx::Rect rect); | 21 Region(gfx::Rect rect); |
22 ~Region(); | 22 ~Region(); |
23 | 23 |
24 const Region& operator=(gfx::Rect rect); | 24 const Region& operator=(gfx::Rect rect); |
25 const Region& operator=(const Region& region); | 25 const Region& operator=(const Region& region); |
26 | 26 |
| 27 void Swap(Region& region); |
| 28 void Clear(); |
27 bool IsEmpty() const; | 29 bool IsEmpty() const; |
28 | 30 |
29 bool Contains(gfx::Point point) const; | 31 bool Contains(gfx::Point point) const; |
30 bool Contains(gfx::Rect rect) const; | 32 bool Contains(gfx::Rect rect) const; |
31 bool Contains(const Region& region) const; | 33 bool Contains(const Region& region) const; |
32 | 34 |
33 bool Intersects(gfx::Rect rect) const; | 35 bool Intersects(gfx::Rect rect) const; |
34 bool Intersects(const Region& region) const; | 36 bool Intersects(const Region& region) const; |
35 | 37 |
36 void Subtract(gfx::Rect rect); | 38 void Subtract(gfx::Rect rect); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 118 |
117 inline Region UnionRegions(const Region& a, gfx::Rect b) { | 119 inline Region UnionRegions(const Region& a, gfx::Rect b) { |
118 Region result = a; | 120 Region result = a; |
119 result.Union(b); | 121 result.Union(b); |
120 return result; | 122 return result; |
121 } | 123 } |
122 | 124 |
123 } // namespace cc | 125 } // namespace cc |
124 | 126 |
125 #endif // CC_REGION_H_ | 127 #endif // CC_REGION_H_ |
OLD | NEW |