chromium/ui/gfx/paint_throbber.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// The maximum size of the "spinning" state arc, in degrees.
constexpr int64_t kMaxArcSize =;

// The amount of time it takes to grow the "spinning" arc from 0 to 270 degrees.
constexpr auto kArcTime =;

// The amount of time it takes for the "spinning" throbber to make a full
// rotation.
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) {}

// This is a Skia port of the MD spinner SVG. The |start_angle| rotation
// here corresponds to the 'rotate' animation.
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) {}

}  // namespace

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) {}

}  // namespace gfx