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 #include "cc/base/region.h" | 5 #include "cc/base/region.h" |
6 #include "base/debug/trace_event_argument.h" | |
7 #include "base/values.h" | 6 #include "base/values.h" |
8 | 7 |
9 namespace cc { | 8 namespace cc { |
10 | 9 |
11 Region::Region() { | 10 Region::Region() { |
12 } | 11 } |
13 | 12 |
14 Region::Region(const Region& region) | 13 Region::Region(const Region& region) |
15 : skregion_(region.skregion_) { | 14 : skregion_(region.skregion_) { |
16 } | 15 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 for (Iterator it(*this); it.has_rect(); it.next()) { | 113 for (Iterator it(*this); it.has_rect(); it.next()) { |
115 gfx::Rect rect(it.rect()); | 114 gfx::Rect rect(it.rect()); |
116 result->AppendInteger(rect.x()); | 115 result->AppendInteger(rect.x()); |
117 result->AppendInteger(rect.y()); | 116 result->AppendInteger(rect.y()); |
118 result->AppendInteger(rect.width()); | 117 result->AppendInteger(rect.width()); |
119 result->AppendInteger(rect.height()); | 118 result->AppendInteger(rect.height()); |
120 } | 119 } |
121 return result.PassAs<base::Value>(); | 120 return result.PassAs<base::Value>(); |
122 } | 121 } |
123 | 122 |
124 void Region::AsValueInto(base::debug::TracedValue* result) const { | |
125 for (Iterator it(*this); it.has_rect(); it.next()) { | |
126 gfx::Rect rect(it.rect()); | |
127 result->AppendInteger(rect.x()); | |
128 result->AppendInteger(rect.y()); | |
129 result->AppendInteger(rect.width()); | |
130 result->AppendInteger(rect.height()); | |
131 } | |
132 } | |
133 | |
134 Region::Iterator::Iterator() { | 123 Region::Iterator::Iterator() { |
135 } | 124 } |
136 | 125 |
137 Region::Iterator::Iterator(const Region& region) | 126 Region::Iterator::Iterator(const Region& region) |
138 : it_(region.skregion_) { | 127 : it_(region.skregion_) { |
139 } | 128 } |
140 | 129 |
141 Region::Iterator::~Iterator() { | 130 Region::Iterator::~Iterator() { |
142 } | 131 } |
143 | 132 |
144 } // namespace cc | 133 } // namespace cc |
OLD | NEW |