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