21#if defined(SK_SUPPORT_LEGACY_EMBOSSMASKFILTER)
28 if (!
SkIsFinite(blurSigma) || blurSigma <= 0) {
33 if (!lightDir.normalize()) {
36 Light newLight = light;
44#ifdef SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
47 if (direction ==
nullptr) {
67 : fLight(light), fBlurSigma(blurSigma)
83 SkScalar sigma = matrix.mapRadius(fBlurSigma);
94 if (src.fImage ==
nullptr) {
101 uint8_t* alphaPlane = dst->image();
102 size_t planeSize = dst->computeImageSize();
103 if (0 == planeSize) {
107 memcpy(dst->image(), alphaPlane, planeSize);
112 Light light = fLight;
126 memcpy(dst->image(), src.fImage, src.computeImageSize());
133 if (
buffer.readByteArray(&light,
sizeof(Light))) {
136 return Make(sigma, light);
142 Light tmpLight = fLight;
144 buffer.writeByteArray(&tmpLight,
sizeof(tmpLight));
145 buffer.writeScalar(fBlurSigma);
@ kInner_SkBlurStyle
fuzzy inside, nothing outside
static U8CPU SkUnitScalarClampToByte(SkScalar x)
static bool SkIsFinite(T x, Pack... values)
#define SkScalarCeilToInt(x)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
static bool BoxBlur(SkMaskBuilder *dst, const SkMask &src, SkScalar sigma, SkBlurStyle style, SkIPoint *margin=nullptr)
SkMask::Format getFormat() const override
static sk_sp< SkMaskFilter > Make(SkScalar blurSigma, const Light &light)
bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const override
SkEmbossMaskFilter(SkScalar blurSigma, const Light &light)
void flatten(SkWriteBuffer &) const override
static void Emboss(SkMaskBuilder *mask, const SkEmbossMaskFilter::Light &)
static const uint8_t buffer[]
void set(int32_t x, int32_t y)
static void FreeImage(void *image)
static uint8_t * AllocImage(size_t bytes, AllocType=kUninit_Alloc)
@ k3D_Format
3 8bit per pixl planes: alpha, mul, add
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
bool setLength(float length)
static float Length(float x, float y)