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

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

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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));
515 516
516 SetLayerFilters(); 517 SetLayerFilters();
517 SetLayerBackgroundFilters(); 518 SetLayerBackgroundFilters();
518 } 519 }
519 520
520 bool Layer::HasPendingThreadedAnimationsForTesting() const { 521 bool Layer::HasPendingThreadedAnimationsForTesting() const {
521 return animator_->HasPendingThreadedAnimationsForTesting(); 522 return animator_->HasPendingThreadedAnimationsForTesting();
522 } 523 }
523 524
524 void Layer::SwitchCCLayerForTest() { 525 void Layer::SwitchCCLayerForTest() {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 nine_patch_layer_ = cc::NinePatchLayer::Create(); 982 nine_patch_layer_ = cc::NinePatchLayer::Create();
982 cc_layer_ = nine_patch_layer_.get(); 983 cc_layer_ = nine_patch_layer_.get();
983 } else { 984 } else {
984 content_layer_ = cc::PictureLayer::Create(this); 985 content_layer_ = cc::PictureLayer::Create(this);
985 cc_layer_ = content_layer_.get(); 986 cc_layer_ = content_layer_.get();
986 } 987 }
987 cc_layer_->SetTransformOrigin(gfx::Point3F()); 988 cc_layer_->SetTransformOrigin(gfx::Point3F());
988 cc_layer_->SetContentsOpaque(true); 989 cc_layer_->SetContentsOpaque(true);
989 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 990 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
990 cc_layer_->SetLayerClient(this); 991 cc_layer_->SetLayerClient(this);
992 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0));
991 RecomputePosition(); 993 RecomputePosition();
992 } 994 }
993 995
994 gfx::Transform Layer::transform() const { 996 gfx::Transform Layer::transform() const {
995 return cc_layer_->transform(); 997 return cc_layer_->transform();
996 } 998 }
997 999
998 void Layer::RecomputeDrawsContentAndUVRect() { 1000 void Layer::RecomputeDrawsContentAndUVRect() {
999 DCHECK(cc_layer_); 1001 DCHECK(cc_layer_);
1000 gfx::Size size(bounds_.size()); 1002 gfx::Size size(bounds_.size());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (animator_) { 1051 if (animator_) {
1050 animator_->ResetCompositor(compositor); 1052 animator_->ResetCompositor(compositor);
1051 animator_->RemoveFromCollection(collection); 1053 animator_->RemoveFromCollection(collection);
1052 } 1054 }
1053 1055
1054 for (auto* child : children_) 1056 for (auto* child : children_)
1055 child->ResetCompositorForAnimatorsInTree(compositor); 1057 child->ResetCompositorForAnimatorsInTree(compositor);
1056 } 1058 }
1057 1059
1058 } // namespace ui 1060 } // 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