| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 } | 429 } |
| 430 | 430 |
| 431 void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) { | 431 void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) { |
| 432 // Finish animations being handled by cc_layer_. | 432 // Finish animations being handled by cc_layer_. |
| 433 if (animator_.get()) { | 433 if (animator_.get()) { |
| 434 animator_->StopAnimatingProperty(LayerAnimationElement::TRANSFORM); | 434 animator_->StopAnimatingProperty(LayerAnimationElement::TRANSFORM); |
| 435 animator_->StopAnimatingProperty(LayerAnimationElement::OPACITY); | 435 animator_->StopAnimatingProperty(LayerAnimationElement::OPACITY); |
| 436 } | 436 } |
| 437 | 437 |
| 438 if (texture_layer_.get()) | 438 if (texture_layer_.get()) |
| 439 texture_layer_->WillModifyTexture(); | 439 texture_layer_->ClearClient(); |
| 440 // TODO(piman): delegated_renderer_layer_ cleanup. | 440 // TODO(piman): delegated_renderer_layer_ cleanup. |
| 441 | 441 |
| 442 cc_layer_->RemoveAllChildren(); | 442 cc_layer_->RemoveAllChildren(); |
| 443 if (parent_) { | 443 if (parent_) { |
| 444 DCHECK(parent_->cc_layer_); | 444 DCHECK(parent_->cc_layer_); |
| 445 parent_->cc_layer_->ReplaceChild(cc_layer_, new_layer); | 445 parent_->cc_layer_->ReplaceChild(cc_layer_, new_layer); |
| 446 } | 446 } |
| 447 cc_layer_->RemoveLayerAnimationEventObserver(this); | 447 cc_layer_->RemoveLayerAnimationEventObserver(this); |
| 448 new_layer->SetOpacity(cc_layer_->opacity()); | 448 new_layer->SetOpacity(cc_layer_->opacity()); |
| 449 new_layer->SetTransform(cc_layer_->transform()); | 449 new_layer->SetTransform(cc_layer_->transform()); |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
| 965 } | 965 } |
| 966 | 966 |
| 967 void Layer::RecomputePosition() { | 967 void Layer::RecomputePosition() { |
| 968 cc_layer_->SetPosition(gfx::ScalePoint( | 968 cc_layer_->SetPosition(gfx::ScalePoint( |
| 969 gfx::PointF(bounds_.x(), bounds_.y()), | 969 gfx::PointF(bounds_.x(), bounds_.y()), |
| 970 device_scale_factor_)); | 970 device_scale_factor_)); |
| 971 } | 971 } |
| 972 | 972 |
| 973 } // namespace ui | 973 } // namespace ui |
| OLD | NEW |