59 canvas->
drawCircle(kRect.centerX(), kRect.centerY(), kRect.width() / 2.f, *
paint);
85 for (
int i = 1;
i < 5; ++
i) {
89 for (
int i = 0;
i < 5; ++
i) {
99 const char*
text =
"N";
101 font.setEmbolden(
true);
117 canvas->
clear(kBackground);
125 static constexpr int kNumHairlines = 12;
126 SkPoint pts[] = {{3.f, 7.f}, {29.f, 7.f}};
129 rot.
setRotate(360.f / kNumHairlines, 15.5f, 12.f);
131 for (
int i = 0;
i < 12; ++
i) {
133 canvas->
drawLine(pts[0], pts[1], hairPaint);
144 for (
int r = 0; r <= 15; r++) {
146 p.setAntiAlias(
true);
177 info.colorType() != kN32_SkColorType) {
186 canvas->
scale(5.f, 5.f);
189 canvas->
drawImage(surf->makeImageSnapshot(), 0.f, 0.f);
196 using INHERITED =
GM;
201DEF_GM(
return new DstReadShuffle; )
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static const int points[]
@ kOpaque_SkAlphaType
pixel is opaque
@ kColorBurn
darken destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kUnknown_SkColorType
uninitialized
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorTRANSPARENT
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
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)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void clear(SkColor color)
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
void setStrokeWidth(SkScalar width)
SkPathBuilder & moveTo(SkPoint pt)
SkPathBuilder & quadTo(SkPoint pt1, SkPoint pt2)
SkISize getISize() override
void drawShape(SkCanvas *canvas, SkPaint *paint, ShapeType type)
static SkColor GetColor(SkRandom *random)
SkString getName() const override
void onDraw(SkCanvas *canvas) override
static void DrawHairlines(SkCanvas *canvas)
GM(SkColor backgroundColor=SK_ColorWHITE)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
font
Font Metadata and Metrics.
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkAlphaType alphaType() const
SkColorType colorType() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)