#include "ui/gfx/paint_throbber.h"
#include <algorithm>
#include "base/numerics/safe_conversions.h"
#include "base/time/time.h"
#include "cc/paint/paint_flags.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/gfx/animation/tween.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace gfx {
namespace {
constexpr int64_t kMaxArcSize = …;
constexpr auto kArcTime = …;
constexpr auto kRotationTime = …;
void PaintArc(Canvas* canvas,
const Rect& bounds,
SkColor color,
SkScalar start_angle,
SkScalar sweep,
std::optional<SkScalar> stroke_width) { … }
void CalculateWaitingAngles(const base::TimeDelta& elapsed_time,
int64_t* start_angle,
int64_t* sweep) { … }
ThrobberSpinningState CalculateThrobberSpinningStateWithStartAngle(
base::TimeDelta elapsed_time,
int64_t start_angle) { … }
void PaintThrobberSpinningWithState(Canvas* canvas,
const Rect& bounds,
SkColor color,
const ThrobberSpinningState& state,
std::optional<SkScalar> stroke_width) { … }
void PaintThrobberSpinningWithStartAngle(Canvas* canvas,
const Rect& bounds,
SkColor color,
const base::TimeDelta& elapsed_time,
int64_t start_angle,
std::optional<SkScalar> stroke_width) { … }
}
ThrobberSpinningState CalculateThrobberSpinningState(
base::TimeDelta elapsed_time) { … }
void PaintThrobberSpinning(Canvas* canvas,
const Rect& bounds,
SkColor color,
const base::TimeDelta& elapsed_time,
std::optional<SkScalar> stroke_width) { … }
void PaintThrobberWaiting(Canvas* canvas,
const Rect& bounds,
SkColor color,
const base::TimeDelta& elapsed_time,
std::optional<SkScalar> stroke_width) { … }
void PaintThrobberSpinningAfterWaiting(Canvas* canvas,
const Rect& bounds,
SkColor color,
const base::TimeDelta& elapsed_time,
ThrobberWaitingState* waiting_state,
std::optional<SkScalar> stroke_width) { … }
GFX_EXPORT void PaintNewThrobberWaiting(Canvas* canvas,
const RectF& throbber_container_bounds,
SkColor color,
const base::TimeDelta& elapsed_time) { … }
}