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

Side by Side Diff: cc/base/invalidation_region.h

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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
« no previous file with comments | « no previous file | cc/base/invalidation_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 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 "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/base/region.h" 9 #include "cc/base/region.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 // This class behaves similarly to Region, but it may have false positives. That 14 // This class behaves similarly to Region, but it may have false positives. That
15 // is, InvalidationRegion can be simplified to encompass a larger area than the 15 // is, InvalidationRegion can be simplified to encompass a larger area than the
16 // collection of rects unioned. 16 // collection of rects unioned.
17 class CC_EXPORT InvalidationRegion { 17 class CC_EXPORT InvalidationRegion {
18 public: 18 public:
19 InvalidationRegion(); 19 InvalidationRegion();
20 ~InvalidationRegion(); 20 ~InvalidationRegion();
21 21
22 void Swap(Region* region); 22 void Swap(Region* region);
23 void Clear(); 23 void Clear();
24 void Union(gfx::Rect rect); 24 void Union(const gfx::Rect& rect);
25 bool IsEmpty() const { return region_.IsEmpty(); } 25 bool IsEmpty() const { return region_.IsEmpty(); }
26 26
27 private: 27 private:
28 void SimplifyIfNeeded(); 28 void SimplifyIfNeeded();
29 29
30 Region region_; 30 Region region_;
31 }; 31 };
32 32
33 } // namespace cc 33 } // namespace cc
34 34
35 #endif // CC_BASE_INVALIDATION_REGION_H_ 35 #endif // CC_BASE_INVALIDATION_REGION_H_
OLDNEW
« no previous file with comments | « no previous file | cc/base/invalidation_region.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698