36 fName =
"ShadowReference";
48 fShowAmbient = !fShowAmbient;
52 fShowSpot = !fShowSpot;
60 fShowObject = !fShowObject;
77 const SkScalar kLightWidth = kDP*400;
78 const SkScalar kAmbientAlpha = 0.03f;
82 paint.setAntiAlias(
true);
85 SkPoint3 lightPos = { 175, -800, kDP * 600 };
95 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
96 lightPos, kLightWidth, kSpotAlpha);
102 zPlaneParams.
fZ = kDP * 3;
106 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
107 lightPos, kLightWidth, kSpotAlpha);
113 zPlaneParams.
fZ = kDP * 4;
117 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
118 lightPos, kLightWidth, kSpotAlpha);
124 zPlaneParams.
fZ = kDP * 6;
128 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
129 lightPos, kLightWidth, kSpotAlpha);
135 zPlaneParams.
fZ = kDP * 8;
139 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
140 lightPos, kLightWidth, kSpotAlpha);
146 zPlaneParams.
fZ = kDP * 16;
150 this->drawShadowedPath(canvas, fRRectPath, zPlaneParams,
paint, kAmbientAlpha,
151 lightPos, kLightWidth, kSpotAlpha);
159 canvas->
drawImage(fReferenceImage, 10, 30);
180 lightPos, lightWidth,
181 ambientColor, spotColor,
flags);
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorWHITE
@ kGeometricOnly_ShadowFlag
void draw(SkCanvas *canvas) override
bool onChar(SkUnichar uni) override
void load(SkScalar w, SkScalar h) override
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
SkPath & addRRect(const SkRRect &rrect, SkPathDirection dir=SkPathDirection::kCW)
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
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
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)