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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 void PictureLayerImpl::UpdateTilePriorities( | 491 void PictureLayerImpl::UpdateTilePriorities( |
492 const Occlusion& occlusion_in_content_space) { | 492 const Occlusion& occlusion_in_content_space) { |
493 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); | 493 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); |
494 | 494 |
495 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); | 495 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); |
496 | 496 |
497 double current_frame_time_in_seconds = | 497 double current_frame_time_in_seconds = |
498 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time - | 498 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time - |
499 base::TimeTicks()).InSecondsF(); | 499 base::TimeTicks()).InSecondsF(); |
500 | 500 |
| 501 gfx::Rect viewport_rect_in_layer_space = |
| 502 GetViewportForTilePriorityInContentSpace(); |
501 bool tiling_needs_update = false; | 503 bool tiling_needs_update = false; |
502 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 504 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
503 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime( | 505 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTimeAndViewport( |
504 current_frame_time_in_seconds)) { | 506 current_frame_time_in_seconds, viewport_rect_in_layer_space)) { |
505 tiling_needs_update = true; | 507 tiling_needs_update = true; |
506 break; | 508 break; |
507 } | 509 } |
508 } | 510 } |
509 if (!tiling_needs_update) | 511 if (!tiling_needs_update) |
510 return; | 512 return; |
511 | 513 |
512 gfx::Rect viewport_rect_in_layer_space = | |
513 GetViewportForTilePriorityInContentSpace(); | |
514 WhichTree tree = | 514 WhichTree tree = |
515 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 515 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
516 bool can_require_tiles_for_activation = | 516 bool can_require_tiles_for_activation = |
517 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() || | 517 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() || |
518 !layer_tree_impl()->SmoothnessTakesPriority(); | 518 !layer_tree_impl()->SmoothnessTakesPriority(); |
519 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 519 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
520 PictureLayerTiling* tiling = tilings_->tiling_at(i); | 520 PictureLayerTiling* tiling = tilings_->tiling_at(i); |
521 | 521 |
522 tiling->set_can_require_tiles_for_activation( | 522 tiling->set_can_require_tiles_for_activation( |
523 can_require_tiles_for_activation); | 523 can_require_tiles_for_activation); |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1685 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1686 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1686 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1687 return tiling_range.end - 1 - current_tiling_range_offset; | 1687 return tiling_range.end - 1 - current_tiling_range_offset; |
1688 } | 1688 } |
1689 } | 1689 } |
1690 NOTREACHED(); | 1690 NOTREACHED(); |
1691 return 0; | 1691 return 0; |
1692 } | 1692 } |
1693 | 1693 |
1694 } // namespace cc | 1694 } // namespace cc |
OLD | NEW |