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

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

Issue 20667002: cc: Add frame data to LTHI tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add category thing Created 7 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
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/tile.h" 5 #include "cc/resources/tile.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/debug/traced_value.h" 8 #include "cc/debug/traced_value.h"
9 #include "cc/resources/tile_manager.h" 9 #include "cc/resources/tile_manager.h"
10 #include "third_party/khronos/GLES2/gl2.h" 10 #include "third_party/khronos/GLES2/gl2.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 Tile::~Tile() { 38 Tile::~Tile() {
39 TRACE_EVENT_OBJECT_DELETED_WITH_ID( 39 TRACE_EVENT_OBJECT_DELETED_WITH_ID(
40 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::Tile", this); 40 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::Tile", this);
41 tile_manager_->UnregisterTile(this); 41 tile_manager_->UnregisterTile(this);
42 } 42 }
43 43
44 scoped_ptr<base::Value> Tile::AsValue() const { 44 scoped_ptr<base::Value> Tile::AsValue() const {
45 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); 45 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
46 TracedValue::MakeDictIntoImplicitSnapshot(res.get(), "cc::Tile", this); 46 TracedValue::MakeDictIntoImplicitSnapshot(
47 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this);
47 res->Set("picture_pile", 48 res->Set("picture_pile",
48 TracedValue::CreateIDRef(picture_pile_.get()).release()); 49 TracedValue::CreateIDRef(picture_pile_.get()).release());
49 res->SetDouble("contents_scale", contents_scale_); 50 res->SetDouble("contents_scale", contents_scale_);
50 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); 51 res->Set("content_rect", MathUtil::AsValue(content_rect_).release());
51 res->SetInteger("layer_id", layer_id_); 52 res->SetInteger("layer_id", layer_id_);
52 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release()); 53 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release());
53 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release()); 54 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release());
54 res->Set("managed_state", managed_state_.AsValue().release()); 55 res->Set("managed_state", managed_state_.AsValue().release());
55 return res.PassAs<base::Value>(); 56 return res.PassAs<base::Value>();
56 } 57 }
57 58
58 size_t Tile::GPUMemoryUsageInBytes() const { 59 size_t Tile::GPUMemoryUsageInBytes() const {
59 size_t total_size = 0; 60 size_t total_size = 0;
60 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) 61 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
61 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); 62 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes();
62 return total_size; 63 return total_size;
63 } 64 }
64 65
65 } // namespace cc 66 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698