4 {
5
6
7
8bool drawWithRasterImage = true;
9
10
11
13
14void drawStamp(
SkCanvas* canvas,
int size) {
17
18 canvas->
clear(0x3F000000 );
19
21 paint.setAntiAlias(
true);
25
27 paint.setStrokeWidth(20);
29
31}
32
36 drawStamp(
surface->getCanvas(), size);
37 return surface->makeImageSnapshot();
38}
39
43 paint.setAntiAlias(
true);
44
46
49
50 int stampSize = 200;
51 if (drawWithRasterImage) {
53 } else {
55 drawStamp(canvas, stampSize);
57 }
58}
59}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorBLACK
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void rotate(SkScalar degrees)
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
@ kStroke_Style
set to stroke geometry
static SkRRect MakeOval(const SkRect &oval)
SkSamplingOptions sampling
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)