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/tile.h" | 5 #include "cc/resources/tile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 base::trace_event::TracedValue* res) const { | 49 base::trace_event::TracedValue* res) const { |
50 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 50 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
51 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); | 51 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); |
52 TracedValue::SetIDRef(raster_source_.get(), res, "picture_pile"); | 52 TracedValue::SetIDRef(raster_source_.get(), res, "picture_pile"); |
53 res->SetDouble("contents_scale", contents_scale_); | 53 res->SetDouble("contents_scale", contents_scale_); |
54 | 54 |
55 MathUtil::AddToTracedValue("content_rect", content_rect_, res); | 55 MathUtil::AddToTracedValue("content_rect", content_rect_, res); |
56 | 56 |
57 res->SetInteger("layer_id", layer_id_); | 57 res->SetInteger("layer_id", layer_id_); |
58 | 58 |
59 // TODO(vmpstr): Remove active and pending priority once tracing is using | |
60 // combined priority or at least can support both. | |
61 res->BeginDictionary("active_priority"); | |
62 priority_.AsValueInto(res); | |
63 res->EndDictionary(); | |
64 | |
65 res->BeginDictionary("pending_priority"); | |
66 priority_.AsValueInto(res); | |
67 res->EndDictionary(); | |
68 | |
69 res->BeginDictionary("combined_priority"); | 59 res->BeginDictionary("combined_priority"); |
70 priority.AsValueInto(res); | 60 priority.AsValueInto(res); |
71 res->EndDictionary(); | 61 res->EndDictionary(); |
72 | 62 |
73 res->BeginDictionary("draw_info"); | 63 res->BeginDictionary("draw_info"); |
74 draw_info_.AsValueInto(res); | 64 draw_info_.AsValueInto(res); |
75 res->EndDictionary(); | 65 res->EndDictionary(); |
76 | 66 |
77 res->SetBoolean("has_resource", HasResource()); | 67 res->SetBoolean("has_resource", HasResource()); |
78 res->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask()); | 68 res->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask()); |
79 res->SetString("resolution", TileResolutionToString(priority_.resolution)); | 69 res->SetString("resolution", TileResolutionToString(priority.resolution)); |
80 | 70 |
81 res->SetInteger("scheduled_priority", scheduled_priority_); | 71 res->SetInteger("scheduled_priority", scheduled_priority_); |
82 | 72 |
83 res->SetBoolean("use_picture_analysis", use_picture_analysis()); | 73 res->SetBoolean("use_picture_analysis", use_picture_analysis()); |
84 | 74 |
85 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 75 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
86 } | 76 } |
87 | 77 |
88 size_t Tile::GPUMemoryUsageInBytes() const { | 78 size_t Tile::GPUMemoryUsageInBytes() const { |
89 if (draw_info_.resource_) | 79 if (draw_info_.resource_) |
90 return draw_info_.resource_->bytes(); | 80 return draw_info_.resource_->bytes(); |
91 return 0; | 81 return 0; |
92 } | 82 } |
93 | 83 |
94 void Tile::Deleter::operator()(Tile* tile) const { | 84 void Tile::Deleter::operator()(Tile* tile) const { |
95 TileManager* tile_manager = tile->tile_manager_; | 85 TileManager* tile_manager = tile->tile_manager_; |
96 tile_manager->Release(tile); | 86 tile_manager->Release(tile); |
97 } | 87 } |
98 | 88 |
99 } // namespace cc | 89 } // namespace cc |
OLD | NEW |