179 {
184 kImageSize,
185 ct,
188
189
190
191
196 ii,
197 1,
199 nullptr,
200 true);
202
203 return;
204 }
205 } else {
209 }
210 }
211
212 static constexpr float kScales[] = {1.f, 0.5f, 0.25f, 0.125f};
215
216 for (bool shader : {false, true}) {
217 int c = 0;
219 for (float sy : kScales) {
221 for (float sx : kScales) {
223 canvas->
scale(sx, sy);
225 if (shader) {
229 } else {
231 }
233 canvas->
translate(ii.width() * sx + kPad, 0);
234 c = (c + 1) % std::size(kColors);
235 }
237 canvas->
translate(0, ii.width() * sy + kPad);
238 }
240 for (float sx : kScales) {
241 canvas->
translate(ii.width() * sx + kPad, 0);
242 }
243 }
244 }
@ kTopLeft_GrSurfaceOrigin
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kUnknown_SkColorType
uninitialized
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
virtual GrRecordingContext * recordingContext() const
void scale(SkScalar sx, SkScalar sy)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkISize dimensions() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
sk_sp< SkImage > updateImage(SkSurface *surf, SkColor color)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkColorType colorType() const
static SkRect Make(const SkISize &size)
static constexpr SkSamplingOptions Aniso(int maxAniso)