| 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 } | 726 } |
| 727 | 727 |
| 728 void Layer::SetForceRenderSurface(bool force) { | 728 void Layer::SetForceRenderSurface(bool force) { |
| 729 if (force_render_surface_ == force) | 729 if (force_render_surface_ == force) |
| 730 return; | 730 return; |
| 731 | 731 |
| 732 force_render_surface_ = force; | 732 force_render_surface_ = force; |
| 733 cc_layer_->SetForceRenderSurface(force_render_surface_); | 733 cc_layer_->SetForceRenderSurface(force_render_surface_); |
| 734 } | 734 } |
| 735 | 735 |
| 736 class LayerDebugInfo : public base::debug::ConvertableToTraceFormat { | 736 class UILayerDebugInfo : public cc::LayerDebugInfo { |
| 737 public: | 737 public: |
| 738 explicit LayerDebugInfo(std::string name) : name_(name) { } | 738 explicit UILayerDebugInfo(std::string name) : name_(name) {} |
| 739 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE { | 739 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE { |
| 740 base::DictionaryValue dictionary; | 740 base::DictionaryValue dictionary; |
| 741 dictionary.SetString("layer_name", name_); | 741 dictionary.SetString("layer_name", name_); |
| 742 base::JSONWriter::Write(&dictionary, out); | 742 base::JSONWriter::Write(&dictionary, out); |
| 743 } | 743 } |
| 744 virtual bool IncludesFirstPaintInvalidation() const OVERRIDE { return false; } |
| 744 | 745 |
| 745 private: | 746 private: |
| 746 virtual ~LayerDebugInfo() { } | 747 virtual ~UILayerDebugInfo() {} |
| 747 std::string name_; | 748 std::string name_; |
| 748 }; | 749 }; |
| 749 | 750 |
| 750 scoped_refptr<base::debug::ConvertableToTraceFormat> Layer::TakeDebugInfo() { | 751 scoped_refptr<cc::LayerDebugInfo> Layer::TakeDebugInfo() { |
| 751 return new LayerDebugInfo(name_); | 752 return new UILayerDebugInfo(name_); |
| 752 } | 753 } |
| 753 | 754 |
| 754 void Layer::OnAnimationStarted(const cc::AnimationEvent& event) { | 755 void Layer::OnAnimationStarted(const cc::AnimationEvent& event) { |
| 755 if (animator_.get()) | 756 if (animator_.get()) |
| 756 animator_->OnThreadedAnimationStarted(event); | 757 animator_->OnThreadedAnimationStarted(event); |
| 757 } | 758 } |
| 758 | 759 |
| 759 void Layer::CollectAnimators( | 760 void Layer::CollectAnimators( |
| 760 std::vector<scoped_refptr<LayerAnimator> >* animators) { | 761 std::vector<scoped_refptr<LayerAnimator> >* animators) { |
| 761 if (IsAnimating()) | 762 if (IsAnimating()) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 children_.end(), | 1036 children_.end(), |
| 1036 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1037 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1037 collection)); | 1038 collection)); |
| 1038 } | 1039 } |
| 1039 | 1040 |
| 1040 bool Layer::IsAnimating() const { | 1041 bool Layer::IsAnimating() const { |
| 1041 return animator_ && animator_->is_animating(); | 1042 return animator_ && animator_->is_animating(); |
| 1042 } | 1043 } |
| 1043 | 1044 |
| 1044 } // namespace ui | 1045 } // namespace ui |
| OLD | NEW |