Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index 36d56f26ebb6644e024eb215bca060aa7d2f67fd..5e505d711cd207d0c9bb05668e93d253d3a98801 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -13,7 +13,6 @@ |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/trace_event/trace_event.h" |
| -#include "cc/base/scoped_ptr_algorithm.h" |
| #include "cc/layers/delegated_renderer_layer.h" |
| #include "cc/layers/nine_patch_layer.h" |
| #include "cc/layers/picture_layer.h" |
| @@ -983,22 +982,6 @@ void Layer::AddThreadedAnimation(scoped_ptr<cc::Animation> animation) { |
| pending_threaded_animations_.push_back(animation.Pass()); |
| } |
| -namespace{ |
| - |
| -struct HasAnimationId { |
| - HasAnimationId(int id): id_(id) { |
| - } |
| - |
| - bool operator()(cc::Animation* animation) const { |
| - return animation->id() == id_; |
| - } |
| - |
| - private: |
| - int id_; |
| -}; |
| - |
| -} |
| - |
| void Layer::RemoveThreadedAnimation(int animation_id) { |
| DCHECK(cc_layer_); |
| if (pending_threaded_animations_.size() == 0) { |
| @@ -1007,10 +990,12 @@ void Layer::RemoveThreadedAnimation(int animation_id) { |
| } |
| pending_threaded_animations_.erase( |
| - cc::remove_if(&pending_threaded_animations_, |
| - pending_threaded_animations_.begin(), |
| - pending_threaded_animations_.end(), |
| - HasAnimationId(animation_id)), |
| + std::remove_if( |
| + pending_threaded_animations_.begin(), |
| + pending_threaded_animations_.end(), |
| + [animation_id](const scoped_ptr<cc::Animation>& animation) { |
| + return animation->id() == animation_id; |
| + }), |
| pending_threaded_animations_.end()); |
| } |
| @@ -1020,11 +1005,9 @@ LayerAnimatorCollection* Layer::GetLayerAnimatorCollection() { |
| } |
| void Layer::SendPendingThreadedAnimations() { |
| - for (cc::ScopedPtrVector<cc::Animation>::iterator it = |
| - pending_threaded_animations_.begin(); |
| - it != pending_threaded_animations_.end(); |
| - ++it) |
| - cc_layer_->AddAnimation(pending_threaded_animations_.take(it)); |
| + for (auto it = pending_threaded_animations_.begin(); |
|
danakj
2015/11/17 01:12:19
range-based and auto
vmpstr
2015/11/17 23:26:25
Done.
|
| + it != pending_threaded_animations_.end(); ++it) |
| + cc_layer_->AddAnimation(it->Pass()); |
| pending_threaded_animations_.clear(); |