242 {
247
248
254 }
255#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
257#else
259#endif
264 return 1;
265 }
266 std::unique_ptr<SkCodec> codec = nullptr;
271 } else {
272 perror("Unsupported file format\n");
273 return 1;
274 }
275 if (!codec) {
276 perror("Corrupt source image file\n");
277 return 1;
278 }
281 perror("Unable to decode the source image.\n");
282 return 1;
283 }
285 }
295 }
300 srand(0);
303 }
304#ifdef SK_GL
306 std::unique_ptr<sk_gpu_test::GLTestContext> glContext;
308 if (!direct) {
309 fputs("Unable to get GrContext.\n", stderr);
310 } else {
312 fputs("Unable to create backend objects.\n", stderr);
314 }
315
318 fputs("Unable to get render surface.\n", stderr);
320 }
321 srand(0);
324 }
325 }
326#endif
327
328#ifdef SK_SUPPORT_PDF
332 if (document) {
333 srand(0);
335 document->close();
337 }
338 }
339#endif
340
344 srand(0);
350 }
351
358 } else {
360 dump_output(textoutput.c_str(), textoutput.length(),
"Text",
false);
361 }
363 dump_output(glinfo.c_str(), glinfo.length(),
"GLInfo",
true);
365
366 return 0;
367}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
static void Parse(int argc, const char *const *argv)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeSRGBLinear()
static sk_sp< SkData > MakeFromFileName(const char path[])
sk_sp< SkData > detachAsData()
static sk_sp< SkFontMgr > RefEmpty()
bool asLegacyBitmap(SkBitmap *bitmap, LegacyBitmapMode legacyBitmapMode=kRO_LegacyBitmapMode) const
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkData > serialize(const SkSerialProcs *procs=nullptr) const
DrawOptions GetDrawOptions()
sk_sp< GrDirectContext > create_direct_context(std::ostringstream &driverinfo, std::unique_ptr< sk_gpu_test::GLTestContext > *glContext)
sk_sp< SkFontMgr > fontMgr
static sk_sp< SkData > encode_snapshot(GrDirectContext *ctx, const sk_sp< SkSurface > &surface)
static SkCanvas * prepare_canvas(SkCanvas *canvas)
std::ostringstream gTextOutput
std::ostringstream gGLDriverInfo
SK_API bool IsJpeg(const void *, size_t)
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
SK_API sk_sp< SkDocument > MakeDocument(SkWStream *stream, const Metadata &metadata)
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
SK_API bool IsPng(const void *, size_t)
sk_sp< const SkPicture > picture
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
const myers::Point & get< 0 >(const myers::Segment &s)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkSize Make(SkScalar w, SkScalar h)