OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INVALIDATION_REGION_H_ | 5 #ifndef CC_BASE_INVALIDATION_REGION_H_ |
6 #define CC_BASE_INVALIDATION_REGION_H_ | 6 #define CC_BASE_INVALIDATION_REGION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/base_export.h" |
11 #include "cc/base/region.h" | 11 #include "cc/base/region.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 // This class behaves similarly to Region, but it may have false positives. That | 16 // This class behaves similarly to Region, but it may have false positives. That |
17 // is, InvalidationRegion can be simplified to encompass a larger area than the | 17 // is, InvalidationRegion can be simplified to encompass a larger area than the |
18 // collection of rects unioned. | 18 // collection of rects unioned. |
19 class CC_EXPORT InvalidationRegion { | 19 class CC_BASE_EXPORT InvalidationRegion { |
20 public: | 20 public: |
21 InvalidationRegion(); | 21 InvalidationRegion(); |
22 ~InvalidationRegion(); | 22 ~InvalidationRegion(); |
23 | 23 |
24 void Swap(Region* region); | 24 void Swap(Region* region); |
25 void Clear(); | 25 void Clear(); |
26 void Union(const gfx::Rect& rect); | 26 void Union(const gfx::Rect& rect); |
27 bool IsEmpty() const { return pending_rects_.empty() && region_.IsEmpty(); } | 27 bool IsEmpty() const { return pending_rects_.empty() && region_.IsEmpty(); } |
28 | 28 |
29 private: | 29 private: |
30 void FinalizePendingRects(); | 30 void FinalizePendingRects(); |
31 | 31 |
32 Region region_; | 32 Region region_; |
33 std::vector<gfx::Rect> pending_rects_; | 33 std::vector<gfx::Rect> pending_rects_; |
34 }; | 34 }; |
35 | 35 |
36 } // namespace cc | 36 } // namespace cc |
37 | 37 |
38 #endif // CC_BASE_INVALIDATION_REGION_H_ | 38 #endif // CC_BASE_INVALIDATION_REGION_H_ |
OLD | NEW |