#include "ui/gfx/paint_vector_icon.h"
#include <algorithm>
#include <map>
#include <tuple>
#include "base/containers/span.h"
#include "base/i18n/rtl.h"
#include "base/lazy_instance.h"
#include "base/memory/raw_span.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/trace_event/trace_event.h"
#include "cc/paint/paint_canvas.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_palette.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/gfx/vector_icon_utils.h"
namespace gfx {
namespace {
constexpr int kReferenceSizeDip = …;
constexpr int kEmptyIconSize = …;
int GetCanvasDimensions(const base::span<const PathElement>& path) { … }
const VectorIconRep* GetRepForPxSize(const VectorIcon& icon, int icon_size_px) { … }
struct CompareIconDescription { … };
class PathParser { … };
CommandType CommandFromString(const std::string& source) { … }
std::vector<PathElement> PathFromSource(const std::string& source) { … }
bool IsCommandTypeCurve(CommandType command) { … }
void PaintPath(Canvas* canvas,
const base::span<const PathElement>& path_elements,
int dip_size,
SkColor color) { … }
class VectorIconSource : public CanvasImageSource { … };
class VectorIconCache { … };
static base::LazyInstance<VectorIconCache>::DestructorAtExit g_icon_cache = …;
}
IconDescription::IconDescription(const IconDescription& other) = default;
IconDescription::IconDescription(const VectorIcon& icon,
int dip_size,
SkColor color,
const VectorIcon* badge_icon)
: … { … }
IconDescription::~IconDescription() { … }
const VectorIcon kNoneIcon = …;
void PaintVectorIcon(Canvas* canvas, const VectorIcon& icon, SkColor color) { … }
void PaintVectorIcon(Canvas* canvas,
const VectorIcon& icon,
int dip_size,
SkColor color) { … }
ImageSkia CreateVectorIcon(const IconDescription& params) { … }
ImageSkia CreateVectorIcon(const VectorIcon& icon, SkColor color) { … }
ImageSkia CreateVectorIcon(const VectorIcon& icon,
int dip_size,
SkColor color) { … }
ImageSkia CreateVectorIconWithBadge(const VectorIcon& icon,
int dip_size,
SkColor color,
const VectorIcon& badge_icon) { … }
ImageSkia CreateVectorIconFromSource(const std::string& source,
int dip_size,
SkColor color) { … }
}