Go to the source code of this file.
◆ DEF_SIMPLE_GM()
DEF_SIMPLE_GM |
( |
image_out_of_gamut |
, |
|
|
canvas |
, |
|
|
2 *kBoxSize+3 * |
kPadding, |
|
|
kBoxSize+2 * |
kPadding |
|
) |
| |
Definition at line 132 of file bitmappremul.cpp.
132 {
133
134
135
136
137
139
142
144 canvas->drawImage(
rgba, 0, 0);
146 canvas->drawImage(
bgra, 0, 0);
147}
static const uint32_t bgra[kNumPixels]
static const uint32_t rgba[kNumPixels]
@ 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
static constexpr int kPadding
static sk_sp< SkImage > make_out_of_gamut_image(SkColorType ct)
static constexpr int kBoxSize
◆ init_bitmap()
Definition at line 32 of file bitmappremul.cpp.
32 {
36}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorWHITE
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
◆ make_argb4444_gradient()
Definition at line 50 of file bitmappremul.cpp.
50 {
53
58}
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
static sk_sp< SkImage > make_argb8888_gradient()
static void init_bitmap(SkColorType ct, SkBitmap *bitmap)
SkSamplingOptions(SkFilterMode::kLinear))
◆ make_argb4444_stripes()
Definition at line 79 of file bitmappremul.cpp.
79 {
82
87}
static sk_sp< SkImage > make_argb8888_stripes()
◆ make_argb8888_gradient()
Definition at line 38 of file bitmappremul.cpp.
38 {
45 }
46 }
48}
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
◆ make_argb8888_stripes()
Definition at line 60 of file bitmappremul.cpp.
60 {
63 uint8_t rowColor = 0;
68 rowColor, rowColor);
69 }
70 if (rowColor == 0) {
71 rowColor = 255;
72 } else {
73 rowColor = 0;
74 }
75 }
77}
◆ make_out_of_gamut_image()
Definition at line 120 of file bitmappremul.cpp.
120 {
122
126 *bmp.
getAddr32(
x,
y) = (0x40000000 | ((
x * 8) << 8) | ((
y * 8) << 0));
127 }
128 }
130}
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
uint32_t * getAddr32(int x, int y) const
◆ kBoxSize
constexpr int kBoxSize = 31 |
|
staticconstexpr |
◆ kPadding
constexpr int kPadding = 5 |
|
staticconstexpr |
◆ SLIDE_SIZE
constexpr int SLIDE_SIZE = 256 |
|
constexpr |
This GM checks that bitmap pixels are unpremultiplied before being exported to other formats. If unpremultiplication is implemented properly, this GM should come out completely white. If not, this GM looks like a row of two greyscale gradients above a row of grey lines. This tests both the ARGB4444 and ARGB8888 bitmap configurations.
Definition at line 30 of file bitmappremul.cpp.