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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, | 621 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, |
622 const gfx::Rect& content_rect) { | 622 const gfx::Rect& content_rect) { |
623 int flags = 0; | 623 int flags = 0; |
624 | 624 |
625 // We don't handle solid color masks, so we shouldn't bother analyzing those. | 625 // We don't handle solid color masks, so we shouldn't bother analyzing those. |
626 // Otherwise, always analyze to maximize memory savings. | 626 // Otherwise, always analyze to maximize memory savings. |
627 if (!is_mask_) | 627 if (!is_mask_) |
628 flags = Tile::USE_PICTURE_ANALYSIS; | 628 flags = Tile::USE_PICTURE_ANALYSIS; |
629 | 629 |
630 return layer_tree_impl()->tile_manager()->CreateTile( | 630 return layer_tree_impl()->tile_manager()->CreateTile( |
631 raster_source_.get(), content_rect.size(), content_rect, contents_scale, | 631 content_rect.size(), content_rect, contents_scale, id(), |
632 id(), layer_tree_impl()->source_frame_number(), flags); | 632 layer_tree_impl()->source_frame_number(), flags); |
633 } | 633 } |
634 | 634 |
635 const Region* PictureLayerImpl::GetPendingInvalidation() { | 635 const Region* PictureLayerImpl::GetPendingInvalidation() { |
636 if (layer_tree_impl()->IsPendingTree()) | 636 if (layer_tree_impl()->IsPendingTree()) |
637 return &invalidation_; | 637 return &invalidation_; |
638 if (layer_tree_impl()->IsRecycleTree()) | 638 if (layer_tree_impl()->IsRecycleTree()) |
639 return nullptr; | 639 return nullptr; |
640 DCHECK(layer_tree_impl()->IsActiveTree()); | 640 DCHECK(layer_tree_impl()->IsActiveTree()); |
641 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer()) | 641 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer()) |
642 return &twin_layer->invalidation_; | 642 return &twin_layer->invalidation_; |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 | 1243 |
1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1245 return !layer_tree_impl()->IsRecycleTree(); | 1245 return !layer_tree_impl()->IsRecycleTree(); |
1246 } | 1246 } |
1247 | 1247 |
1248 bool PictureLayerImpl::HasValidTilePriorities() const { | 1248 bool PictureLayerImpl::HasValidTilePriorities() const { |
1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1250 } | 1250 } |
1251 | 1251 |
1252 } // namespace cc | 1252 } // namespace cc |
OLD | NEW |