23 auto grade = [&](
int x,
int y){
29 if (!canvas->readPixels(bm,
x,
y)) {
36 memcpy(&pixel, bm.
getAddr(0,0),
sizeof(pixel));
38 auto close = [](
int x,
int y) {
59 canvas->drawRect({0,0,100,100},
paint);
63 canvas->translate(0,100);
@ 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
#define SkColorGetR(color)
#define SkColorGetG(color)
#define SkColorGetA(color)
#define SkColorGetB(color)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
void * getAddr(int x, int y) const
void eraseColor(SkColor4f) const
static sk_sp< SkColorSpace > MakeSRGB()
void MarkGMGood(SkCanvas *canvas, SkScalar x, SkScalar y)
void MarkGMBad(SkCanvas *canvas, SkScalar x, SkScalar y)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
DEF_SIMPLE_GM(unpremul, canvas, 200, 200)