5 {
10 bitmap.allocPixels(imageInfo);
14 auto pack101010x = [](
unsigned r,
unsigned g,
unsigned b) -> uint32_t {
15 return (r << 0) | (g << 10) | (
b << 20);
16 };
17 uint32_t redBits[] = { pack101010x(0x3FF, 0x000, 0x000), pack101010x(0x2ff, 0x000, 0x000),
18 pack101010x(0x1ff, 0x000, 0x000), pack101010x(0x0ff, 0x000, 0x000) };
19 uint32_t blueBits[] = { pack101010x(0x000, 0x000, 0x3FF), pack101010x(0x000, 0x000, 0x2ff),
20 pack101010x(0x000, 0x000, 0x1ff), pack101010x(0x000, 0x000, 0x0ff) };
23 }
27 }
28}
29}
@ kOpaque_SkAlphaType
pixel is opaque
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
constexpr SkColor SK_ColorGREEN
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
size_t minRowBytes() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)