101#ifdef SK_BUILD_FOR_MAC
105static std::unique_ptr<SkCanvas> make_canvas(
const SkBitmap& bm) {
113 if (
info.isOpaque()) {
120 paint.setAntiAlias(
true);
122 make_canvas(bm)->drawCircle(50, 50, 49,
paint);
125 CGImageRef
image = SkCreateCGImageRefWithColorspace(bm,
nullptr);
128 SkCreateBitmapFromCGImage(&bm2,
image);
132 CGImageRelease(
image);
151 for (
size_t i = 0; i < std::size(rec); ++i) {
186 paint.setAntiAlias(
true);
188 paint.setColor(0xFFCCCCCC);
204 this->
doDraw(canvas, path);
210 this->
doDraw(canvas, path);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define SkColorSetRGB(r, g, b)
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
static void test_image(const sk_sp< SkSpecialImage > &img, skiatest::Reporter *reporter, GrRecordingContext *rContext, bool isGPUBacked)
static void draw_rect_tests(SkCanvas *canvas)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
static void draw_column(SkCanvas *canvas, int x, int y)
static void draw_square(SkCanvas *canvas, int x, int y)
static void draw_bar(SkCanvas *canvas, int x, int y)
SkString getName() const override
void onDraw(SkCanvas *canvas) override
void doDraw(SkCanvas *canvas, const SkPath &path)
void drawAndClip(SkCanvas *canvas, const SkPath &path, SkScalar dx, SkScalar dy)
SkISize getISize() override
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
const SkImageInfo & info() const
void eraseColor(SkColor4f) const
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
static std::unique_ptr< SkCanvas > MakeRasterDirect(const SkImageInfo &info, void *pixels, size_t rowBytes, const SkSurfaceProps *props=nullptr)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
SkPathBuilder & cubicTo(SkPoint pt1, SkPoint pt2, SkPoint pt3)
SkPathBuilder & moveTo(SkPoint pt)
SkPath makeTransform(const SkMatrix &m, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
static constexpr SkISize Make(int32_t w, int32_t h)
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)