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

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

Issue 1400783002: Use a layer transform for the waiting throbber Base URL: https://chromium.googlesource.com/chromium/src.git@20151006-MacViewsBrowser-Power
Patch Set: Fix color 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/browser/ui/views/tabs/tab.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, SkColor color, const base::TimeDelta& elapsed_time);
39 45
40 // Paint a throbber in the "spinning" state, smoothly transitioning from a 46 // Paint a throbber in the "spinning" state, smoothly transitioning from a
(...skipping 12 matching lines...) Expand all
53 Canvas* canvas, 59 Canvas* canvas,
54 const Rect& bounds, 60 const Rect& bounds,
55 SkColor color, 61 SkColor color,
56 uint32_t frame, 62 uint32_t frame,
57 SkColor waiting_color, 63 SkColor waiting_color,
58 uint32_t final_waiting_frame); 64 uint32_t final_waiting_frame);
59 65
60 } // namespace gfx 66 } // namespace gfx
61 67
62 #endif // UI_GFX_PAINT_THROBBER_H_ 68 #endif // UI_GFX_PAINT_THROBBER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | ui/gfx/paint_throbber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698