| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 skewport.Intersect(max_skewport); | 412 skewport.Intersect(max_skewport); |
| 413 | 413 |
| 414 // Finally, ensure that visible rect is contained in the skewport. | 414 // Finally, ensure that visible rect is contained in the skewport. |
| 415 skewport.Union(visible_rect_in_content_space); | 415 skewport.Union(visible_rect_in_content_space); |
| 416 return skewport; | 416 return skewport; |
| 417 } | 417 } |
| 418 | 418 |
| 419 void PictureLayerTiling::UpdateTilePriorities( | 419 void PictureLayerTiling::UpdateTilePriorities( |
| 420 WhichTree tree, | 420 WhichTree tree, |
| 421 const gfx::Rect& visible_layer_rect, | 421 const gfx::Rect& visible_layer_rect, |
| 422 float layer_contents_scale, | 422 float ideal_contents_scale, |
| 423 double current_frame_time_in_seconds, | 423 double current_frame_time_in_seconds, |
| 424 const OcclusionTracker<LayerImpl>* occlusion_tracker, | 424 const OcclusionTracker<LayerImpl>* occlusion_tracker, |
| 425 const LayerImpl* render_target, | 425 const LayerImpl* render_target, |
| 426 const gfx::Transform& draw_transform) { | 426 const gfx::Transform& draw_transform) { |
| 427 if (!NeedsUpdateForFrameAtTime(current_frame_time_in_seconds)) { | 427 if (!NeedsUpdateForFrameAtTime(current_frame_time_in_seconds)) { |
| 428 // This should never be zero for the purposes of has_ever_been_updated(). | 428 // This should never be zero for the purposes of has_ever_been_updated(). |
| 429 DCHECK_NE(current_frame_time_in_seconds, 0.0); | 429 DCHECK_NE(current_frame_time_in_seconds, 0.0); |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 | 432 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 462 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; | 462 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; |
| 463 last_visible_rect_in_content_space_ = visible_rect_in_content_space; | 463 last_visible_rect_in_content_space_ = visible_rect_in_content_space; |
| 464 | 464 |
| 465 current_visible_rect_in_content_space_ = visible_rect_in_content_space; | 465 current_visible_rect_in_content_space_ = visible_rect_in_content_space; |
| 466 current_skewport_ = skewport; | 466 current_skewport_ = skewport; |
| 467 current_eventually_rect_ = eventually_rect; | 467 current_eventually_rect_ = eventually_rect; |
| 468 eviction_tiles_cache_valid_ = false; | 468 eviction_tiles_cache_valid_ = false; |
| 469 | 469 |
| 470 TilePriority now_priority(resolution_, TilePriority::NOW, 0); | 470 TilePriority now_priority(resolution_, TilePriority::NOW, 0); |
| 471 float content_to_screen_scale = | 471 float content_to_screen_scale = |
| 472 1.0f / (contents_scale_ * layer_contents_scale); | 472 1.0f / (contents_scale_ * ideal_contents_scale); |
| 473 | 473 |
| 474 // Assign now priority to all visible tiles. | 474 // Assign now priority to all visible tiles. |
| 475 bool include_borders = true; | 475 bool include_borders = true; |
| 476 for (TilingData::Iterator iter( | 476 for (TilingData::Iterator iter( |
| 477 &tiling_data_, visible_rect_in_content_space, include_borders); | 477 &tiling_data_, visible_rect_in_content_space, include_borders); |
| 478 iter; | 478 iter; |
| 479 ++iter) { | 479 ++iter) { |
| 480 TileMap::iterator find = tiles_.find(iter.index()); | 480 TileMap::iterator find = tiles_.find(iter.index()); |
| 481 if (find == tiles_.end()) | 481 if (find == tiles_.end()) |
| 482 continue; | 482 continue; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 973 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
| 974 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 974 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
| 975 is_valid_ = true; | 975 is_valid_ = true; |
| 976 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 976 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
| 977 !(*tile_iterator_)->HasResources()) { | 977 !(*tile_iterator_)->HasResources()) { |
| 978 ++(*this); | 978 ++(*this); |
| 979 } | 979 } |
| 980 } | 980 } |
| 981 | 981 |
| 982 } // namespace cc | 982 } // namespace cc |
| OLD | NEW |