37 paint.setAntiAlias(
true);
40 paint.setStrokeWidth(10);
54 surface->getCanvas()->drawPicture(pic);
55 return surface->makeImageSnapshot();
69 surface->getCanvas()->drawPicture(pic);
70 return surface->makeImageSnapshot();
137 paint.setAntiAlias(
true);
162#include
"tools/ToolUtils.h"
171 constexpr int N = 256;
172 constexpr float kScale = 1.0f/6;
190 canvas->drawImage(img.get(), 0, 0,
sampling);
193 canvas->translate(
dst.width() + 4, 0);
198 canvas->translate(
dst.width() + 4, 0);
204 canvas->translate(0,
dst.height() + 8);
215 if (canvas->getSurface()) {
216 image = canvas->getSurface()->makeImageSnapshot();
221 image = greenSurface->makeImageSnapshot();
234 canvas->drawImage(
surface->makeImageSnapshot(), 0, 0);
241 canvas->drawImage(
surface->makeImageSnapshot(), 50, 0);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
sk_sp< T > sk_ref_sp(T *obj)
void onOnceBeforeDraw() override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void testImage(SkCanvas *canvas, SkImage *image)
SkString getName() const override
sk_sp< SkImage > asImage() const
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorSpace > MakeSRGB()
sk_sp< SkImage > withDefaultMipmaps() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
const ImageMakerProc gProcs[]
static sk_sp< SkImage > make_texture(GrRecordingContext *ctx, SkPicture *pic, const SkImageInfo &info)
static sk_sp< SkImage > make_raster(GrRecordingContext *, SkPicture *pic, const SkImageInfo &info)
static sk_sp< SkImage > make_checker_img(int w, int h, SkColor c0, SkColor c1, int size)
sk_sp< SkImage >(* ImageMakerProc)(GrRecordingContext *, SkPicture *, const SkImageInfo &)
static sk_sp< SkImage > make_pict_gen(GrRecordingContext *, SkPicture *pic, const SkImageInfo &info)
static sk_sp< SkImage > make_encode_gen(GrRecordingContext *ctx, SkPicture *pic, const SkImageInfo &info)
static void draw_something(SkCanvas *canvas, const SkRect &bounds)
DEF_SIMPLE_GM(drawimage_sampling, canvas, 500, 500)
SK_API sk_sp< SkImage > DeferredFromPicture(sk_sp< SkPicture > picture, const SkISize &dimensions, const SkMatrix *matrix, const SkPaint *paint, BitDepth bitDepth, sk_sp< SkColorSpace > colorSpace, SkSurfaceProps props)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
@ kU8
uses 8-bit unsigned int per color component
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
Optional< SkRect > bounds
sk_sp< const SkImage > image
SkSamplingOptions sampling
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)
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
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkRect MakeIWH(int w, int h)
static constexpr SkRect MakeWH(float w, float h)