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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 value->SetInteger("scheduled_priority", scheduled_priority_); | 64 value->SetInteger("scheduled_priority", scheduled_priority_); |
65 value->SetBoolean("use_picture_analysis", use_picture_analysis()); | 65 value->SetBoolean("use_picture_analysis", use_picture_analysis()); |
66 value->SetInteger("gpu_memory_usage", | 66 value->SetInteger("gpu_memory_usage", |
67 base::saturated_cast<int>(GPUMemoryUsageInBytes())); | 67 base::saturated_cast<int>(GPUMemoryUsageInBytes())); |
68 } | 68 } |
69 | 69 |
70 size_t Tile::GPUMemoryUsageInBytes() const { | 70 size_t Tile::GPUMemoryUsageInBytes() const { |
71 if (draw_info_.resource_) { | 71 if (draw_info_.resource_) { |
72 // We can use UncheckedSizeInBytes, since the tile size is determined by the | 72 // We can use UncheckedSizeInBytes, since the tile size is determined by the |
73 // compositor. | 73 // compositor. |
74 return Resource::UncheckedMemorySizeBytes(draw_info_.resource_->size(), | 74 return ResourceUtil::UncheckedSizeInBytes(draw_info_.resource_->size(), |
75 draw_info_.resource_->format()); | 75 draw_info_.resource_->format()); |
76 } | 76 } |
77 return 0; | 77 return 0; |
78 } | 78 } |
79 | 79 |
80 void Tile::Deleter::operator()(Tile* tile) const { | 80 void Tile::Deleter::operator()(Tile* tile) const { |
81 TileManager* tile_manager = tile->tile_manager_; | 81 TileManager* tile_manager = tile->tile_manager_; |
82 tile_manager->Release(tile); | 82 tile_manager->Release(tile); |
83 } | 83 } |
84 | 84 |
85 } // namespace cc | 85 } // namespace cc |
OLD | NEW |