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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 gfx::Size size(bounds_.size()); | 946 gfx::Size size(bounds_.size()); |
947 if (texture_layer_.get()) { | 947 if (texture_layer_.get()) { |
948 size.SetToMin(frame_size_in_dip_); | 948 size.SetToMin(frame_size_in_dip_); |
949 gfx::PointF uv_top_left(0.f, 0.f); | 949 gfx::PointF uv_top_left(0.f, 0.f); |
950 gfx::PointF uv_bottom_right( | 950 gfx::PointF uv_bottom_right( |
951 static_cast<float>(size.width()) / frame_size_in_dip_.width(), | 951 static_cast<float>(size.width()) / frame_size_in_dip_.width(), |
952 static_cast<float>(size.height()) / frame_size_in_dip_.height()); | 952 static_cast<float>(size.height()) / frame_size_in_dip_.height()); |
953 texture_layer_->SetUV(uv_top_left, uv_bottom_right); | 953 texture_layer_->SetUV(uv_top_left, uv_bottom_right); |
954 } else if (delegated_renderer_layer_.get()) { | 954 } else if (delegated_renderer_layer_.get()) { |
955 size.SetToMin(frame_size_in_dip_); | 955 size.SetToMin(frame_size_in_dip_); |
956 delegated_renderer_layer_->SetDisplaySize(frame_size_in_dip_); | |
957 } | 956 } |
958 cc_layer_->SetBounds(size); | 957 cc_layer_->SetBounds(size); |
959 } | 958 } |
960 | 959 |
961 void Layer::RecomputePosition() { | 960 void Layer::RecomputePosition() { |
962 cc_layer_->SetPosition(gfx::PointF(bounds_.x(), bounds_.y())); | 961 cc_layer_->SetPosition(gfx::PointF(bounds_.x(), bounds_.y())); |
963 } | 962 } |
964 | 963 |
965 void Layer::AddAnimatorsInTreeToCollection( | 964 void Layer::AddAnimatorsInTreeToCollection( |
966 LayerAnimatorCollection* collection) { | 965 LayerAnimatorCollection* collection) { |
(...skipping 17 matching lines...) Expand all Loading... |
984 children_.end(), | 983 children_.end(), |
985 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 984 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
986 collection)); | 985 collection)); |
987 } | 986 } |
988 | 987 |
989 bool Layer::IsAnimating() const { | 988 bool Layer::IsAnimating() const { |
990 return animator_ && animator_->is_animating(); | 989 return animator_ && animator_->is_animating(); |
991 } | 990 } |
992 | 991 |
993 } // namespace ui | 992 } // namespace ui |
OLD | NEW |