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_manager.h" | 5 #include "cc/tiles/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 DCHECK_LE(memory_bytes, | 1038 DCHECK_LE(memory_bytes, |
1039 static_cast<size_t>(std::numeric_limits<int64>::max())); | 1039 static_cast<size_t>(std::numeric_limits<int64>::max())); |
1040 DCHECK_LE(resource_count, | 1040 DCHECK_LE(resource_count, |
1041 static_cast<size_t>(std::numeric_limits<int>::max())); | 1041 static_cast<size_t>(std::numeric_limits<int>::max())); |
1042 } | 1042 } |
1043 | 1043 |
1044 // static | 1044 // static |
1045 TileManager::MemoryUsage TileManager::MemoryUsage::FromConfig( | 1045 TileManager::MemoryUsage TileManager::MemoryUsage::FromConfig( |
1046 const gfx::Size& size, | 1046 const gfx::Size& size, |
1047 ResourceFormat format) { | 1047 ResourceFormat format) { |
1048 // We can use UncheckedMemorySizeBytes here since this is used with a tile | 1048 // We can use UncheckedSizeInBytes here since this is used with a tile |
1049 // size which is determined by the compositor (it's at most max texture size). | 1049 // size which is determined by the compositor (it's at most max texture size). |
1050 return MemoryUsage(Resource::UncheckedMemorySizeBytes(size, format), 1); | 1050 return MemoryUsage(ResourceUtil::UncheckedSizeInBytes<size_t>(size, format), |
| 1051 1); |
1051 } | 1052 } |
1052 | 1053 |
1053 // static | 1054 // static |
1054 TileManager::MemoryUsage TileManager::MemoryUsage::FromTile(const Tile* tile) { | 1055 TileManager::MemoryUsage TileManager::MemoryUsage::FromTile(const Tile* tile) { |
1055 const TileDrawInfo& draw_info = tile->draw_info(); | 1056 const TileDrawInfo& draw_info = tile->draw_info(); |
1056 if (draw_info.resource_) { | 1057 if (draw_info.resource_) { |
1057 return MemoryUsage::FromConfig(draw_info.resource_->size(), | 1058 return MemoryUsage::FromConfig(draw_info.resource_->size(), |
1058 draw_info.resource_->format()); | 1059 draw_info.resource_->format()); |
1059 } | 1060 } |
1060 return MemoryUsage(); | 1061 return MemoryUsage(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 void TileManager::Signals::reset() { | 1094 void TileManager::Signals::reset() { |
1094 ready_to_activate = false; | 1095 ready_to_activate = false; |
1095 did_notify_ready_to_activate = false; | 1096 did_notify_ready_to_activate = false; |
1096 ready_to_draw = false; | 1097 ready_to_draw = false; |
1097 did_notify_ready_to_draw = false; | 1098 did_notify_ready_to_draw = false; |
1098 all_tile_tasks_completed = false; | 1099 all_tile_tasks_completed = false; |
1099 did_notify_all_tile_tasks_completed = false; | 1100 did_notify_all_tile_tasks_completed = false; |
1100 } | 1101 } |
1101 | 1102 |
1102 } // namespace cc | 1103 } // namespace cc |
OLD | NEW |