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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 sk_damaged.height()); | 652 sk_damaged.height()); |
653 cc_layer_->SetNeedsDisplayRect(damaged); | 653 cc_layer_->SetNeedsDisplayRect(damaged); |
654 } | 654 } |
655 damaged_region_.setEmpty(); | 655 damaged_region_.setEmpty(); |
656 } | 656 } |
657 for (size_t i = 0; i < children_.size(); ++i) | 657 for (size_t i = 0; i < children_.size(); ++i) |
658 children_[i]->SendDamagedRects(); | 658 children_[i]->SendDamagedRects(); |
659 } | 659 } |
660 | 660 |
661 void Layer::CompleteAllAnimations() { | 661 void Layer::CompleteAllAnimations() { |
662 std::vector<scoped_refptr<LayerAnimator> > animators; | 662 typedef std::vector<scoped_refptr<LayerAnimator> > LayerAnimatorVector; |
| 663 LayerAnimatorVector animators; |
663 CollectAnimators(&animators); | 664 CollectAnimators(&animators); |
664 std::for_each(animators.begin(), animators.end(), | 665 for (LayerAnimatorVector::const_iterator it = animators.begin(); |
665 std::mem_fun(&LayerAnimator::StopAnimating)); | 666 it != animators.end(); |
| 667 ++it) { |
| 668 (*it)->StopAnimating(); |
| 669 } |
666 } | 670 } |
667 | 671 |
668 void Layer::SuppressPaint() { | 672 void Layer::SuppressPaint() { |
669 if (!delegate_) | 673 if (!delegate_) |
670 return; | 674 return; |
671 delegate_ = NULL; | 675 delegate_ = NULL; |
672 for (size_t i = 0; i < children_.size(); ++i) | 676 for (size_t i = 0; i < children_.size(); ++i) |
673 children_[i]->SuppressPaint(); | 677 children_[i]->SuppressPaint(); |
674 } | 678 } |
675 | 679 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 children_.end(), | 1039 children_.end(), |
1036 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1040 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1037 collection)); | 1041 collection)); |
1038 } | 1042 } |
1039 | 1043 |
1040 bool Layer::IsAnimating() const { | 1044 bool Layer::IsAnimating() const { |
1041 return animator_.get() && animator_->is_animating(); | 1045 return animator_.get() && animator_->is_animating(); |
1042 } | 1046 } |
1043 | 1047 |
1044 } // namespace ui | 1048 } // namespace ui |
OLD | NEW |