Flutter Engine
The Flutter Engine
Functions
Pixmap_shiftPerPixel.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Pixmap_shiftPerPixel, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Pixmap_shiftPerPixel  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Pixmap_shiftPerPixel.cpp.

4 {
5const char* color_type(SkColorType ct) {
6 switch (ct) {
7 case kUnknown_SkColorType: return "Unknown";
8 case kAlpha_8_SkColorType: return "Alpha_8";
9 case kRGB_565_SkColorType: return "RGB_565";
10 case kARGB_4444_SkColorType: return "ARGB_4444";
11 case kRGBA_8888_SkColorType: return "RGBA_8888";
12 case kRGB_888x_SkColorType: return "RGB_888x";
13 case kBGRA_8888_SkColorType: return "BGRA_8888";
14 case kRGBA_1010102_SkColorType: return "RGBA_1010102";
15 case kRGB_101010x_SkColorType: return "RGB_101010x";
16 case kGray_8_SkColorType: return "Gray_8";
17 case kRGBA_F16Norm_SkColorType: return "RGBA_F16Norm";
18 case kRGBA_F16_SkColorType: return "RGBA_F16";
19 case kRGBA_F32_SkColorType: return "RGBA_F32";
20 default: SkASSERT(false); return nullptr;
21 }
22}
23void draw(SkCanvas* canvas) {
29 SkPixmap pixmap(info.makeColorType(colorType), nullptr, 4);
30 SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d shiftPerPixel: %d\n",
31 color_type(colorType), (int)(10 - strlen(color_type(colorType))), " ",
32 pixmap.info().bytesPerPixel(), pixmap.shiftPerPixel());
33 }
34}
35} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkColorType
Definition: SkColorType.h:19
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
Definition: SkColorType.h:23
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition: SkColorType.h:26
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition: SkColorType.h:38
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
Definition: SkColorType.h:21
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
Definition: SkColorType.h:29
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition: SkColorType.h:35
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
Definition: SkColorType.h:22
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
Definition: SkColorType.h:25
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
Definition: SkColorType.h:40
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
Definition: SkColorType.h:27
@ kRGBA_F16Norm_SkColorType
pixel with half floats in [0,1] for red, green, blue, alpha;
Definition: SkColorType.h:36
@ kUnknown_SkColorType
uninitialized
Definition: SkColorType.h:20
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
uint32_t color_type
static SkImageInfo MakeA8(int width, int height)