Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1531013004: cc: Do solid color analysis before scheduling tiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698