32#include "include/core/SkRefCnt.h"
47 std::int32_t blur = 0;
49 std::int32_t corner_radius = 0;
50 std::int32_t
scale = 0;
52 bool operator==(
const BoxShadowKey& o)
const noexcept {
53 return w ==
o.w &&
h ==
o.h && dx ==
o.dx && dy ==
o.dy &&
54 blur ==
o.blur &&
spread ==
o.spread &&
55 corner_radius ==
o.corner_radius &&
scale ==
o.scale;
58 static std::int32_t
q(
float v)
noexcept {
62 if (!std::isfinite(v))
return 0;
63 constexpr float kLimit = 4.0e8f;
64 if (v > kLimit)
v = kLimit;
65 else if (v < -kLimit)
v = -kLimit;
66 return static_cast<std::int32_t
>(
v * 4.0f + (
v < 0 ? -0.5f : 0.5f));
72 static BoxShadowCache& instance();
76 sk_sp<SkImage> get_or_render(
const BoxShadowKey& key,
77 const std::function<sk_sp<SkImage>()>& render);
80 std::uint64_t hits = 0;
81 std::uint64_t renders = 0;
90 void set_enabled(
bool enabled);
93 void set_capacity(std::size_t capacity);
96 BoxShadowCache() =
default;
108std::vector<std::uint8_t> render_box_shadow_to_rgba(
109 int px_w,
int px_h,
float scale,
110 float x,
float y,
float w,
float h,
111 float dx,
float dy,
float blur,
float spread,
112 Color color,
float corner_radius,
bool inset);
Definition affine_transform.hpp:24
@ spread
Definition voicing.hpp:23
@ size
Definition config.hpp:216
@ o
Definition formant_filter_bank.hpp:20
bool operator==(const ModalSpec &a, const ModalSpec &b)
Exact equality over every known field.
void scale(const float *a, float scalar, float *dst, std::size_t count) noexcept
@ h
Definition input_events.hpp:39
@ q
Definition input_events.hpp:41
@ v
Definition input_events.hpp:41
@ w
Definition input_events.hpp:41