| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |