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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 << " eventually_rect: " << eventually_rect.ToString(); | 496 << " eventually_rect: " << eventually_rect.ToString(); |
497 | 497 |
498 SetLiveTilesRect(eventually_rect); | 498 SetLiveTilesRect(eventually_rect); |
499 | 499 |
500 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; | 500 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; |
501 last_visible_rect_in_content_space_ = visible_rect_in_content_space; | 501 last_visible_rect_in_content_space_ = visible_rect_in_content_space; |
502 | 502 |
503 eviction_tiles_cache_valid_ = false; | 503 eviction_tiles_cache_valid_ = false; |
504 | 504 |
505 TilePriority now_priority(resolution_, TilePriority::NOW, 0); | 505 TilePriority now_priority(resolution_, TilePriority::NOW, 0); |
506 float content_to_screen_scale = | 506 float content_to_screen_scale = ideal_contents_scale / contents_scale_; |
507 1.0f / (contents_scale_ * ideal_contents_scale); | |
508 | 507 |
509 // Assign now priority to all visible tiles. | 508 // Assign now priority to all visible tiles. |
510 bool include_borders = true; | 509 bool include_borders = true; |
511 has_visible_rect_tiles_ = false; | 510 has_visible_rect_tiles_ = false; |
512 for (TilingData::Iterator iter( | 511 for (TilingData::Iterator iter( |
513 &tiling_data_, visible_rect_in_content_space, include_borders); | 512 &tiling_data_, visible_rect_in_content_space, include_borders); |
514 iter; | 513 iter; |
515 ++iter) { | 514 ++iter) { |
516 TileMap::iterator find = tiles_.find(iter.index()); | 515 TileMap::iterator find = tiles_.find(iter.index()); |
517 if (find == tiles_.end()) | 516 if (find == tiles_.end()) |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 DCHECK(*this); | 1072 DCHECK(*this); |
1074 do { | 1073 do { |
1075 ++current_eviction_tiles_index_; | 1074 ++current_eviction_tiles_index_; |
1076 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1075 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
1077 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1076 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
1078 | 1077 |
1079 return *this; | 1078 return *this; |
1080 } | 1079 } |
1081 | 1080 |
1082 } // namespace cc | 1081 } // namespace cc |
OLD | NEW |