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 <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 Region PictureLayerImpl::GetInvalidationRegion() { | 612 Region PictureLayerImpl::GetInvalidationRegion() { |
613 // |invalidation_| gives the invalidation contained in the source frame, but | 613 // |invalidation_| gives the invalidation contained in the source frame, but |
614 // is not cleared after drawing from the layer. However, update_rect() is | 614 // is not cleared after drawing from the layer. However, update_rect() is |
615 // cleared once the invalidation is drawn, which is useful for debugging | 615 // cleared once the invalidation is drawn, which is useful for debugging |
616 // visualizations. This method intersects the two to give a more exact | 616 // visualizations. This method intersects the two to give a more exact |
617 // representation of what was invalidated that is cleared after drawing. | 617 // representation of what was invalidated that is cleared after drawing. |
618 return IntersectRegions(invalidation_, update_rect()); | 618 return IntersectRegions(invalidation_, update_rect()); |
619 } | 619 } |
620 | 620 |
621 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, | 621 scoped_refptr<Tile> PictureLayerImpl::CreateTile( |
622 const gfx::Rect& content_rect) { | 622 float contents_scale, |
| 623 const gfx::Rect& content_rect) { |
623 int flags = 0; | 624 int flags = 0; |
624 | 625 |
625 // We don't handle solid color masks, so we shouldn't bother analyzing those. | 626 // We don't handle solid color masks, so we shouldn't bother analyzing those. |
626 // Otherwise, always analyze to maximize memory savings. | 627 // Otherwise, always analyze to maximize memory savings. |
627 if (!is_mask_) | 628 if (!is_mask_) |
628 flags = Tile::USE_PICTURE_ANALYSIS; | 629 flags = Tile::USE_PICTURE_ANALYSIS; |
629 | 630 |
630 return layer_tree_impl()->tile_manager()->CreateTile( | 631 return layer_tree_impl()->tile_manager()->CreateTile( |
631 raster_source_.get(), content_rect.size(), content_rect, contents_scale, | 632 raster_source_.get(), content_rect.size(), content_rect, contents_scale, |
632 id(), layer_tree_impl()->source_frame_number(), flags); | 633 id(), layer_tree_impl()->source_frame_number(), flags); |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 | 1244 |
1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1245 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1245 return !layer_tree_impl()->IsRecycleTree(); | 1246 return !layer_tree_impl()->IsRecycleTree(); |
1246 } | 1247 } |
1247 | 1248 |
1248 bool PictureLayerImpl::HasValidTilePriorities() const { | 1249 bool PictureLayerImpl::HasValidTilePriorities() const { |
1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1250 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1250 } | 1251 } |
1251 | 1252 |
1252 } // namespace cc | 1253 } // namespace cc |
OLD | NEW |