111 using INHERITED =
GM;
114DEF_GM(
return new BitmapPremulGM; )
126 *bmp.
getAddr32(
x,
y) = (0x40000000 | ((
x * 8) << 8) | ((
y * 8) << 0));
144 canvas->drawImage(
rgba, 0, 0);
146 canvas->drawImage(
bgra, 0, 0);
static const uint32_t bgra[kNumPixels]
static const uint32_t rgba[kNumPixels]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ 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
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorWHITE
static sk_sp< SkImage > make_argb4444_stripes()
static constexpr int kPadding
static sk_sp< SkImage > make_argb4444_gradient()
static sk_sp< SkImage > make_out_of_gamut_image(SkColorType ct)
static sk_sp< SkImage > make_argb8888_gradient()
DEF_SIMPLE_GM(image_out_of_gamut, canvas, 2 *kBoxSize+3 *kPadding, kBoxSize+2 *kPadding)
static sk_sp< SkImage > make_argb8888_stripes()
static constexpr int kBoxSize
static void init_bitmap(SkColorType ct, SkBitmap *bitmap)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
uint32_t * getAddr32(int x, int y) const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkString getName() const override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
GM(SkColor backgroundColor=SK_ColorWHITE)
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)