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

Side by Side Diff: ash/wm/window_animations.cc

Issue 134453004: Use a bitfield to store animatable properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another win build error (signed/unsigned comp). Created 6 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_animations.h" 5 #include "ash/wm/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 transition->set_tween_type( 115 transition->set_tween_type(
116 show ? gfx::Tween::EASE_IN : gfx::Tween::EASE_IN_OUT); 116 show ? gfx::Tween::EASE_IN : gfx::Tween::EASE_IN_OUT);
117 117
118 window->layer()->GetAnimator()->ScheduleAnimation( 118 window->layer()->GetAnimator()->ScheduleAnimation(
119 new ui::LayerAnimationSequence(transition.release())); 119 new ui::LayerAnimationSequence(transition.release()));
120 120
121 // When hiding a window, turn off blending until the animation is 3 / 4 done 121 // When hiding a window, turn off blending until the animation is 3 / 4 done
122 // to save bandwidth and reduce jank. 122 // to save bandwidth and reduce jank.
123 if (!show) { 123 if (!show) {
124 window->layer()->GetAnimator()->SchedulePauseForProperties( 124 window->layer()->GetAnimator()->SchedulePauseForProperties(
125 (duration * 3) / 4, ui::LayerAnimationElement::OPACITY, -1); 125 (duration * 3) / 4, ui::LayerAnimationElement::OPACITY);
126 } 126 }
127 127
128 // Fade in and out quickly when the window is small to reduce jank. 128 // Fade in and out quickly when the window is small to reduce jank.
129 float opacity = show ? 1.0f : 0.0f; 129 float opacity = show ? 1.0f : 0.0f;
130 window->layer()->GetAnimator()->ScheduleAnimation( 130 window->layer()->GetAnimator()->ScheduleAnimation(
131 new ui::LayerAnimationSequence( 131 new ui::LayerAnimationSequence(
132 ui::LayerAnimationElement::CreateOpacityElement( 132 ui::LayerAnimationElement::CreateOpacityElement(
133 opacity, duration / 4))); 133 opacity, duration / 4)));
134 } 134 }
135 135
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 541 }
542 542
543 // Assume the shelf is overflowed, zoom off to the bottom right of the 543 // Assume the shelf is overflowed, zoom off to the bottom right of the
544 // work area. 544 // work area.
545 gfx::Rect work_area = 545 gfx::Rect work_area =
546 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); 546 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area();
547 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); 547 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0);
548 } 548 }
549 549
550 } // namespace ash 550 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_panels.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698