Chromium Code Reviews| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 // is not cleared after drawing from the layer. However, update_rect() is | 645 // is not cleared after drawing from the layer. However, update_rect() is |
| 646 // cleared once the invalidation is drawn, which is useful for debugging | 646 // cleared once the invalidation is drawn, which is useful for debugging |
| 647 // visualizations. This method intersects the two to give a more exact | 647 // visualizations. This method intersects the two to give a more exact |
| 648 // representation of what was invalidated that is cleared after drawing. | 648 // representation of what was invalidated that is cleared after drawing. |
| 649 return IntersectRegions(invalidation_, update_rect()); | 649 return IntersectRegions(invalidation_, update_rect()); |
| 650 } | 650 } |
| 651 | 651 |
| 652 ScopedTilePtr PictureLayerImpl::CreateTile(const Tile::CreateInfo& info) { | 652 ScopedTilePtr PictureLayerImpl::CreateTile(const Tile::CreateInfo& info) { |
| 653 int flags = 0; | 653 int flags = 0; |
| 654 | 654 |
| 655 // We don't handle solid color masks, so we shouldn't bother analyzing those. | |
| 656 // Otherwise, always analyze to maximize memory savings. | |
| 657 if (!is_mask_) | |
| 658 flags = Tile::USE_PICTURE_ANALYSIS; | |
|
vmpstr
2015/12/29 21:24:23
We should keep respecting this flag, since it woul
sohanjg
2015/12/30 12:45:47
Acknowledged.
| |
| 659 | |
| 660 if (contents_opaque()) | 655 if (contents_opaque()) |
| 661 flags |= Tile::IS_OPAQUE; | 656 flags |= Tile::IS_OPAQUE; |
| 662 | 657 |
| 663 return layer_tree_impl()->tile_manager()->CreateTile( | 658 return layer_tree_impl()->tile_manager()->CreateTile( |
| 664 info, id(), layer_tree_impl()->source_frame_number(), flags); | 659 info, id(), layer_tree_impl()->source_frame_number(), flags); |
| 665 } | 660 } |
| 666 | 661 |
| 667 const Region* PictureLayerImpl::GetPendingInvalidation() { | 662 const Region* PictureLayerImpl::GetPendingInvalidation() { |
| 668 if (layer_tree_impl()->IsPendingTree()) | 663 if (layer_tree_impl()->IsPendingTree()) |
| 669 return &invalidation_; | 664 return &invalidation_; |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1240 | 1235 |
| 1241 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1236 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1242 return !layer_tree_impl()->IsRecycleTree(); | 1237 return !layer_tree_impl()->IsRecycleTree(); |
| 1243 } | 1238 } |
| 1244 | 1239 |
| 1245 bool PictureLayerImpl::HasValidTilePriorities() const { | 1240 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1246 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1241 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| 1247 } | 1242 } |
| 1248 | 1243 |
| 1249 } // namespace cc | 1244 } // namespace cc |
| OLD | NEW |