160 {
162
164 const SkScalar kAmbientAlpha = 0.039f;
166
168 paint.setAntiAlias(
true);
169
172
175 zPlaneParams.
fZ =
std::max(1.0f, 2 + fZDelta);
176 this->drawShadowedPath(canvas, fRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
177 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
178
181 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
182 this->drawShadowedPath(canvas, fRectPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
183 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
184
187 zPlaneParams.
fZ =
std::max(1.0f, 12 + fZDelta);
188 this->drawShadowedPath(canvas, fCirclePath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
189 lightPos, kLightWidth, fAnimAlpha*0.5f);
190
193 zPlaneParams.
fZ =
std::max(1.0f, 64 + fZDelta);
194 this->drawShadowedPath(canvas, fRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
195 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
196
199 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
200 this->drawShadowedPath(canvas, fFunkyRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
201 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
202
205 zPlaneParams.
fZ =
std::max(1.0f, 16 + fZDelta);
206 this->drawShadowedPath(canvas, fCubicPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
207 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
208
211 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
212 this->drawShadowedPath(canvas, fStarPath, zPlaneParams,
paint,
213 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
214
217 zPlaneParams.
fZ =
std::max(1.0f, 2 + fZDelta);
218 this->drawShadowedPath(canvas, fNotchPath, zPlaneParams,
paint,
219 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
220
223 zPlaneParams.
fZ =
std::max(1.0f, 16 + fZDelta);
224 this->drawShadowedPath(canvas, fTabPath, zPlaneParams,
paint,
225 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
226
227
230 tmpClipPath.
addCircle(fAnimTranslate, 0, 60);
232
235 zPlaneParams.
fZ =
std::max(1.0f, 32 + fZDelta);
236 this->drawShadowedPath(canvas, tmpPath, zPlaneParams,
paint, .1f,
237 lightPos, kLightWidth, .5f);
238
239
241 tmpClipPathBug.
addCircle(88.0344925f, 0, 60);
243
245 zPlaneParams.
fZ =
std::max(1.0f, 32 + fZDelta);
246 this->drawShadowedPath(canvas, tmpPath, zPlaneParams,
paint, .1f,
247 lightPos, kLightWidth, .5f);
248
249
266 this->drawShadowedPath(canvas, fWideRectPath, zPlaneParams,
paint, .1f,
267 lightPos, kLightWidth, .5f);
268
280 0,
282 this->drawShadowedPath(canvas, fWideOvalPath, zPlaneParams,
paint, .1f,
283 lightPos, kLightWidth, .5f);
284
295 0,
297 this->drawShadowedPath(canvas, fStarPath, zPlaneParams,
paint, .1f,
298 lightPos, kLightWidth, .5f);
299 }
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kIntersect_SkPathOp
intersect the two paths
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
void getMatrix(SkMatrix *) const
void rotateX(SkScalar deg)
void rotateY(SkScalar deg)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void setMatrix(const SkM44 &matrix)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
const SkRect & getBounds() const
static float max(float r, float g, float b)
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkPoint Make(float x, float y)
constexpr float height() const
constexpr float width() const