| 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 SkColor Layer::GetColorForAnimation() const { | 797 SkColor Layer::GetColorForAnimation() const { |
| 798 // WebColor is equivalent to SkColor, per WebColor.h. | 798 // WebColor is equivalent to SkColor, per WebColor.h. |
| 799 // The NULL check is here since this is invoked regardless of whether we have | 799 // The NULL check is here since this is invoked regardless of whether we have |
| 800 // been configured as LAYER_SOLID_COLOR. | 800 // been configured as LAYER_SOLID_COLOR. |
| 801 return solid_color_layer_.get() ? | 801 return solid_color_layer_.get() ? |
| 802 solid_color_layer_->backgroundColor() : SK_ColorBLACK; | 802 solid_color_layer_->backgroundColor() : SK_ColorBLACK; |
| 803 } | 803 } |
| 804 | 804 |
| 805 void Layer::AddThreadedAnimation(scoped_ptr<cc::Animation> animation) { | 805 void Layer::AddThreadedAnimation(scoped_ptr<cc::Animation> animation) { |
| 806 DCHECK(cc_layer_); | 806 DCHECK(cc_layer_); |
| 807 cc_layer_->addAnimation(animation.Pass()); | 807 cc_layer_->AddAnimation(animation.Pass()); |
| 808 } | 808 } |
| 809 | 809 |
| 810 void Layer::RemoveThreadedAnimation(int animation_id) { | 810 void Layer::RemoveThreadedAnimation(int animation_id) { |
| 811 DCHECK(cc_layer_); | 811 DCHECK(cc_layer_); |
| 812 cc_layer_->removeAnimation(animation_id); | 812 cc_layer_->RemoveAnimation(animation_id); |
| 813 } | 813 } |
| 814 | 814 |
| 815 void Layer::CreateWebLayer() { | 815 void Layer::CreateWebLayer() { |
| 816 if (type_ == LAYER_SOLID_COLOR) { | 816 if (type_ == LAYER_SOLID_COLOR) { |
| 817 solid_color_layer_ = cc::SolidColorLayer::Create(); | 817 solid_color_layer_ = cc::SolidColorLayer::Create(); |
| 818 cc_layer_ = solid_color_layer_.get(); | 818 cc_layer_ = solid_color_layer_.get(); |
| 819 } else { | 819 } else { |
| 820 content_layer_ = cc::ContentLayer::create(this); | 820 content_layer_ = cc::ContentLayer::create(this); |
| 821 cc_layer_ = content_layer_.get(); | 821 cc_layer_ = content_layer_.get(); |
| 822 } | 822 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 texture_layer_->setUV(uv_top_left, uv_bottom_right); | 862 texture_layer_->setUV(uv_top_left, uv_bottom_right); |
| 863 } else if (delegated_renderer_layer_.get()) { | 863 } else if (delegated_renderer_layer_.get()) { |
| 864 delegated_renderer_layer_->SetDisplaySize( | 864 delegated_renderer_layer_->SetDisplaySize( |
| 865 ConvertSizeToPixel(this, delegated_frame_size_in_dip_)); | 865 ConvertSizeToPixel(this, delegated_frame_size_in_dip_)); |
| 866 size.ClampToMax(delegated_frame_size_in_dip_); | 866 size.ClampToMax(delegated_frame_size_in_dip_); |
| 867 } | 867 } |
| 868 cc_layer_->setBounds(ConvertSizeToPixel(this, size)); | 868 cc_layer_->setBounds(ConvertSizeToPixel(this, size)); |
| 869 } | 869 } |
| 870 | 870 |
| 871 } // namespace ui | 871 } // namespace ui |
| OLD | NEW |