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