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