Chromium Code Reviews| 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/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 | 498 |
| 499 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; | 499 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; |
| 500 last_visible_rect_in_content_space_ = visible_rect_in_content_space; | 500 last_visible_rect_in_content_space_ = visible_rect_in_content_space; |
| 501 | 501 |
| 502 eviction_tiles_cache_valid_ = false; | 502 eviction_tiles_cache_valid_ = false; |
| 503 | 503 |
| 504 TilePriority now_priority(resolution_, TilePriority::NOW, 0); | 504 TilePriority now_priority(resolution_, TilePriority::NOW, 0); |
| 505 float content_to_screen_scale = ideal_contents_scale / contents_scale_; | 505 float content_to_screen_scale = ideal_contents_scale / contents_scale_; |
| 506 | 506 |
| 507 // Assign now priority to all visible tiles. | 507 // Assign now priority to all visible tiles. |
| 508 bool include_borders = true; | 508 bool include_borders = false; |
| 509 has_visible_rect_tiles_ = false; | 509 has_visible_rect_tiles_ = false; |
| 510 for (TilingData::Iterator iter( | 510 for (TilingData::Iterator iter( |
| 511 &tiling_data_, visible_rect_in_content_space, include_borders); | 511 &tiling_data_, visible_rect_in_content_space, include_borders); |
| 512 iter; | 512 iter; |
| 513 ++iter) { | 513 ++iter) { |
| 514 TileMap::iterator find = tiles_.find(iter.index()); | 514 TileMap::iterator find = tiles_.find(iter.index()); |
| 515 if (find == tiles_.end()) | 515 if (find == tiles_.end()) |
| 516 continue; | 516 continue; |
| 517 has_visible_rect_tiles_ = true; | 517 has_visible_rect_tiles_ = true; |
| 518 Tile* tile = find->second.get(); | 518 Tile* tile = find->second.get(); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 PictureLayerTiling* tiling, | 932 PictureLayerTiling* tiling, |
| 933 WhichTree tree) | 933 WhichTree tree) |
| 934 : tiling_(tiling), phase_(VISIBLE_RECT), tree_(tree), current_tile_(NULL) { | 934 : tiling_(tiling), phase_(VISIBLE_RECT), tree_(tree), current_tile_(NULL) { |
| 935 if (!tiling_->has_visible_rect_tiles_) { | 935 if (!tiling_->has_visible_rect_tiles_) { |
| 936 AdvancePhase(); | 936 AdvancePhase(); |
| 937 return; | 937 return; |
| 938 } | 938 } |
| 939 | 939 |
| 940 visible_iterator_ = TilingData::Iterator(&tiling_->tiling_data_, | 940 visible_iterator_ = TilingData::Iterator(&tiling_->tiling_data_, |
| 941 tiling_->current_visible_rect_, | 941 tiling_->current_visible_rect_, |
| 942 true /* include_borders */); | 942 true /* include_borders */); |
|
vmpstr
2014/08/26 20:52:33
Can you fix this up as well, while here? The itera
danakj
2014/08/26 20:57:05
Done! PTAL
| |
| 943 if (!visible_iterator_) { | 943 if (!visible_iterator_) { |
| 944 AdvancePhase(); | 944 AdvancePhase(); |
| 945 return; | 945 return; |
| 946 } | 946 } |
| 947 | 947 |
| 948 current_tile_ = | 948 current_tile_ = |
| 949 tiling_->TileAt(visible_iterator_.index_x(), visible_iterator_.index_y()); | 949 tiling_->TileAt(visible_iterator_.index_x(), visible_iterator_.index_y()); |
| 950 if (!current_tile_ || !TileNeedsRaster(current_tile_)) | 950 if (!current_tile_ || !TileNeedsRaster(current_tile_)) |
| 951 ++(*this); | 951 ++(*this); |
| 952 } | 952 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1089 DCHECK(*this); | 1089 DCHECK(*this); |
| 1090 do { | 1090 do { |
| 1091 ++current_eviction_tiles_index_; | 1091 ++current_eviction_tiles_index_; |
| 1092 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1092 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
| 1093 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1093 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
| 1094 | 1094 |
| 1095 return *this; | 1095 return *this; |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 } // namespace cc | 1098 } // namespace cc |
| OLD | NEW |