125 {
126 SkRect ambientBounds = path.getBounds();
130 } else {
132 occluderZ = std::max(occluderZ, compute_z(ambientBounds.
fRight, ambientBounds.
fTop,
134 occluderZ = std::max(occluderZ, compute_z(ambientBounds.
fLeft, ambientBounds.
fBottom,
136 occluderZ = std::max(occluderZ, compute_z(ambientBounds.
fRight, ambientBounds.
fBottom,
138 }
144
146
147
149
150
154 &spotBlur, &spotScale, &spotOffset);
155 } else {
160 &spotBlur, &spotScale, &spotOffset);
161 }
162 } else {
164
165
167 ambientBlur = devSpaceAmbientBlur*devToSrcScale;
168
169
173 &spotBlur, &spotScale, &spotOffset);
174
176 if (ctm.
invert(&inverse)) {
178 }
179 } else {
182 &spotBlur, &spotScale, &spotOffset);
183 }
184
185
186 spotBlur *= devToSrcScale;
187 }
188
189
190 SkRect spotBounds = ambientBounds;
191 ambientBounds.
outset(ambientBlur, ambientBlur);
192 spotBounds.
fLeft *= spotScale;
193 spotBounds.
fTop *= spotScale;
194 spotBounds.
fRight *= spotScale;
195 spotBounds.
fBottom *= spotScale;
196 spotBounds.
offset(spotOffset.
fX, spotOffset.
fY);
197 spotBounds.
outset(spotBlur, spotBlur);
198
199
202
204
205
207
209 if (ctm.
invert(&inverse)) {
211 }
212 }
213}
#define SkScalarInvert(x)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
@ kDirectionalLight_ShadowFlag
static constexpr bool SkToBool(const T &x)
void mapVectors(SkVector dst[], const SkVector src[], int count) const
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
bool invert(SkMatrix *inverse) const
SkScalar getMinScale() const
bool hasPerspective() const
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
void GetDirectionalParams(SkScalar occluderZ, SkScalar lightX, SkScalar lightY, SkScalar lightZ, SkScalar lightRadius, SkScalar *blurRadius, SkScalar *scale, SkVector *translate)
SkScalar AmbientBlurRadius(SkScalar height)
void GetSpotParams(SkScalar occluderZ, SkScalar lightX, SkScalar lightY, SkScalar lightZ, SkScalar lightRadius, SkScalar *blurRadius, SkScalar *scale, SkVector *translate)
Optional< SkRect > bounds
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
void outset(float dx, float dy)
SkScalar fRight
larger x-axis bounds
void offset(float dx, float dy)
SkScalar fTop
smaller y-axis bounds