Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2706)

Unified Diff: ash/wm/window_animations.cc

Issue 11419225: Decouple workspace animation from other actions on windows (e.g. hide/show), so that animations can… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed Daniel's comments Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/workspace/workspace_animations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index d35e465936083865c1ed56f3679fbb95781d4f8a..2cc12ff7f3c1a66f53f44e381213205624ae896b 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 kLayerScaleAboveSize = 1.1f;
+const float kLayerScaleBelowSize = .9f;
+
int64 Round64(float f) {
return static_cast<int64>(f + 0.5f);
}
@@ -220,8 +224,6 @@ void AnimateHideWindow_BrightnessGrayscale(aura::Window* window) {
AnimateShowHideWindowCommon_BrightnessGrayscale(window, false);
}
-
-
bool AnimateShowWindow(aura::Window* window) {
if (!views::corewm::HasWindowVisibilityAnimationTransition(
window, views::corewm::ANIMATE_SHOW)) {
@@ -501,4 +503,17 @@ CreateBrightnessGrayscaleAnimationSequence(float target_value,
return animations;
}
+// Returns scale related to the specified AshWindowScaleType.
+void SetTransformForScaleAnimation(ui::Layer* layer,
+ LayerScaleAnimationDirection type) {
+ const float scale =
+ type == LAYER_SCALE_ANIMATION_ABOVE ? kLayerScaleAboveSize :
+ kLayerScaleBelowSize;
+ 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
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/workspace/workspace_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698