OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/tiling_set_raster_queue_all.h" | 5 #include "cc/tiles/tiling_set_raster_queue_all.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Early out if the tiling set has no tilings. | 29 // Early out if the tiling set has no tilings. |
30 if (!tiling_set_->num_tilings()) | 30 if (!tiling_set_->num_tilings()) |
31 return; | 31 return; |
32 | 32 |
33 const PictureLayerTilingClient* client = tiling_set->client(); | 33 const PictureLayerTilingClient* client = tiling_set->client(); |
34 WhichTree tree = tiling_set->tree(); | 34 WhichTree tree = tiling_set->tree(); |
35 // Find high and low res tilings and initialize the iterators. | 35 // Find high and low res tilings and initialize the iterators. |
36 PictureLayerTiling* high_res_tiling = nullptr; | 36 PictureLayerTiling* high_res_tiling = nullptr; |
37 PictureLayerTiling* low_res_tiling = nullptr; | 37 PictureLayerTiling* low_res_tiling = nullptr; |
38 // This variable would point to a tiling that has a NON_IDEAL_RESOLUTION | 38 // This variable would point to a tiling that has a NON_IDEAL_RESOLUTION or |
39 // resolution on the active tree, but HIGH_RESOLUTION on the pending tree. | 39 // LOW_RESOLUTION on the active tree, but HIGH_RESOLUTION on the pending tree. |
40 // These tilings are the only non-ideal tilings that could have required for | 40 // These tilings are the only non-high res tilings that could have required |
41 // activation tiles, so they need to be considered for rasterization. | 41 // for activation tiles, so they need to be considered for rasterization. |
42 PictureLayerTiling* active_non_ideal_pending_high_res_tiling = nullptr; | 42 PictureLayerTiling* active_non_ideal_pending_high_res_tiling = nullptr; |
43 for (size_t i = 0; i < tiling_set_->num_tilings(); ++i) { | 43 for (size_t i = 0; i < tiling_set_->num_tilings(); ++i) { |
44 PictureLayerTiling* tiling = tiling_set_->tiling_at(i); | 44 PictureLayerTiling* tiling = tiling_set_->tiling_at(i); |
45 if (tiling->resolution() == HIGH_RESOLUTION) | 45 if (tiling->resolution() == HIGH_RESOLUTION) |
46 high_res_tiling = tiling; | 46 high_res_tiling = tiling; |
47 if (prioritize_low_res && tiling->resolution() == LOW_RESOLUTION) | 47 if (prioritize_low_res && tiling->resolution() == LOW_RESOLUTION) |
48 low_res_tiling = tiling; | 48 low_res_tiling = tiling; |
49 if (tree == ACTIVE_TREE && tiling->resolution() == NON_IDEAL_RESOLUTION) { | 49 if (tree == ACTIVE_TREE && tiling->resolution() != HIGH_RESOLUTION) { |
50 const PictureLayerTiling* twin = | 50 const PictureLayerTiling* twin = |
51 client->GetPendingOrActiveTwinTiling(tiling); | 51 client->GetPendingOrActiveTwinTiling(tiling); |
52 if (twin && twin->resolution() == HIGH_RESOLUTION) | 52 if (twin && twin->resolution() == HIGH_RESOLUTION) |
53 active_non_ideal_pending_high_res_tiling = tiling; | 53 active_non_ideal_pending_high_res_tiling = tiling; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 bool use_low_res_tiling = low_res_tiling && low_res_tiling->has_tiles() && | 57 bool use_low_res_tiling = low_res_tiling && low_res_tiling->has_tiles() && |
58 !low_res_tiling->all_tiles_done(); | 58 !low_res_tiling->all_tiles_done(); |
59 bool use_high_res_tiling = high_res_tiling && high_res_tiling->has_tiles() && | 59 bool use_high_res_tiling = high_res_tiling && high_res_tiling->has_tiles() && |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 current_tile_ = PrioritizedTile(); | 443 current_tile_ = PrioritizedTile(); |
444 return *this; | 444 return *this; |
445 } | 445 } |
446 current_tile_ = *eventually_iterator_; | 446 current_tile_ = *eventually_iterator_; |
447 break; | 447 break; |
448 } | 448 } |
449 return *this; | 449 return *this; |
450 } | 450 } |
451 | 451 |
452 } // namespace cc | 452 } // namespace cc |
OLD | NEW |