diff options
author | antrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 00:15:01 +0000 |
---|---|---|
committer | antrim@chromium.org <antrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 00:15:01 +0000 |
commit | b750dac8b02b2042db9f905ff6fed378fe80b9f7 (patch) | |
tree | 87ed527877bc373e9aa70ac313cfd55dca1bb7b9 /ui | |
parent | d3dbe56ed8296f5ccd843d2cb361e9b161418638 (diff) | |
download | chromium_src-b750dac8b02b2042db9f905ff6fed378fe80b9f7.zip chromium_src-b750dac8b02b2042db9f905ff6fed378fe80b9f7.tar.gz chromium_src-b750dac8b02b2042db9f905ff6fed378fe80b9f7.tar.bz2 |
Use TargetTransform instead of transform in ConvertPointFor/FromAncestor
Shell::SetDisplayWorkAreaInsets (called from ShelfLayoutManager if launcher was set to autohide) applied while some
containers were transform-animated (lock window animation) resulted in incorrect offsets.
BUG=167215
Review URL: https://chromiumcodereview.appspot.com/11682006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/compositor/layer.cc | 12 | ||||
-rw-r--r-- | ui/compositor/layer.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index caf1af0..7c43b7b 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -581,7 +581,7 @@ void Layer::StackRelativeTo(Layer* child, Layer* other, bool above) { bool Layer::ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const { gfx::Transform transform; - bool result = GetTransformRelativeTo(ancestor, &transform); + bool result = GetTargetTransformRelativeTo(ancestor, &transform); gfx::Point3F p(*point); transform.TransformPoint(p); *point = gfx::ToFlooredPoint(p.AsPointF()); @@ -591,22 +591,24 @@ bool Layer::ConvertPointForAncestor(const Layer* ancestor, bool Layer::ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const { gfx::Transform transform; - bool result = GetTransformRelativeTo(ancestor, &transform); + bool result = GetTargetTransformRelativeTo(ancestor, &transform); gfx::Point3F p(*point); transform.TransformPointReverse(p); *point = gfx::ToFlooredPoint(p.AsPointF()); return result; } -bool Layer::GetTransformRelativeTo(const Layer* ancestor, +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())); - if (!p->transform().IsIdentity()) - transform->ConcatTransform(p->transform()); + // 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; diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h index 20887fd..b35cf0b 100644 --- a/ui/compositor/layer.h +++ b/ui/compositor/layer.h @@ -295,8 +295,8 @@ class COMPOSITOR_EXPORT Layer bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; - bool GetTransformRelativeTo(const Layer* ancestor, - gfx::Transform* transform) const; + bool GetTargetTransformRelativeTo(const Layer* ancestor, + gfx::Transform* transform) const; // The only externally updated layers are ones that get their pixels from // WebKit and WebKit does not produce valid alpha values. All other layers |