OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/resources/picture_layer_tiling_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 void PictureLayerTilingSet::DidBecomeActive() { | 310 void PictureLayerTilingSet::DidBecomeActive() { |
311 for (size_t i = 0; i < tilings_.size(); ++i) | 311 for (size_t i = 0; i < tilings_.size(); ++i) |
312 tilings_[i]->DidBecomeActive(); | 312 tilings_[i]->DidBecomeActive(); |
313 } | 313 } |
314 | 314 |
315 void PictureLayerTilingSet::DidBecomeRecycled() { | 315 void PictureLayerTilingSet::DidBecomeRecycled() { |
316 for (size_t i = 0; i < tilings_.size(); ++i) | 316 for (size_t i = 0; i < tilings_.size(); ++i) |
317 tilings_[i]->DidBecomeRecycled(); | 317 tilings_[i]->DidBecomeRecycled(); |
318 } | 318 } |
319 | 319 |
320 void PictureLayerTilingSet::AsValueInto(base::debug::TracedValue* state) const { | 320 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { |
321 for (size_t i = 0; i < tilings_.size(); ++i) { | 321 scoped_ptr<base::ListValue> state(new base::ListValue()); |
322 state->BeginDictionary(); | 322 for (size_t i = 0; i < tilings_.size(); ++i) |
323 tilings_[i]->AsValueInto(state); | 323 state->Append(tilings_[i]->AsValue().release()); |
324 state->EndDictionary(); | 324 return state.PassAs<base::Value>(); |
325 } | |
326 } | 325 } |
327 | 326 |
328 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { | 327 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { |
329 size_t amount = 0; | 328 size_t amount = 0; |
330 for (size_t i = 0; i < tilings_.size(); ++i) | 329 for (size_t i = 0; i < tilings_.size(); ++i) |
331 amount += tilings_[i]->GPUMemoryUsageInBytes(); | 330 amount += tilings_[i]->GPUMemoryUsageInBytes(); |
332 return amount; | 331 return amount; |
333 } | 332 } |
334 | 333 |
335 } // namespace cc | 334 } // namespace cc |
OLD | NEW |