Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: cc/resources/picture_layer_tiling_set.cc

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698