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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 raster_source_->SetImageDecodeController( | 642 raster_source_->SetImageDecodeController( |
643 layer_tree_impl()->image_decode_controller()); | 643 layer_tree_impl()->image_decode_controller()); |
644 } | 644 } |
645 | 645 |
646 // To avoid an edge case after lost context where the tree is up to date but | 646 // To avoid an edge case after lost context where the tree is up to date but |
647 // the tilings have not been managed, request an update draw properties | 647 // the tilings have not been managed, request an update draw properties |
648 // to force tilings to get managed. | 648 // to force tilings to get managed. |
649 layer_tree_impl()->set_needs_update_draw_properties(); | 649 layer_tree_impl()->set_needs_update_draw_properties(); |
650 } | 650 } |
651 | 651 |
652 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { | 652 sk_sp<SkPicture> PictureLayerImpl::GetPicture() { |
653 return raster_source_->GetFlattenedPicture(); | 653 return raster_source_->GetFlattenedPicture(); |
654 } | 654 } |
655 | 655 |
656 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { | 656 Region PictureLayerImpl::GetInvalidationRegionForDebugging() { |
657 // |invalidation_| gives the invalidation contained in the source frame, but | 657 // |invalidation_| gives the invalidation contained in the source frame, but |
658 // is not cleared after drawing from the layer. However, update_rect() is | 658 // is not cleared after drawing from the layer. However, update_rect() is |
659 // cleared once the invalidation is drawn, which is useful for debugging | 659 // cleared once the invalidation is drawn, which is useful for debugging |
660 // visualizations. This method intersects the two to give a more exact | 660 // visualizations. This method intersects the two to give a more exact |
661 // representation of what was invalidated that is cleared after drawing. | 661 // representation of what was invalidated that is cleared after drawing. |
662 return IntersectRegions(invalidation_, update_rect()); | 662 return IntersectRegions(invalidation_, update_rect()); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 | 1259 |
1260 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1260 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1261 return !layer_tree_impl()->IsRecycleTree(); | 1261 return !layer_tree_impl()->IsRecycleTree(); |
1262 } | 1262 } |
1263 | 1263 |
1264 bool PictureLayerImpl::HasValidTilePriorities() const { | 1264 bool PictureLayerImpl::HasValidTilePriorities() const { |
1265 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1265 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1266 } | 1266 } |
1267 | 1267 |
1268 } // namespace cc | 1268 } // namespace cc |
OLD | NEW |