| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |