Index: ash/wm/window_animations.cc |
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc |
index d35e465936083865c1ed56f3679fbb95781d4f8a..6b2c3c27f15ffa8e004f7f5065b7172b91d1fabb 100644 |
--- a/ash/wm/window_animations.cc |
+++ b/ash/wm/window_animations.cc |
@@ -62,6 +62,10 @@ const float kWindowAnimation_MinimizeRotate = 0.f; |
// Tween type when cross fading a workspace window. |
const ui::Tween::Type kCrossFadeTweenType = ui::Tween::EASE_IN_OUT; |
+// Scales for AshWindow above/below current workspace. |
+const float kAshWindowScaleAbove = 1.1f; |
Daniel Erat
2012/11/30 14:33:08
kLayerScaleAboveSize, kLayerScaleBelowSize
|
+const float kAshWindowScaleBelow = .9f; |
+ |
int64 Round64(float f) { |
return static_cast<int64>(f + 0.5f); |
} |
@@ -501,4 +505,16 @@ CreateBrightnessGrayscaleAnimationSequence(float target_value, |
return animations; |
} |
+// Returns scale related to the specified AshWindowScaleType. |
+void ApplyAshWindowAnimationScale(ui::Layer* layer, |
+ AshWindowScaleType type) { |
+ const float scale = type == ASH_WINDOW_SCALE_ABOVE ? kAshWindowScaleAbove : |
+ kAshWindowScaleBelow; |
+ gfx::Transform transform; |
+ transform.Translate(-layer->bounds().width() * (scale - 1.0f) / 2, |
+ -layer->bounds().height() * (scale - 1.0f) / 2); |
+ transform.Scale(scale, scale); |
+ layer->SetTransform(transform); |
+} |
+ |
} // namespace ash |