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

Side by Side Diff: cc/region.h

Issue 11368156: cc: Expose clear and swap on Region (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 1 month 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 | « cc/occlusion_tracker.cc ('k') | cc/region.cc » ('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 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
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_
OLDNEW
« no previous file with comments | « cc/occlusion_tracker.cc ('k') | cc/region.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698