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

Side by Side Diff: cc/base/region.cc

Issue 185653013: [#8] Pass gfx::Point by const ref. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build errors on other platforms Created 6 years, 9 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 | « cc/base/region.h ('k') | cc/input/input_handler.h » ('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 #include "cc/base/region.h" 5 #include "cc/base/region.h"
6 #include "base/values.h" 6 #include "base/values.h"
7 7
8 namespace cc { 8 namespace cc {
9 9
10 Region::Region() { 10 Region::Region() {
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 bool Region::IsEmpty() const { 42 bool Region::IsEmpty() const {
43 return skregion_.isEmpty(); 43 return skregion_.isEmpty();
44 } 44 }
45 45
46 int Region::GetRegionComplexity() const { 46 int Region::GetRegionComplexity() const {
47 return skregion_.computeRegionComplexity(); 47 return skregion_.computeRegionComplexity();
48 } 48 }
49 49
50 bool Region::Contains(gfx::Point point) const { 50 bool Region::Contains(const gfx::Point& point) const {
51 return skregion_.contains(point.x(), point.y()); 51 return skregion_.contains(point.x(), point.y());
52 } 52 }
53 53
54 bool Region::Contains(const gfx::Rect& rect) const { 54 bool Region::Contains(const gfx::Rect& rect) const {
55 if (rect.IsEmpty()) 55 if (rect.IsEmpty())
56 return true; 56 return true;
57 return skregion_.contains(gfx::RectToSkIRect(rect)); 57 return skregion_.contains(gfx::RectToSkIRect(rect));
58 } 58 }
59 59
60 bool Region::Contains(const Region& region) const { 60 bool Region::Contains(const Region& region) const {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 Region::Iterator::Iterator(const Region& region) 126 Region::Iterator::Iterator(const Region& region)
127 : it_(region.skregion_) { 127 : it_(region.skregion_) {
128 } 128 }
129 129
130 Region::Iterator::~Iterator() { 130 Region::Iterator::~Iterator() {
131 } 131 }
132 132
133 } // namespace cc 133 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/region.h ('k') | cc/input/input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698