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 scoped_ptr<base::Value> PictureLayerTilingSet::AsValue() const { | 320 void PictureLayerTilingSet::AsValueInto(base::debug::TracedValue* state) const { |
321 scoped_ptr<base::ListValue> state(new base::ListValue()); | 321 for (size_t i = 0; i < tilings_.size(); ++i) { |
322 for (size_t i = 0; i < tilings_.size(); ++i) | 322 state->BeginDictionary(); |
323 state->Append(tilings_[i]->AsValue().release()); | 323 tilings_[i]->AsValueInto(state); |
324 return state.PassAs<base::Value>(); | 324 state->EndDictionary(); |
| 325 } |
325 } | 326 } |
326 | 327 |
327 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { | 328 size_t PictureLayerTilingSet::GPUMemoryUsageInBytes() const { |
328 size_t amount = 0; | 329 size_t amount = 0; |
329 for (size_t i = 0; i < tilings_.size(); ++i) | 330 for (size_t i = 0; i < tilings_.size(); ++i) |
330 amount += tilings_[i]->GPUMemoryUsageInBytes(); | 331 amount += tilings_[i]->GPUMemoryUsageInBytes(); |
331 return amount; | 332 return amount; |
332 } | 333 } |
333 | 334 |
334 PictureLayerTilingSet::TilingRange PictureLayerTilingSet::GetTilingRange( | 335 PictureLayerTilingSet::TilingRange PictureLayerTilingSet::GetTilingRange( |
(...skipping 21 matching lines...) Expand all Loading... |
356 return low_res_range; | 357 return low_res_range; |
357 case LOWER_THAN_LOW_RES: | 358 case LOWER_THAN_LOW_RES: |
358 return TilingRange(low_res_range.end, tilings_.size()); | 359 return TilingRange(low_res_range.end, tilings_.size()); |
359 } | 360 } |
360 | 361 |
361 NOTREACHED(); | 362 NOTREACHED(); |
362 return TilingRange(0, 0); | 363 return TilingRange(0, 0); |
363 } | 364 } |
364 | 365 |
365 } // namespace cc | 366 } // namespace cc |
OLD | NEW |