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_manager.h" | 5 #include "cc/resources/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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // memory and in worst case use on-demand raster when tiles | 228 // memory and in worst case use on-demand raster when tiles |
229 // required for activation are OOM. | 229 // required for activation are OOM. |
230 if (!all_tiles_required_for_activation_have_memory_) | 230 if (!all_tiles_required_for_activation_have_memory_) |
231 return; | 231 return; |
232 | 232 |
233 client_->NotifyReadyToActivate(); | 233 client_->NotifyReadyToActivate(); |
234 } | 234 } |
235 | 235 |
236 class BinComparator { | 236 class BinComparator { |
237 public: | 237 public: |
238 bool operator()(const scoped_refptr<Tile> a, | 238 bool operator()(const scoped_refptr<Tile>& a, |
239 const scoped_refptr<Tile> b) const { | 239 const scoped_refptr<Tile>& b) const { |
240 const ManagedTileState& ams = a->managed_state(); | 240 const ManagedTileState& ams = a->managed_state(); |
241 const ManagedTileState& bms = b->managed_state(); | 241 const ManagedTileState& bms = b->managed_state(); |
242 | 242 |
243 if (ams.visible_and_ready_to_draw != bms.visible_and_ready_to_draw) | 243 if (ams.visible_and_ready_to_draw != bms.visible_and_ready_to_draw) |
244 return ams.visible_and_ready_to_draw; | 244 return ams.visible_and_ready_to_draw; |
245 | 245 |
246 if (ams.bin[HIGH_PRIORITY_BIN] != bms.bin[HIGH_PRIORITY_BIN]) | 246 if (ams.bin[HIGH_PRIORITY_BIN] != bms.bin[HIGH_PRIORITY_BIN]) |
247 return ams.bin[HIGH_PRIORITY_BIN] < bms.bin[HIGH_PRIORITY_BIN]; | 247 return ams.bin[HIGH_PRIORITY_BIN] < bms.bin[HIGH_PRIORITY_BIN]; |
248 | 248 |
249 if (ams.bin[LOW_PRIORITY_BIN] != bms.bin[LOW_PRIORITY_BIN]) | 249 if (ams.bin[LOW_PRIORITY_BIN] != bms.bin[LOW_PRIORITY_BIN]) |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 tile_version.set_use_resource(); | 826 tile_version.set_use_resource(); |
827 tile_version.resource_ = resource.Pass(); | 827 tile_version.resource_ = resource.Pass(); |
828 } | 828 } |
829 | 829 |
830 FreeUnusedResourcesForTile(tile); | 830 FreeUnusedResourcesForTile(tile); |
831 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) | 831 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) |
832 did_initialize_visible_tile_ = true; | 832 did_initialize_visible_tile_ = true; |
833 } | 833 } |
834 | 834 |
835 } // namespace cc | 835 } // namespace cc |
OLD | NEW |