880 {
882 if (!encoded) {
884 }
886 if (nullptr == codec) {
888 }
889
892 fDstAlphaType)) {
894 }
895
896
897 SkISize size = codec->getSampledDimensions(fSampleSize);
898
899
900
902 return Result::Skip(
"Scaling very small images is uninteresting.");
903 }
905
909
916 }
917
918
920 options.fSampleSize = fSampleSize;
921
922 switch (codec->getAndroidPixels(decodeInfo, pixels.get(), rowBytes, &
options)) {
926 break;
927 default:
929 }
930 draw_to_canvas(canvas, bitmapInfo, pixels.get(), rowBytes, fDstColorType);
932}
@ 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
SkISize size() const override
static Result Skip(const char *fmt,...) SK_PRINTF_LIKE(1
static Result Fatal(const char *fmt,...) SK_PRINTF_LIKE(1
static std::unique_ptr< SkAndroidCodec > MakeFromData(sk_sp< SkData >, SkPngChunkReader *=nullptr)
SkImageInfo imageInfo() const
static sk_sp< SkData > MakeFromFileName(const char path[])
const char * c_str() const
static void draw_to_canvas(SkCanvas *canvas, const SkImageInfo &info, void *pixels, size_t rowBytes, CodecSrc::DstColorType dstColorType, SkScalar left=0, SkScalar top=0)
static void set_bitmap_color_space(SkImageInfo *info)
static bool get_decode_info(SkImageInfo *decodeInfo, SkColorType canvasColorType, CodecSrc::DstColorType dstColorType, SkAlphaType dstAlphaType)
constexpr int32_t width() const
constexpr int32_t height() const
SkImageInfo makeDimensions(SkISize newSize) const
int bytesPerPixel() const
SkColorType colorType() const
SkImageInfo makeColorType(SkColorType newColorType) const