36 const char* filename) {
50 if (!sContext || !sContext->asTextureProxy()) {
54 bool result = sContext->readPixels(dContext, bm.
pixmap(), {0, 0});
56 SkDebugf(
"------ failed to read pixels for %s\n", filename);
64 if (!
file.isValid()) {
65 SkDebugf(
"------ failed to create file: %s\n", filename);
71 SkDebugf(
"------ failed to encode %s\n", filename);
81 static int gDumpCount = 0;
83 if (am->fAtlases[
i]) {
85 for (uint32_t pageIdx = 0; pageIdx < am->fAtlases[
i]->numActivePages(); ++pageIdx) {
88#ifdef SK_BUILD_FOR_ANDROID
89 filename.
printf(
"/sdcard/fontcache_%d%d%d.png", gDumpCount,
i, pageIdx);
91 filename.
printf(
"fontcache_%d%d%u.png", gDumpCount,
i, pageIdx);
107 am->fAtlases[
i] =
nullptr;
117 if (am->fAtlases[
i]) {
138 doa->fMaxPages = maxPages;
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
@ kUnknown_SkAlphaType
uninitialized
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
GrDirectContextPriv priv()
uint32_t maxPages() const
std::unique_ptr< skgpu::ganesh::SurfaceContext > makeSC(GrSurfaceProxyView readView, const GrColorInfo &)
GrSurfaceProxy * proxy() const
SkISize dimensions() const
bool isInstantiated() const
const SkPixmap & pixmap() const
bool tryAllocPixels(const SkImageInfo &info, size_t rowBytes)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
static constexpr SkColorType MaskFormatToColorType(MaskFormat format)
static const int kMaskFormatCount
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)