| 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 if (force_render_surface_ == force) | 735 if (force_render_surface_ == force) |
| 736 return; | 736 return; |
| 737 | 737 |
| 738 force_render_surface_ = force; | 738 force_render_surface_ = force; |
| 739 cc_layer_->SetForceRenderSurface(force_render_surface_); | 739 cc_layer_->SetForceRenderSurface(force_render_surface_); |
| 740 } | 740 } |
| 741 | 741 |
| 742 class LayerDebugInfo : public base::debug::ConvertableToTraceFormat { | 742 class LayerDebugInfo : public base::debug::ConvertableToTraceFormat { |
| 743 public: | 743 public: |
| 744 explicit LayerDebugInfo(std::string name) : name_(name) { } | 744 explicit LayerDebugInfo(std::string name) : name_(name) { } |
| 745 virtual void AppendAsTraceFormat(std::string* out) const override { | 745 void AppendAsTraceFormat(std::string* out) const override { |
| 746 base::DictionaryValue dictionary; | 746 base::DictionaryValue dictionary; |
| 747 dictionary.SetString("layer_name", name_); | 747 dictionary.SetString("layer_name", name_); |
| 748 base::JSONWriter::Write(&dictionary, out); | 748 base::JSONWriter::Write(&dictionary, out); |
| 749 } | 749 } |
| 750 | 750 |
| 751 private: | 751 private: |
| 752 virtual ~LayerDebugInfo() { } | 752 ~LayerDebugInfo() override {} |
| 753 std::string name_; | 753 std::string name_; |
| 754 }; | 754 }; |
| 755 | 755 |
| 756 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { | 756 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { |
| 757 return new LayerDebugInfo(name_); | 757 return new LayerDebugInfo(name_); |
| 758 } | 758 } |
| 759 | 759 |
| 760 void Layer::OnAnimationStarted(const cc::AnimationEvent& event) { | 760 void Layer::OnAnimationStarted(const cc::AnimationEvent& event) { |
| 761 if (animator_.get()) | 761 if (animator_.get()) |
| 762 animator_->OnThreadedAnimationStarted(event); | 762 animator_->OnThreadedAnimationStarted(event); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 children_.end(), | 1041 children_.end(), |
| 1042 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1042 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1043 collection)); | 1043 collection)); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 bool Layer::IsAnimating() const { | 1046 bool Layer::IsAnimating() const { |
| 1047 return animator_.get() && animator_->is_animating(); | 1047 return animator_.get() && animator_->is_animating(); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 } // namespace ui | 1050 } // namespace ui |
| OLD | NEW |