| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 340 } |
| 341 | 341 |
| 342 // Aggressively remove any tilings that are not seen to save memory. Note | 342 // Aggressively remove any tilings that are not seen to save memory. Note |
| 343 // that this is at the expense of doing cause more frequent re-painting. A | 343 // that this is at the expense of doing cause more frequent re-painting. A |
| 344 // better scheme would be to maintain a tighter visible_content_rect for the | 344 // better scheme would be to maintain a tighter visible_content_rect for the |
| 345 // finer tilings. | 345 // finer tilings. |
| 346 CleanUpTilingsOnActiveLayer(seen_tilings); | 346 CleanUpTilingsOnActiveLayer(seen_tilings); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void PictureLayerImpl::DidUnregisterLayer() { | 349 void PictureLayerImpl::DidUnregisterLayer() { |
| 350 TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer"); |
| 351 |
| 350 layer_needs_to_register_itself_ = true; | 352 layer_needs_to_register_itself_ = true; |
| 353 RemoveAllTilings(); |
| 351 } | 354 } |
| 352 | 355 |
| 353 void PictureLayerImpl::UpdateTilePriorities() { | 356 void PictureLayerImpl::UpdateTilePriorities() { |
| 357 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); |
| 358 |
| 359 DCHECK(is_render_surface_list_member()); |
| 354 DCHECK(!needs_post_commit_initialization_); | 360 DCHECK(!needs_post_commit_initialization_); |
| 355 CHECK(should_update_tile_priorities_); | 361 CHECK(should_update_tile_priorities_); |
| 356 | 362 |
| 357 if (layer_needs_to_register_itself_) { | 363 if (layer_needs_to_register_itself_) { |
| 358 layer_tree_impl()->tile_manager()->RegisterPictureLayerImpl(this); | 364 layer_tree_impl()->tile_manager()->RegisterPictureLayerImpl(this); |
| 359 layer_needs_to_register_itself_ = false; | 365 layer_needs_to_register_itself_ = false; |
| 360 } | 366 } |
| 361 | 367 |
| 362 if (layer_tree_impl()->device_viewport_valid_for_tile_management()) { | 368 if (layer_tree_impl()->device_viewport_valid_for_tile_management()) { |
| 363 visible_rect_for_tile_priority_ = visible_content_rect(); | 369 visible_rect_for_tile_priority_ = visible_content_rect(); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 return iterator_index_ < iterators_.size(); | 1560 return iterator_index_ < iterators_.size(); |
| 1555 } | 1561 } |
| 1556 | 1562 |
| 1557 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1563 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
| 1558 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1564 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
| 1559 return it->get_type() == iteration_stage_ && | 1565 return it->get_type() == iteration_stage_ && |
| 1560 (**it)->required_for_activation() == required_for_activation_; | 1566 (**it)->required_for_activation() == required_for_activation_; |
| 1561 } | 1567 } |
| 1562 | 1568 |
| 1563 } // namespace cc | 1569 } // namespace cc |
| OLD | NEW |