chromium/ui/views/background.cc

// Copyright 2012 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/views/background.h"

#include <optional>
#include <utility>

#include "base/check.h"
#include "build/build_config.h"
#include "cc/paint/paint_flags.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/views/painter.h"
#include "ui/views/view.h"

#if BUILDFLAG(IS_WIN)
#include "skia/ext/skia_utils_win.h"
#endif

namespace views {

// SolidBackground is a trivial Background implementation that fills the
// background in a solid color.
class SolidBackground : public Background {};

// Shared class for RoundedRectBackground and ThemedRoundedRectBackground.
class BaseRoundedRectBackground : public Background {};

// RoundedRectBackground is a filled solid colored background that has
// rounded corners.
class RoundedRectBackground : public BaseRoundedRectBackground {};

// ThemedVectorIconBackground is an image drawn on the view's background using
// ThemedVectorIcon to react to theme changes.
class ThemedVectorIconBackground : public Background {};

// ThemedSolidBackground is a solid background that stays in sync with a view's
// ColorProvider.
class ThemedSolidBackground : public SolidBackground {};

// ThemedRoundedRectBackground is a solid rounded rect background that stays in
// sync with a view's ColorProvider.
class ThemedRoundedRectBackground : public BaseRoundedRectBackground {};

class BackgroundPainter : public Background {};

Background::Background() = default;

Background::~Background() = default;

void Background::SetNativeControlColor(SkColor color) {}

void Background::OnViewThemeChanged(View* view) {}

std::optional<gfx::RoundedCornersF> Background::GetRoundedCornerRadii() const {}

std::unique_ptr<Background> CreateSolidBackground(SkColor color) {}

std::unique_ptr<Background> CreateRoundedRectBackground(
    SkColor color,
    float radius,
    int for_border_thickness) {}

std::unique_ptr<Background> CreateRoundedRectBackground(
    SkColor color,
    const gfx::RoundedCornersF& radii,
    int for_border_thickness) {}

std::unique_ptr<Background> CreateThemedRoundedRectBackground(
    ui::ColorId color_id,
    float radius,
    int for_border_thickness) {}

std::unique_ptr<Background> CreateThemedRoundedRectBackground(
    ui::ColorId color_id,
    float top_radius,
    float bottom_radius,
    int for_border_thickness) {}

std::unique_ptr<Background> CreateThemedRoundedRectBackground(
    ui::ColorId color_id,
    const gfx::RoundedCornersF& radii,
    int for_border_thickness) {}

std::unique_ptr<Background> CreateThemedVectorIconBackground(
    const ui::ThemedVectorIcon& icon) {}

std::unique_ptr<Background> CreateThemedSolidBackground(ui::ColorId color_id) {}

std::unique_ptr<Background> CreateBackgroundFromPainter(
    std::unique_ptr<Painter> painter) {}

}  // namespace views