| 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 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 DCHECK(raster_page_scale_); | 432 DCHECK(raster_page_scale_); |
| 433 DCHECK(raster_device_scale_); | 433 DCHECK(raster_device_scale_); |
| 434 DCHECK(raster_source_scale_); | 434 DCHECK(raster_source_scale_); |
| 435 DCHECK(raster_contents_scale_); | 435 DCHECK(raster_contents_scale_); |
| 436 DCHECK(low_res_raster_contents_scale_); | 436 DCHECK(low_res_raster_contents_scale_); |
| 437 | 437 |
| 438 was_screen_space_transform_animating_ = | 438 was_screen_space_transform_animating_ = |
| 439 draw_properties().screen_space_transform_is_animating; | 439 draw_properties().screen_space_transform_is_animating; |
| 440 | 440 |
| 441 // TODO(sohanjg): Avoid needlessly update priorities when syncing to a | |
| 442 // non-updated tree which will then be updated immediately afterwards. | |
| 443 should_update_tile_priorities_ = true; | 441 should_update_tile_priorities_ = true; |
| 444 | 442 |
| 445 UpdateTilePriorities(occlusion_tracker); | 443 UpdateTilePriorities(occlusion_tracker); |
| 446 | 444 |
| 447 if (layer_tree_impl()->IsPendingTree()) | 445 if (layer_tree_impl()->IsPendingTree()) |
| 448 MarkVisibleResourcesAsRequired(); | 446 MarkVisibleResourcesAsRequired(); |
| 449 } | 447 } |
| 450 | 448 |
| 451 void PictureLayerImpl::UpdateTilePriorities( | 449 void PictureLayerImpl::UpdateTilePriorities( |
| 452 const OcclusionTracker<LayerImpl>* occlusion_tracker) { | 450 const OcclusionTracker<LayerImpl>* occlusion_tracker) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 479 screen_to_layer, gfx::Rect(viewport_size_for_tile_priority_))); | 477 screen_to_layer, gfx::Rect(viewport_size_for_tile_priority_))); |
| 480 visible_rect_in_content_space.Intersect(gfx::Rect(content_bounds())); | 478 visible_rect_in_content_space.Intersect(gfx::Rect(content_bounds())); |
| 481 } | 479 } |
| 482 } | 480 } |
| 483 | 481 |
| 484 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect( | 482 gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect( |
| 485 visible_rect_in_content_space, 1.f / contents_scale_x()); | 483 visible_rect_in_content_space, 1.f / contents_scale_x()); |
| 486 WhichTree tree = | 484 WhichTree tree = |
| 487 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 485 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
| 488 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 486 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 489 // TODO(sohanjg): Passing MaximumContentsScale as layer contents scale | |
| 490 // in UpdateTilePriorities is wrong and should be ideal contents scale. | |
| 491 tilings_->tiling_at(i)->UpdateTilePriorities(tree, | 487 tilings_->tiling_at(i)->UpdateTilePriorities(tree, |
| 492 visible_layer_rect, | 488 visible_layer_rect, |
| 493 MaximumTilingContentsScale(), | 489 ideal_contents_scale_, |
| 494 current_frame_time_in_seconds, | 490 current_frame_time_in_seconds, |
| 495 occlusion_tracker, | 491 occlusion_tracker, |
| 496 render_target(), | 492 render_target(), |
| 497 draw_transform()); | 493 draw_transform()); |
| 498 } | 494 } |
| 499 | 495 |
| 500 // Tile priorities were modified. | 496 // Tile priorities were modified. |
| 501 layer_tree_impl()->DidModifyTilePriorities(); | 497 layer_tree_impl()->DidModifyTilePriorities(); |
| 502 } | 498 } |
| 503 | 499 |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 return iterator_index_ < iterators_.size(); | 1640 return iterator_index_ < iterators_.size(); |
| 1645 } | 1641 } |
| 1646 | 1642 |
| 1647 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1643 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1648 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1644 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1649 return it->get_type() == iteration_stage_ && | 1645 return it->get_type() == iteration_stage_ && |
| 1650 (**it)->required_for_activation() == required_for_activation_; | 1646 (**it)->required_for_activation() == required_for_activation_; |
| 1651 } | 1647 } |
| 1652 | 1648 |
| 1653 } // namespace cc | 1649 } // namespace cc |
| OLD | NEW |