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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index fb8f70150878e07eaa6e356d4301e0cba92caf19..069ddb75b1859c9684f391b8f39614643f3749d0 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -943,12 +943,7 @@ void PictureLayerImpl::DoPostCommitInitialization() {
if (!tilings_)
tilings_.reset(new PictureLayerTilingSet(this, bounds()));
- DCHECK(!twin_layer_);
- twin_layer_ = static_cast<PictureLayerImpl*>(
- layer_tree_impl()->FindActiveTreeLayerById(id()));
if (twin_layer_) {
- DCHECK(!twin_layer_->twin_layer_);
- twin_layer_->twin_layer_ = this;
// If the twin has never been pushed to, do not sync from it.
// This can happen if this function is called during activation.
if (!twin_layer_->needs_post_commit_initialization_)
@@ -958,6 +953,16 @@ void PictureLayerImpl::DoPostCommitInitialization() {
needs_post_commit_initialization_ = false;
}
+void PictureLayerImpl::UpdateTwinRelationship() {
+ DCHECK(!twin_layer_);
+ twin_layer_ = static_cast<PictureLayerImpl*>(
+ layer_tree_impl()->FindActiveTreeLayerById(id()));
+ if (twin_layer_) {
+ DCHECK(!twin_layer_->twin_layer_);
+ twin_layer_->twin_layer_ = this;
+ }
+}
+
PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
DCHECK(CanHaveTilingWithScale(contents_scale)) <<
"contents_scale: " << contents_scale;
« 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