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

Side by Side Diff: ui/compositor/layer.cc

Issue 2049063002: Revert of Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/public/platform/WebLayer.h ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 for (size_t i = 0; i < children_.size(); ++i) { 506 for (size_t i = 0; i < children_.size(); ++i) {
507 DCHECK(children_[i]->cc_layer_); 507 DCHECK(children_[i]->cc_layer_);
508 cc_layer_->AddChild(children_[i]->cc_layer_); 508 cc_layer_->AddChild(children_[i]->cc_layer_);
509 } 509 }
510 cc_layer_->SetLayerClient(this); 510 cc_layer_->SetLayerClient(this);
511 cc_layer_->SetTransformOrigin(gfx::Point3F()); 511 cc_layer_->SetTransformOrigin(gfx::Point3F());
512 cc_layer_->SetContentsOpaque(fills_bounds_opaquely_); 512 cc_layer_->SetContentsOpaque(fills_bounds_opaquely_);
513 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 513 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
514 cc_layer_->SetHideLayerAndSubtree(!visible_); 514 cc_layer_->SetHideLayerAndSubtree(!visible_);
515 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0));
516 515
517 SetLayerFilters(); 516 SetLayerFilters();
518 SetLayerBackgroundFilters(); 517 SetLayerBackgroundFilters();
519 } 518 }
520 519
521 bool Layer::HasPendingThreadedAnimationsForTesting() const { 520 bool Layer::HasPendingThreadedAnimationsForTesting() const {
522 return animator_->HasPendingThreadedAnimationsForTesting(); 521 return animator_->HasPendingThreadedAnimationsForTesting();
523 } 522 }
524 523
525 void Layer::SwitchCCLayerForTest() { 524 void Layer::SwitchCCLayerForTest() {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 nine_patch_layer_ = cc::NinePatchLayer::Create(); 981 nine_patch_layer_ = cc::NinePatchLayer::Create();
983 cc_layer_ = nine_patch_layer_.get(); 982 cc_layer_ = nine_patch_layer_.get();
984 } else { 983 } else {
985 content_layer_ = cc::PictureLayer::Create(this); 984 content_layer_ = cc::PictureLayer::Create(this);
986 cc_layer_ = content_layer_.get(); 985 cc_layer_ = content_layer_.get();
987 } 986 }
988 cc_layer_->SetTransformOrigin(gfx::Point3F()); 987 cc_layer_->SetTransformOrigin(gfx::Point3F());
989 cc_layer_->SetContentsOpaque(true); 988 cc_layer_->SetContentsOpaque(true);
990 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 989 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
991 cc_layer_->SetLayerClient(this); 990 cc_layer_->SetLayerClient(this);
992 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0));
993 RecomputePosition(); 991 RecomputePosition();
994 } 992 }
995 993
996 gfx::Transform Layer::transform() const { 994 gfx::Transform Layer::transform() const {
997 return cc_layer_->transform(); 995 return cc_layer_->transform();
998 } 996 }
999 997
1000 void Layer::RecomputeDrawsContentAndUVRect() { 998 void Layer::RecomputeDrawsContentAndUVRect() {
1001 DCHECK(cc_layer_); 999 DCHECK(cc_layer_);
1002 gfx::Size size(bounds_.size()); 1000 gfx::Size size(bounds_.size());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 if (animator_) { 1049 if (animator_) {
1052 animator_->ResetCompositor(compositor); 1050 animator_->ResetCompositor(compositor);
1053 animator_->RemoveFromCollection(collection); 1051 animator_->RemoveFromCollection(collection);
1054 } 1052 }
1055 1053
1056 for (auto* child : children_) 1054 for (auto* child : children_)
1057 child->ResetCompositorForAnimatorsInTree(compositor); 1055 child->ResetCompositorForAnimatorsInTree(compositor);
1058 } 1056 }
1059 1057
1060 } // namespace ui 1058 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/public/platform/WebLayer.h ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698