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 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 std::string result; | 114 std::string result; |
115 for (Iterator it(*this); it.has_rect(); it.next()) { | 115 for (Iterator it(*this); it.has_rect(); it.next()) { |
116 if (!result.empty()) | 116 if (!result.empty()) |
117 result += " | "; | 117 result += " | "; |
118 result += it.rect().ToString(); | 118 result += it.rect().ToString(); |
119 } | 119 } |
120 return result; | 120 return result; |
121 } | 121 } |
122 | 122 |
123 scoped_ptr<base::Value> Region::AsValue() const { | 123 std::unique_ptr<base::Value> Region::AsValue() const { |
124 scoped_ptr<base::ListValue> result(new base::ListValue()); | 124 std::unique_ptr<base::ListValue> result(new base::ListValue()); |
125 for (Iterator it(*this); it.has_rect(); it.next()) { | 125 for (Iterator it(*this); it.has_rect(); it.next()) { |
126 gfx::Rect rect(it.rect()); | 126 gfx::Rect rect(it.rect()); |
127 result->AppendInteger(rect.x()); | 127 result->AppendInteger(rect.x()); |
128 result->AppendInteger(rect.y()); | 128 result->AppendInteger(rect.y()); |
129 result->AppendInteger(rect.width()); | 129 result->AppendInteger(rect.width()); |
130 result->AppendInteger(rect.height()); | 130 result->AppendInteger(rect.height()); |
131 } | 131 } |
132 return std::move(result); | 132 return std::move(result); |
133 } | 133 } |
134 | 134 |
(...skipping 11 matching lines...) Expand all Loading... |
146 } | 146 } |
147 | 147 |
148 Region::Iterator::Iterator(const Region& region) | 148 Region::Iterator::Iterator(const Region& region) |
149 : it_(region.skregion_) { | 149 : it_(region.skregion_) { |
150 } | 150 } |
151 | 151 |
152 Region::Iterator::~Iterator() { | 152 Region::Iterator::~Iterator() { |
153 } | 153 } |
154 | 154 |
155 } // namespace cc | 155 } // namespace cc |
OLD | NEW |