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

Side by Side Diff: ui/gfx/paint_throbber.h

Issue 1381203002: An energy usage monitor for Mac, and some layer-backed throbber experiments Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the AA thing, but it is still a bit weird Created 5 years, 2 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
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | ui/gfx/paint_throbber.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 #ifndef UI_GFX_PAINT_THROBBER_H_ 5 #ifndef UI_GFX_PAINT_THROBBER_H_
6 #define UI_GFX_PAINT_THROBBER_H_ 6 #define UI_GFX_PAINT_THROBBER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 10 matching lines...) Expand all
21 struct GFX_EXPORT ThrobberWaitingState { 21 struct GFX_EXPORT ThrobberWaitingState {
22 // The amount of time that was spent in the waiting state. 22 // The amount of time that was spent in the waiting state.
23 base::TimeDelta elapsed_time; 23 base::TimeDelta elapsed_time;
24 // The color of the arc in the waiting state. 24 // The color of the arc in the waiting state.
25 SkColor color; 25 SkColor color;
26 // An opaque value used to cache calculations made by 26 // An opaque value used to cache calculations made by
27 // PaintThrobberSpinningAfterWaiting. 27 // PaintThrobberSpinningAfterWaiting.
28 base::TimeDelta arc_time_offset; 28 base::TimeDelta arc_time_offset;
29 }; 29 };
30 30
31 GFX_EXPORT void PaintThrobberArc(Canvas* canvas,
32 const Rect& bounds,
33 SkColor color,
34 SkScalar start_angle,
35 SkScalar sweep);
36
31 // Paints a single frame of the throbber in the "spinning", aka Material, state. 37 // Paints a single frame of the throbber in the "spinning", aka Material, state.
32 GFX_EXPORT void PaintThrobberSpinning(Canvas* canvas, 38 GFX_EXPORT void PaintThrobberSpinning(Canvas* canvas,
33 const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time); 39 const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time);
34 40
35 // Paints a throbber in the "waiting" state. Used when waiting on a network 41 // Paints a throbber in the "waiting" state. Used when waiting on a network
36 // response, for example. 42 // response, for example.
37 GFX_EXPORT void PaintThrobberWaiting(Canvas* canvas, 43 GFX_EXPORT void PaintThrobberWaiting(Canvas* canvas,
38 const Rect& bounds, SkColor color, const base::TimeDelta& elapsed_time); 44 const Rect& bounds,
45 SkColor color,
46 const base::TimeDelta& elapsed_time,
47 bool anti_alias);
39 48
40 // Paint a throbber in the "spinning" state, smoothly transitioning from a 49 // Paint a throbber in the "spinning" state, smoothly transitioning from a
41 // previous "waiting" state described by |waiting_state|, which is an in-out 50 // previous "waiting" state described by |waiting_state|, which is an in-out
42 // param. 51 // param.
43 GFX_EXPORT void PaintThrobberSpinningAfterWaiting( 52 GFX_EXPORT void PaintThrobberSpinningAfterWaiting(
44 Canvas* canvas, 53 Canvas* canvas,
45 const Rect& bounds, 54 const Rect& bounds,
46 SkColor color, 55 SkColor color,
47 const base::TimeDelta& elapsed_time, 56 const base::TimeDelta& elapsed_time,
48 ThrobberWaitingState* waiting_state); 57 ThrobberWaitingState* waiting_state);
49 58
50 // Paint a throbber in the "spinning" state, smoothly transitioning from a 59 // Paint a throbber in the "spinning" state, smoothly transitioning from a
51 // previous "waiting" state described by |final_waiting_frame|. 60 // previous "waiting" state described by |final_waiting_frame|.
52 GFX_EXPORT void PaintThrobberSpinningForFrameAfterWaiting( 61 GFX_EXPORT void PaintThrobberSpinningForFrameAfterWaiting(
53 Canvas* canvas, 62 Canvas* canvas,
54 const Rect& bounds, 63 const Rect& bounds,
55 SkColor color, 64 SkColor color,
56 uint32_t frame, 65 uint32_t frame,
57 SkColor waiting_color, 66 SkColor waiting_color,
58 uint32_t final_waiting_frame); 67 uint32_t final_waiting_frame);
59 68
60 } // namespace gfx 69 } // namespace gfx
61 70
62 #endif // UI_GFX_PAINT_THROBBER_H_ 71 #endif // UI_GFX_PAINT_THROBBER_H_
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | ui/gfx/paint_throbber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698