54 {
55 canvas->
clear(0xFF101010);
59 for (
int x = 0;
x <
WIDTH;
x += 16) {
65 }
66 }
69
72 spotTarget.
fY + 70.7214f * sinAzimuth,
78
80 spotTarget.
fY + 50 * sinAzimuth,
83
94
98
100 for (
int i = 0;
i < 3;
i++) {
101 const SkIRect* cr = (
i == 1) ? &cropRect : (
i == 2) ? &fullSizeCropRect :
nullptr;
103
107
109 distantDirection,
SK_ColorWHITE, surfaceScale, kd, input, cr));
111
113 spotLocation, spotTarget, spotExponent1, cutoffAngleSmall,
SK_ColorWHITE,
114 surfaceScale, kd, input, cr));
116
117
119 spotLocation, spotTarget, spotExponent10, cutoffAngleNone,
SK_ColorWHITE,
120 surfaceScale, kd, input, cr));
122
123
125 spotLocation, spotTarget, spotExponent1, cutoffAngleNone,
SK_ColorWHITE,
126 surfaceScaleSmall, kd, input, cr));
128
129
131 distantDirection, greenYellow, surfaceScale, 4.f * kd, input, cr));
133
135
136
138 pointLocation,
SK_ColorWHITE, surfaceScale, ks, shininess, input, cr));
140
142 distantDirection,
SK_ColorWHITE, surfaceScale, ks, shininess, input, cr));
144
146 spotLocation, spotTarget, spotExponent1, cutoffAngleSmall,
SK_ColorWHITE,
147 surfaceScale, ks, shininess, input, cr));
149
150
152 spotLocation, spotTarget, spotExponent10, cutoffAngleNone,
SK_ColorWHITE,
153 surfaceScale, ks, shininess, input, cr));
155
156
158 spotLocation, spotTarget, spotExponent1, cutoffAngleNone,
SK_ColorWHITE,
159 surfaceScaleSmall, ks, shininess, input, cr));
161
162
164 distantDirection, greenYellow, surfaceScale, 4.f * ks, shininess, input, cr));
166
168 }
169 }
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorWHITE
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clear(SkColor color)
static sk_sp< SkImageFilter > PointLitDiffuse(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitSpecular(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitDiffuse(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > PointLitSpecular(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitDiffuse(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitSpecular(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void setColor(SkColor color)
void drawClippedBitmap(SkCanvas *canvas, const SkPaint &paint, int x, int y)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)