| Index: ui/compositor/layer.cc
|
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
|
| index 21af90620918d02272745eab724e11d734fa44bd..f5e7f94c50d14f65012d3df333ccfea878f8c307 100644
|
| --- a/ui/compositor/layer.cc
|
| +++ b/ui/compositor/layer.cc
|
| @@ -406,6 +406,22 @@ void Layer::ConvertPointToLayer(const Layer* source,
|
| target->ConvertPointFromAncestor(root_layer, point);
|
| }
|
|
|
| +bool Layer::GetTargetTransformRelativeTo(const Layer* ancestor,
|
| + gfx::Transform* transform) const {
|
| + const Layer* p = this;
|
| + for (; p && p != ancestor; p = p->parent()) {
|
| + gfx::Transform translation;
|
| + translation.Translate(static_cast<float>(p->bounds().x()),
|
| + static_cast<float>(p->bounds().y()));
|
| + // Use target transform so that result will be correct once animation is
|
| + // finished.
|
| + if (!p->GetTargetTransform().IsIdentity())
|
| + transform->ConcatTransform(p->GetTargetTransform());
|
| + transform->ConcatTransform(translation);
|
| + }
|
| + return p == ancestor;
|
| +}
|
| +
|
| // static
|
| gfx::Transform Layer::ConvertTransformToCCTransform(
|
| const gfx::Transform& transform,
|
| @@ -680,22 +696,6 @@ bool Layer::ConvertPointFromAncestor(const Layer* ancestor,
|
| return result;
|
| }
|
|
|
| -bool Layer::GetTargetTransformRelativeTo(const Layer* ancestor,
|
| - gfx::Transform* transform) const {
|
| - const Layer* p = this;
|
| - for (; p && p != ancestor; p = p->parent()) {
|
| - gfx::Transform translation;
|
| - translation.Translate(static_cast<float>(p->bounds().x()),
|
| - static_cast<float>(p->bounds().y()));
|
| - // Use target transform so that result will be correct once animation is
|
| - // finished.
|
| - if (!p->GetTargetTransform().IsIdentity())
|
| - transform->ConcatTransform(p->GetTargetTransform());
|
| - transform->ConcatTransform(translation);
|
| - }
|
| - return p == ancestor;
|
| -}
|
| -
|
| void Layer::SetBoundsImmediately(const gfx::Rect& bounds) {
|
| if (bounds == bounds_)
|
| return;
|
|
|