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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 void PictureLayerImpl::UpdateTilePriorities( | 500 void PictureLayerImpl::UpdateTilePriorities( |
501 const Occlusion& occlusion_in_content_space) { | 501 const Occlusion& occlusion_in_content_space) { |
502 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); | 502 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); |
503 | 503 |
504 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); | 504 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); |
505 | 505 |
506 double current_frame_time_in_seconds = | 506 double current_frame_time_in_seconds = |
507 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time - | 507 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time - |
508 base::TimeTicks()).InSecondsF(); | 508 base::TimeTicks()).InSecondsF(); |
509 | 509 |
| 510 gfx::Rect viewport_rect_in_layer_space = |
| 511 GetViewportForTilePriorityInContentSpace(); |
510 bool tiling_needs_update = false; | 512 bool tiling_needs_update = false; |
511 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 513 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
512 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( | 514 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTimeAndViewport( |
513 current_frame_time_in_seconds)) { | 515 current_frame_time_in_seconds, viewport_rect_in_layer_space)) { |
514 tiling_needs_update = true; | 516 tiling_needs_update = true; |
515 break; | 517 break; |
516 } | 518 } |
517 } | 519 } |
518 if (!tiling_needs_update) | 520 if (!tiling_needs_update) |
519 return; | 521 return; |
520 | 522 |
521 gfx::Rect viewport_rect_in_layer_space = | |
522 GetViewportForTilePriorityInContentSpace(); | |
523 WhichTree tree = | 523 WhichTree tree = |
524 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 524 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
525 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 525 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
526 // Pass |occlusion_in_content_space| for |occlusion_in_layer_space| since | 526 // Pass |occlusion_in_content_space| for |occlusion_in_layer_space| since |
527 // they are the same space in picture lbayer, as contents scale is always 1. | 527 // they are the same space in picture lbayer, as contents scale is always 1. |
528 tilings_->tiling_at(i)->UpdateTilePriorities(tree, | 528 tilings_->tiling_at(i)->UpdateTilePriorities(tree, |
529 viewport_rect_in_layer_space, | 529 viewport_rect_in_layer_space, |
530 ideal_contents_scale_, | 530 ideal_contents_scale_, |
531 current_frame_time_in_seconds, | 531 current_frame_time_in_seconds, |
532 occlusion_in_content_space); | 532 occlusion_in_content_space); |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1802 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1803 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1803 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1804 return tiling_range.end - 1 - current_tiling_range_offset; | 1804 return tiling_range.end - 1 - current_tiling_range_offset; |
1805 } | 1805 } |
1806 } | 1806 } |
1807 NOTREACHED(); | 1807 NOTREACHED(); |
1808 return 0; | 1808 return 0; |
1809 } | 1809 } |
1810 | 1810 |
1811 } // namespace cc | 1811 } // namespace cc |
OLD | NEW |