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

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

Issue 503953003: wip: not for commit (update twin relationship) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <limits> 8 #include <limits>
9 9
10 #include "base/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 return twin_had_missing_tile; 936 return twin_had_missing_tile;
937 } 937 }
938 938
939 void PictureLayerImpl::DoPostCommitInitialization() { 939 void PictureLayerImpl::DoPostCommitInitialization() {
940 DCHECK(needs_post_commit_initialization_); 940 DCHECK(needs_post_commit_initialization_);
941 DCHECK(layer_tree_impl()->IsPendingTree()); 941 DCHECK(layer_tree_impl()->IsPendingTree());
942 942
943 if (!tilings_) 943 if (!tilings_)
944 tilings_.reset(new PictureLayerTilingSet(this, bounds())); 944 tilings_.reset(new PictureLayerTilingSet(this, bounds()));
945 945
946 DCHECK(!twin_layer_);
947 twin_layer_ = static_cast<PictureLayerImpl*>(
948 layer_tree_impl()->FindActiveTreeLayerById(id()));
949 if (twin_layer_) { 946 if (twin_layer_) {
950 DCHECK(!twin_layer_->twin_layer_);
951 twin_layer_->twin_layer_ = this;
952 // If the twin has never been pushed to, do not sync from it. 947 // If the twin has never been pushed to, do not sync from it.
953 // This can happen if this function is called during activation. 948 // This can happen if this function is called during activation.
954 if (!twin_layer_->needs_post_commit_initialization_) 949 if (!twin_layer_->needs_post_commit_initialization_)
955 SyncFromActiveLayer(twin_layer_); 950 SyncFromActiveLayer(twin_layer_);
956 } 951 }
957 952
958 needs_post_commit_initialization_ = false; 953 needs_post_commit_initialization_ = false;
959 } 954 }
960 955
956 void PictureLayerImpl::UpdateTwinRelationship() {
957 DCHECK(!twin_layer_);
958 twin_layer_ = static_cast<PictureLayerImpl*>(
959 layer_tree_impl()->FindActiveTreeLayerById(id()));
960 if (twin_layer_) {
961 DCHECK(!twin_layer_->twin_layer_);
962 twin_layer_->twin_layer_ = this;
963 }
964 }
965
961 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) { 966 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
962 DCHECK(CanHaveTilingWithScale(contents_scale)) << 967 DCHECK(CanHaveTilingWithScale(contents_scale)) <<
963 "contents_scale: " << contents_scale; 968 "contents_scale: " << contents_scale;
964 969
965 PictureLayerTiling* tiling = tilings_->AddTiling(contents_scale); 970 PictureLayerTiling* tiling = tilings_->AddTiling(contents_scale);
966 971
967 DCHECK(pile_->HasRecordings()); 972 DCHECK(pile_->HasRecordings());
968 973
969 if (twin_layer_) 974 if (twin_layer_)
970 twin_layer_->SyncTiling(tiling); 975 twin_layer_->SyncTiling(tiling);
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); 1756 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange();
1752 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; 1757 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start;
1753 return tiling_range.end - 1 - current_tiling_range_offset; 1758 return tiling_range.end - 1 - current_tiling_range_offset;
1754 } 1759 }
1755 } 1760 }
1756 NOTREACHED(); 1761 NOTREACHED();
1757 return 0; 1762 return 0;
1758 } 1763 }
1759 1764
1760 } // namespace cc 1765 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698