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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 631 |
632 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, | 632 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, |
633 const gfx::Rect& content_rect) { | 633 const gfx::Rect& content_rect) { |
634 int flags = 0; | 634 int flags = 0; |
635 | 635 |
636 // We don't handle solid color masks, so we shouldn't bother analyzing those. | 636 // We don't handle solid color masks, so we shouldn't bother analyzing those. |
637 // Otherwise, always analyze to maximize memory savings. | 637 // Otherwise, always analyze to maximize memory savings. |
638 if (!is_mask_) | 638 if (!is_mask_) |
639 flags = Tile::USE_PICTURE_ANALYSIS; | 639 flags = Tile::USE_PICTURE_ANALYSIS; |
640 | 640 |
| 641 if (contents_opaque()) |
| 642 flags |= Tile::IS_OPAQUE; |
| 643 |
641 return layer_tree_impl()->tile_manager()->CreateTile( | 644 return layer_tree_impl()->tile_manager()->CreateTile( |
642 content_rect.size(), content_rect, contents_scale, id(), | 645 content_rect.size(), content_rect, contents_scale, id(), |
643 layer_tree_impl()->source_frame_number(), flags); | 646 layer_tree_impl()->source_frame_number(), flags); |
644 } | 647 } |
645 | 648 |
646 const Region* PictureLayerImpl::GetPendingInvalidation() { | 649 const Region* PictureLayerImpl::GetPendingInvalidation() { |
647 if (layer_tree_impl()->IsPendingTree()) | 650 if (layer_tree_impl()->IsPendingTree()) |
648 return &invalidation_; | 651 return &invalidation_; |
649 if (layer_tree_impl()->IsRecycleTree()) | 652 if (layer_tree_impl()->IsRecycleTree()) |
650 return nullptr; | 653 return nullptr; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 | 1236 |
1234 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1237 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1235 return !layer_tree_impl()->IsRecycleTree(); | 1238 return !layer_tree_impl()->IsRecycleTree(); |
1236 } | 1239 } |
1237 | 1240 |
1238 bool PictureLayerImpl::HasValidTilePriorities() const { | 1241 bool PictureLayerImpl::HasValidTilePriorities() const { |
1239 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1242 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1240 } | 1243 } |
1241 | 1244 |
1242 } // namespace cc | 1245 } // namespace cc |
OLD | NEW |