43 bool fShowAmbient =
true;
44 bool fShowSpot =
true;
47 bool fShowObject =
true;
48 bool fIgnoreShadowAlpha =
false;
49 bool fDoAlphaAnimation =
false;
64 fStarPath.
moveTo(0.0f, -50.0f);
65 fStarPath.
lineTo(14.43f, -25.0f);
66 fStarPath.
lineTo(43.30f, -25.0f);
67 fStarPath.
lineTo(28.86f, 0.0f);
68 fStarPath.
lineTo(43.30f, 25.0f);
69 fStarPath.
lineTo(14.43f, 25.0f);
70 fStarPath.
lineTo(0.0f, 50.0f);
71 fStarPath.
lineTo(-14.43f, 25.0f);
72 fStarPath.
lineTo(-43.30f, 25.0f);
73 fStarPath.
lineTo(-28.86f, 0.0f);
74 fStarPath.
lineTo(-43.30f, -25.0f);
75 fStarPath.
lineTo(-14.43f, -25.0f);
83 fNotchPath.
lineTo(-75, 100);
84 fNotchPath.
lineTo(-75, -100);
85 fNotchPath.
lineTo(75, -100);
86 fNotchPath.
lineTo(75, 100);
89 fTabPath.
moveTo(-75, -100);
100 bool handled =
false;
103 fShowAmbient = !fShowAmbient;
107 fShowSpot = !fShowSpot;
115 fUseBlur = !fUseBlur;
119 fShowObject = !fShowObject;
123 fDoAlphaAnimation = !fDoAlphaAnimation;
124 if (!fDoAlphaAnimation) {
138 fIgnoreShadowAlpha = !fIgnoreShadowAlpha;
154 if (fDoAlphaAnimation) {
164 const SkScalar kAmbientAlpha = 0.039f;
168 paint.setAntiAlias(
true);
175 zPlaneParams.
fZ =
std::max(1.0f, 2 + fZDelta);
176 this->drawShadowedPath(canvas, fRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
177 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
181 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
182 this->drawShadowedPath(canvas, fRectPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
183 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
187 zPlaneParams.
fZ =
std::max(1.0f, 12 + fZDelta);
188 this->drawShadowedPath(canvas, fCirclePath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
189 lightPos, kLightWidth, fAnimAlpha*0.5f);
193 zPlaneParams.
fZ =
std::max(1.0f, 64 + fZDelta);
194 this->drawShadowedPath(canvas, fRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
195 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
199 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
200 this->drawShadowedPath(canvas, fFunkyRRPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
201 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
205 zPlaneParams.
fZ =
std::max(1.0f, 16 + fZDelta);
206 this->drawShadowedPath(canvas, fCubicPath, zPlaneParams,
paint, fAnimAlpha*kAmbientAlpha,
207 lightPos, kLightWidth, fAnimAlpha*kSpotAlpha);
211 zPlaneParams.
fZ =
std::max(1.0f, 8 + fZDelta);
212 this->drawShadowedPath(canvas, fStarPath, zPlaneParams,
paint,
213 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
217 zPlaneParams.
fZ =
std::max(1.0f, 2 + fZDelta);
218 this->drawShadowedPath(canvas, fNotchPath, zPlaneParams,
paint,
219 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
223 zPlaneParams.
fZ =
std::max(1.0f, 16 + fZDelta);
224 this->drawShadowedPath(canvas, fTabPath, zPlaneParams,
paint,
225 kAmbientAlpha, lightPos, kLightWidth, kSpotAlpha);
230 tmpClipPath.
addCircle(fAnimTranslate, 0, 60);
235 zPlaneParams.
fZ =
std::max(1.0f, 32 + fZDelta);
236 this->drawShadowedPath(canvas, tmpPath, zPlaneParams,
paint, .1f,
237 lightPos, kLightWidth, .5f);
241 tmpClipPathBug.
addCircle(88.0344925f, 0, 60);
245 zPlaneParams.
fZ =
std::max(1.0f, 32 + fZDelta);
246 this->drawShadowedPath(canvas, tmpPath, zPlaneParams,
paint, .1f,
247 lightPos, kLightWidth, .5f);
266 this->drawShadowedPath(canvas, fWideRectPath, zPlaneParams,
paint, .1f,
267 lightPos, kLightWidth, .5f);
282 this->drawShadowedPath(canvas, fWideOvalPath, zPlaneParams,
paint, .1f,
283 lightPos, kLightWidth, .5f);
297 this->drawShadowedPath(canvas, fStarPath, zPlaneParams,
paint, .1f,
298 lightPos, kLightWidth, .5f);
306 if (fIgnoreShadowAlpha) {
327 ambientColor, spotColor,
flags);
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kIntersect_SkPathOp
intersect the two paths
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
@ kConcaveBlurOnly_ShadowFlag
@ kGeometricOnly_ShadowFlag
void load(SkScalar w, SkScalar h) override
bool onChar(SkUnichar uni) override
bool animate(double nanos) override
void draw(SkCanvas *canvas) override
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 drawPath(const SkPath &path, const SkPaint &paint)
void setMatrix(const SkM44 &matrix)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPath & arcTo(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
SkPath & moveTo(SkScalar x, SkScalar y)
SkPath & lineTo(SkScalar x, SkScalar y)
SkPath & addRRect(const SkRRect &rrect, SkPathDirection dir=SkPathDirection::kCW)
SkPath & addRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, SkPathDirection dir=SkPathDirection::kCW)
const SkRect & getBounds() const
SkPath & addOval(const SkRect &oval, SkPathDirection dir=SkPathDirection::kCW)
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
static void DrawShadow(SkCanvas *canvas, const SkPath &path, const SkPoint3 &zPlaneParams, const SkPoint3 &lightPos, SkScalar lightRadius, SkColor ambientColor, SkColor spotColor, uint32_t flags=SkShadowFlags::kNone_ShadowFlag)
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
static float PingPong(double time, float period, float phase, float ends, float mid)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)