28 paint.setAntiAlias(
true);
31 for (
int i = 0;
i < 20; ++
i) {
35 return surface->makeImageSnapshot();
54 canvas->translate(20, 20);
56 canvas->drawImageRect(img.
get(),
dst, samplings[
i],
nullptr);
57 canvas->translate(0, 20);
59 canvas->drawImage(img.
get(), 20, 20);
71 for (
int y = 0;
y <
N; ++
y) {
72 for (
int x = 0;
x <
N; ++
x) {
86 while (
dst.width() > 5) {
88 dst.offset(
dst.width() + 10, 0);
105 canvas->translate(10, 10);
107 canvas->translate(0, limg->
height() + 10.0f);
120 for (
int y = 0;
y <
N; ++
y) {
121 for (
int x = 0;
x <
N; ++
x) {
122 *bm.
getAddr8(
x,
y) =
static_cast<uint8_t
>(255.0f * ((
x +
y) / (2.0f * (
N - 1))));
135 while (
dst.width() > 5) {
137 dst.offset(
dst.width() + 10, 0);
138 dst.fRight =
dst.fLeft +
dst.width() / 2;
139 dst.fBottom =
dst.fTop +
dst.height() / 2;
154 canvas->translate(10, 10);
156 canvas->translate(0, limg->
height() + 10.0f);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
uint8_t * getAddr8(int x, int y) const
uint32_t * getAddr32(int x, int y) const
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorSpace > MakeSRGB()
@ kStroke_Style
set to stroke geometry
void printf(const char format[],...) SK_PRINTF_LIKE(2
static sk_sp< SkImage > make_g8_gradient(sk_sp< SkColorSpace > cs)
static sk_sp< SkImage > make(sk_sp< SkColorSpace > cs)
static sk_sp< SkImage > make_image()
static void show_mips(SkCanvas *canvas, SkImage *img)
DEF_SIMPLE_GM(mipmap, canvas, 400, 200)
static void show_mips_only(SkCanvas *canvas, SkImage *img)
SkSamplingOptions sampling
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkCubicResampler Mitchell()
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeWH(float w, float h)