57 {
59 return false;
60 }
61
63
64
65 return false;
66 }
67
68 if (
nullptr == pixmap.
addr()) {
69 return false;
70 }
71
72 pic->width = pixmap.
width();
73 pic->height = pixmap.
height();
74
75
76
77
78
80 webp_config->lossless = 0;
81#ifndef SK_WEBP_ENCODER_USE_DEFAULT_METHOD
82 webp_config->method = 3;
83#endif
84 pic->use_argb = 0;
85 } else {
86 webp_config->lossless = 1;
87 webp_config->method = 0;
88 pic->use_argb = 1;
89 }
90
91 {
94
99 importProc = WebPPictureImportRGBX;
101 importProc = WebPPictureImportRGBA;
102 }
103#ifdef WebPPictureImportBGRA
105 importProc = WebPPictureImportBGRA;
106 }
107#endif
108 else {
109 importProc = WebPPictureImportRGBA;
115 return false;
116 }
118 }
119
120 if (!importProc(pic,
reinterpret_cast<const uint8_t*
>(
src->addr()),
src->rowBytes())) {
121 return false;
122 }
123 }
124
125 return true;
126}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ 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
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
static bool SkPixmapIsValid(const SkPixmap &src)
static bool SkColorTypeIsAlphaOnly(SkColorType ct)
int(*)(WebPPicture *picture, const uint8_t *pixels, int stride) WebPPictureImportProc
static uint32_t premul(uint32_t color)
const SkPixmap & pixmap() const
const SkImageInfo & info() const
bool tryAllocPixels(const SkImageInfo &info, size_t rowBytes)
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes) const
SkColorType colorType() const
const SkImageInfo & info() const
const void * addr() const
SkAlphaType alphaType() const
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
SkImageInfo makeColorType(SkColorType newColorType) const