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

Side by Side Diff: ui/compositor/scoped_animation_duration_scale_mode.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H_
6 #define UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H_
7
8 #include "base/basictypes.h"
9 #include "ui/compositor/compositor_export.h"
10
11 namespace ui {
12
13 // Speed up or slow down animations for testing or debugging.
14 class COMPOSITOR_EXPORT ScopedAnimationDurationScaleMode {
15 public:
16 enum DurationScaleMode {
17 NORMAL_DURATION,
18 FAST_DURATION,
19 SLOW_DURATION,
20 // A very short but guaranteed non-zero duration for individual tests that
21 // need to assert things about animations after creating them.
22 NON_ZERO_DURATION,
23 // Animations complete immediately after being created. Used by most tests.
24 ZERO_DURATION
25 };
26
27 explicit ScopedAnimationDurationScaleMode(
28 DurationScaleMode scoped_duration_scale_mode)
29 : old_duration_scale_mode_(duration_scale_mode_) {
30 duration_scale_mode_ = scoped_duration_scale_mode;
31 }
32
33 ~ScopedAnimationDurationScaleMode() {
34 duration_scale_mode_ = old_duration_scale_mode_;
35 }
36
37 static DurationScaleMode duration_scale_mode() {
38 return duration_scale_mode_;
39 }
40
41 private:
42 DurationScaleMode old_duration_scale_mode_;
43
44 static DurationScaleMode duration_scale_mode_;
45
46 DISALLOW_COPY_AND_ASSIGN(ScopedAnimationDurationScaleMode);
47 };
48
49 } // namespace ui
50
51 #endif // UI_COMPOSITOR_SCOPED_ANIMATION_DURATION_SCALE_MODE_H
OLDNEW
« no previous file with comments | « ui/compositor/run_all_unittests.cc ('k') | ui/compositor/scoped_animation_duration_scale_mode.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698