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/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 res->BeginDictionary("pending_priority"); | 81 res->BeginDictionary("pending_priority"); |
82 priority_[PENDING_TREE].AsValueInto(res); | 82 priority_[PENDING_TREE].AsValueInto(res); |
83 res->EndDictionary(); | 83 res->EndDictionary(); |
84 | 84 |
85 res->BeginDictionary("managed_state"); | 85 res->BeginDictionary("managed_state"); |
86 managed_state_.AsValueInto(res); | 86 managed_state_.AsValueInto(res); |
87 res->EndDictionary(); | 87 res->EndDictionary(); |
88 | 88 |
89 res->SetBoolean("use_picture_analysis", use_picture_analysis()); | 89 res->SetBoolean("use_picture_analysis", use_picture_analysis()); |
| 90 |
| 91 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
90 } | 92 } |
91 | 93 |
92 size_t Tile::GPUMemoryUsageInBytes() const { | 94 size_t Tile::GPUMemoryUsageInBytes() const { |
93 size_t total_size = 0; | 95 size_t total_size = 0; |
94 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) | 96 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) |
95 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); | 97 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); |
96 return total_size; | 98 return total_size; |
97 } | 99 } |
98 | 100 |
99 RasterMode Tile::DetermineRasterModeForTree(WhichTree tree) const { | 101 RasterMode Tile::DetermineRasterModeForTree(WhichTree tree) const { |
(...skipping 15 matching lines...) Expand all Loading... |
115 | 117 |
116 bool Tile::HasRasterTask() const { | 118 bool Tile::HasRasterTask() const { |
117 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 119 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
118 if (managed_state_.tile_versions[mode].raster_task_) | 120 if (managed_state_.tile_versions[mode].raster_task_) |
119 return true; | 121 return true; |
120 } | 122 } |
121 return false; | 123 return false; |
122 } | 124 } |
123 | 125 |
124 } // namespace cc | 126 } // namespace cc |
OLD | NEW |