diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-26 20:13:08 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-26 20:13:08 +0000 |
commit | f7c321eb19e1dd8a2f8b154cacb7e13788f1fc28 (patch) | |
tree | e1f1c285d359f728fd9d270267b881a836dbea0e /ash/system/tray/system_tray_bubble.cc | |
parent | eb052c93fa488df29314bcb70bb2458982fc94c8 (diff) | |
download | chromium_src-f7c321eb19e1dd8a2f8b154cacb7e13788f1fc28.zip chromium_src-f7c321eb19e1dd8a2f8b154cacb7e13788f1fc28.tar.gz chromium_src-f7c321eb19e1dd8a2f8b154cacb7e13788f1fc28.tar.bz2 |
gfx::Transform API clean-up
We have too many ways to do the same thing in gfx::Transform, and their names
can lead to confusion. We have the notion of Concat-ing and Preconcat-ing.
We've borrowed this verbage from skia. a.preConcat(b) means a = a * b. This may
seem counter-intuitive, but is the correct definition if we are multiplying our
points/vectors on the right.
That said, we almost always want to pre-concat. This what is done throughout
WebKit. To simplify matters, rather than having ConcatFoo and PreconcatFoo, we
will now only have Foo which does what PreconcatFoo used to.
Furthermore, we also have SetFoo which is almost always used immediately after
a transform is created, so Foo would do fine (with the optimization mentioned
below).
Another bit of redundant code eliminated by this CL is
InterpolatedTransform::FactorTRS. This function was brittle and naive, and now
that gfx::Transform::Blend exists, it needs to go away.
Other minor changes rolled into this cleanup:
- RotateAbout now takes the newly minted Vector3dF
- The Foo functions mentioned above also check for identity to avoid
needless matrix multiplications.
BUG=159972
Review URL: https://chromiumcodereview.appspot.com/11418040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/tray/system_tray_bubble.cc')
-rw-r--r-- | ash/system/tray/system_tray_bubble.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc index aff2719..0059973 100644 --- a/ash/system/tray/system_tray_bubble.cc +++ b/ash/system/tray/system_tray_bubble.cc @@ -165,7 +165,7 @@ void SystemTrayBubble::UpdateView( settings.SetTransitionDuration(swipe_duration); settings.SetTweenType(ui::Tween::EASE_OUT); gfx::Transform transform; - transform.SetTranslateX(layer->bounds().width()); + transform.Translate(layer->bounds().width(), 0.0); layer->SetTransform(transform); } @@ -218,7 +218,7 @@ void SystemTrayBubble::UpdateView( ui::Layer* new_layer = bubble_view_->layer(); gfx::Rect bounds = new_layer->bounds(); gfx::Transform transform; - transform.SetTranslateX(bounds.width()); + transform.Translate(bounds.width(), 0.0); new_layer->SetTransform(transform); { ui::ScopedLayerAnimationSettings settings(new_layer->GetAnimator()); |