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/tiles/tile.h" | 5 #include "cc/tiles/tile.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 value->SetInteger("layer_id", layer_id_); | 50 value->SetInteger("layer_id", layer_id_); |
51 | 51 |
52 value->BeginDictionary("draw_info"); | 52 value->BeginDictionary("draw_info"); |
53 draw_info_.AsValueInto(value); | 53 draw_info_.AsValueInto(value); |
54 value->EndDictionary(); | 54 value->EndDictionary(); |
55 | 55 |
56 value->SetBoolean("has_resource", draw_info().has_resource()); | 56 value->SetBoolean("has_resource", draw_info().has_resource()); |
57 value->SetBoolean("is_using_gpu_memory", | 57 value->SetBoolean("is_using_gpu_memory", |
58 draw_info().has_resource() || HasRasterTask()); | 58 draw_info().has_resource() || HasRasterTask()); |
59 value->SetInteger("scheduled_priority", scheduled_priority_); | 59 value->SetInteger("scheduled_priority", scheduled_priority_); |
60 value->SetBoolean("use_picture_analysis", use_picture_analysis()); | |
61 value->SetInteger("gpu_memory_usage", | 60 value->SetInteger("gpu_memory_usage", |
62 base::saturated_cast<int>(GPUMemoryUsageInBytes())); | 61 base::saturated_cast<int>(GPUMemoryUsageInBytes())); |
63 } | 62 } |
64 | 63 |
65 size_t Tile::GPUMemoryUsageInBytes() const { | 64 size_t Tile::GPUMemoryUsageInBytes() const { |
66 if (draw_info_.resource_) { | 65 if (draw_info_.resource_) { |
67 // We can use UncheckedSizeInBytes, since the tile size is determined by the | 66 // We can use UncheckedSizeInBytes, since the tile size is determined by the |
68 // compositor. | 67 // compositor. |
69 return ResourceUtil::UncheckedSizeInBytes<size_t>( | 68 return ResourceUtil::UncheckedSizeInBytes<size_t>( |
70 draw_info_.resource_->size(), draw_info_.resource_->format()); | 69 draw_info_.resource_->size(), draw_info_.resource_->format()); |
71 } | 70 } |
72 return 0; | 71 return 0; |
73 } | 72 } |
74 | 73 |
75 void Tile::Deleter::operator()(Tile* tile) const { | 74 void Tile::Deleter::operator()(Tile* tile) const { |
76 tile->tile_manager_->Release(tile); | 75 tile->tile_manager_->Release(tile); |
77 } | 76 } |
78 | 77 |
79 } // namespace cc | 78 } // namespace cc |
OLD | NEW |