| 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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 } | 646 } |
| 647 | 647 |
| 648 void Layer::UpdateNinePatchLayerBorder(const gfx::Rect& border) { | 648 void Layer::UpdateNinePatchLayerBorder(const gfx::Rect& border) { |
| 649 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); | 649 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); |
| 650 nine_patch_layer_->SetBorder(border); | 650 nine_patch_layer_->SetBorder(border); |
| 651 } | 651 } |
| 652 | 652 |
| 653 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); } | 653 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); } |
| 654 | 654 |
| 655 SkColor Layer::GetTargetColor() { | 655 SkColor Layer::GetTargetColor() { |
| 656 return GetAnimator()->GetTargetColor(); | 656 if (GetAnimator()->IsAnimatingProperty(LayerAnimationElement::COLOR)) |
| 657 return GetAnimator()->GetTargetColor(); |
| 658 return cc_layer_->background_color(); |
| 657 } | 659 } |
| 658 | 660 |
| 659 SkColor Layer::background_color() const { | 661 SkColor Layer::background_color() const { |
| 660 return cc_layer_->background_color(); | 662 return cc_layer_->background_color(); |
| 661 } | 663 } |
| 662 | 664 |
| 663 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { | 665 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { |
| 664 if ((type_ == LAYER_SOLID_COLOR && !texture_layer_.get()) || | 666 if ((type_ == LAYER_SOLID_COLOR && !texture_layer_.get()) || |
| 665 type_ == LAYER_NINE_PATCH || (!delegate_ && !mailbox_.IsValid())) | 667 type_ == LAYER_NINE_PATCH || (!delegate_ && !mailbox_.IsValid())) |
| 666 return false; | 668 return false; |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 children_.end(), | 1095 children_.end(), |
| 1094 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1096 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1095 collection)); | 1097 collection)); |
| 1096 } | 1098 } |
| 1097 | 1099 |
| 1098 bool Layer::IsAnimating() const { | 1100 bool Layer::IsAnimating() const { |
| 1099 return animator_.get() && animator_->is_animating(); | 1101 return animator_.get() && animator_->is_animating(); |
| 1100 } | 1102 } |
| 1101 | 1103 |
| 1102 } // namespace ui | 1104 } // namespace ui |
| OLD | NEW |