| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 << " bounds " << bounds().ToString() << " pile " | 549 << " bounds " << bounds().ToString() << " pile " |
| 550 << raster_source->GetSize().ToString(); | 550 << raster_source->GetSize().ToString(); |
| 551 | 551 |
| 552 // The |raster_source_| is initially null, so have to check for that for the | 552 // The |raster_source_| is initially null, so have to check for that for the |
| 553 // first frame. | 553 // first frame. |
| 554 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); | 554 bool could_have_tilings = raster_source_.get() && CanHaveTilings(); |
| 555 raster_source_.swap(raster_source); | 555 raster_source_.swap(raster_source); |
| 556 | 556 |
| 557 // Only set the image decode controller when we're committing. | 557 // Only set the image decode controller when we're committing. |
| 558 if (!pending_set) { | 558 if (!pending_set) { |
| 559 raster_source_->SetImageDecodeController( | 559 raster_source_->set_image_decode_controller( |
| 560 layer_tree_impl()->image_decode_controller()); | 560 layer_tree_impl()->image_decode_controller()); |
| 561 } | 561 } |
| 562 | 562 |
| 563 // The |new_invalidation| must be cleared before updating tilings since they | 563 // The |new_invalidation| must be cleared before updating tilings since they |
| 564 // access the invalidation through the PictureLayerTilingClient interface. | 564 // access the invalidation through the PictureLayerTilingClient interface. |
| 565 invalidation_.Clear(); | 565 invalidation_.Clear(); |
| 566 invalidation_.Swap(new_invalidation); | 566 invalidation_.Swap(new_invalidation); |
| 567 | 567 |
| 568 bool can_have_tilings = CanHaveTilings(); | 568 bool can_have_tilings = CanHaveTilings(); |
| 569 DCHECK(!pending_set || | 569 DCHECK(!pending_set || |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 void PictureLayerImpl::ReleaseResources() { | 645 void PictureLayerImpl::ReleaseResources() { |
| 646 // Recreate tilings with new settings, since some of those might change when | 646 // Recreate tilings with new settings, since some of those might change when |
| 647 // we release resources. | 647 // we release resources. |
| 648 tilings_ = nullptr; | 648 tilings_ = nullptr; |
| 649 ResetRasterScale(); | 649 ResetRasterScale(); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void PictureLayerImpl::RecreateResources() { | 652 void PictureLayerImpl::RecreateResources() { |
| 653 tilings_ = CreatePictureLayerTilingSet(); | 653 tilings_ = CreatePictureLayerTilingSet(); |
| 654 if (raster_source_) { | 654 if (raster_source_) { |
| 655 raster_source_->SetImageDecodeController( | 655 raster_source_->set_image_decode_controller( |
| 656 layer_tree_impl()->image_decode_controller()); | 656 layer_tree_impl()->image_decode_controller()); |
| 657 } | 657 } |
| 658 | 658 |
| 659 // To avoid an edge case after lost context where the tree is up to date but | 659 // To avoid an edge case after lost context where the tree is up to date but |
| 660 // the tilings have not been managed, request an update draw properties | 660 // the tilings have not been managed, request an update draw properties |
| 661 // to force tilings to get managed. | 661 // to force tilings to get managed. |
| 662 layer_tree_impl()->set_needs_update_draw_properties(); | 662 layer_tree_impl()->set_needs_update_draw_properties(); |
| 663 } | 663 } |
| 664 | 664 |
| 665 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { | 665 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1291 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1292 return !layer_tree_impl()->IsRecycleTree(); | 1292 return !layer_tree_impl()->IsRecycleTree(); |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 bool PictureLayerImpl::HasValidTilePriorities() const { | 1295 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1296 return IsOnActiveOrPendingTree() && | 1296 return IsOnActiveOrPendingTree() && |
| 1297 is_drawn_render_surface_layer_list_member(); | 1297 is_drawn_render_surface_layer_list_member(); |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 } // namespace cc | 1300 } // namespace cc |
| OLD | NEW |