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