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

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

Issue 1318733006: cc: Do the math for a tile's content rect in layer space once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 620
621 Region PictureLayerImpl::GetInvalidationRegion() { 621 Region PictureLayerImpl::GetInvalidationRegion() {
622 // |invalidation_| gives the invalidation contained in the source frame, but 622 // |invalidation_| gives the invalidation contained in the source frame, but
623 // is not cleared after drawing from the layer. However, update_rect() is 623 // is not cleared after drawing from the layer. However, update_rect() is
624 // cleared once the invalidation is drawn, which is useful for debugging 624 // cleared once the invalidation is drawn, which is useful for debugging
625 // visualizations. This method intersects the two to give a more exact 625 // visualizations. This method intersects the two to give a more exact
626 // representation of what was invalidated that is cleared after drawing. 626 // representation of what was invalidated that is cleared after drawing.
627 return IntersectRegions(invalidation_, update_rect()); 627 return IntersectRegions(invalidation_, update_rect());
628 } 628 }
629 629
630 ScopedTilePtr PictureLayerImpl::CreateTile(float contents_scale, 630 ScopedTilePtr PictureLayerImpl::CreateTile(const Tile::CreateInfo& info) {
631 const gfx::Rect& content_rect) {
632 int flags = 0; 631 int flags = 0;
633 632
634 // We don't handle solid color masks, so we shouldn't bother analyzing those. 633 // We don't handle solid color masks, so we shouldn't bother analyzing those.
635 // Otherwise, always analyze to maximize memory savings. 634 // Otherwise, always analyze to maximize memory savings.
636 if (!is_mask_) 635 if (!is_mask_)
637 flags = Tile::USE_PICTURE_ANALYSIS; 636 flags = Tile::USE_PICTURE_ANALYSIS;
638 637
639 return layer_tree_impl()->tile_manager()->CreateTile( 638 return layer_tree_impl()->tile_manager()->CreateTile(
640 content_rect.size(), content_rect, contents_scale, id(), 639 info, id(), layer_tree_impl()->source_frame_number(), flags);
641 layer_tree_impl()->source_frame_number(), flags);
642 } 640 }
643 641
644 const Region* PictureLayerImpl::GetPendingInvalidation() { 642 const Region* PictureLayerImpl::GetPendingInvalidation() {
645 if (layer_tree_impl()->IsPendingTree()) 643 if (layer_tree_impl()->IsPendingTree())
646 return &invalidation_; 644 return &invalidation_;
647 if (layer_tree_impl()->IsRecycleTree()) 645 if (layer_tree_impl()->IsRecycleTree())
648 return nullptr; 646 return nullptr;
649 DCHECK(layer_tree_impl()->IsActiveTree()); 647 DCHECK(layer_tree_impl()->IsActiveTree());
650 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer()) 648 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer())
651 return &twin_layer->invalidation_; 649 return &twin_layer->invalidation_;
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1236
1239 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1237 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1240 return !layer_tree_impl()->IsRecycleTree(); 1238 return !layer_tree_impl()->IsRecycleTree();
1241 } 1239 }
1242 1240
1243 bool PictureLayerImpl::HasValidTilePriorities() const { 1241 bool PictureLayerImpl::HasValidTilePriorities() const {
1244 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1242 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1245 } 1243 }
1246 1244
1247 } // namespace cc 1245 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698