39 , fTwoPassColor(
false)
40 , fDarkBackground(
false) {
41 fName =
"ShadowColor";
52 fShowAmbient = !fShowAmbient;
56 fShowSpot = !fShowSpot;
64 fShowObject = !fShowObject;
68 fTwoPassColor = !fTwoPassColor;
72 fDarkBackground = !fDarkBackground;
94 const SkScalar kAmbientAlpha = 0.03f;
97 const SkScalar kZValues[10] = { 1, 2, 3, 4, 6, 8, 9, 12, 16, 24 };
101 0xFF3A0072, 0xFF5D0099, 0xFF7F12B2, 0xFFA02AD1, 0xFFC245E5,
102 0xFFE95AF9, 0xFFFC79F0, 0xFFFDA6F0, 0xFFFFCCF8, 0xFFFFE1F9,
104 0xFFEA3200, 0xFFFF4E00, 0xFFFF7300, 0xFFFF9100, 0xFFFFB000,
105 0xFFFFCE00, 0xFFFFE000, 0xFFFFF64D, 0xFFFFF98F, 0xFFFFFBCC,
107 0xFF004D51, 0xFF066266, 0xFF057F7F, 0xFF009999, 0xFF00B2B2,
108 0xFF15CCBE, 0xFF25E5CE, 0xFF2CFFE0, 0xFF80FFEA, 0xFFB3FFF0
113 paint.setAntiAlias(
true);
114 if (fDarkBackground) {
127 SkPoint3 lightPos = { 75, -400, 600 };
131 for (
int row = 0; row < 3; ++row) {
134 for (
int col = 0; col < 10; ++col) {
139 this->drawShadowedPath(canvas, fRectPath, zPlaneParams,
paint, kAmbientAlpha,
140 lightPos, kLightWidth, kSpotAlpha);
171 lightPos, lightWidth,
182 SkScalar alpha = (.6 - .4*luminance)*luminance*luminance + 0.3f;
183 spotAlpha -= (alpha - 0.3f)*.5f;
188 lightPos, lightWidth,
194 lightPos, lightWidth,
204 SkColor tonalAmbient, tonalSpot;
207 lightPos, lightWidth,
208 tonalAmbient, tonalSpot,
flags);
#define SkColorGetR(color)
#define SkColorGetG(color)
constexpr SkColor SK_ColorTRANSPARENT
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
#define SkColorGetA(color)
#define SkColorGetB(color)
constexpr SkColor SK_ColorWHITE
@ kGeometricOnly_ShadowFlag
bool onChar(SkUnichar uni) override
void load(SkScalar w, SkScalar h) override
void draw(SkCanvas *canvas) override
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
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)
static void ComputeTonalColors(SkColor inAmbientColor, SkColor inSpotColor, SkColor *outAmbientColor, SkColor *outSpotColor)
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
static float min(float r, float g, float b)
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
font
Font Metadata and Metrics.
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)