21 "The total duration, in seconds, of the animation we are drawing.");
23 "A double value in [0, 1] that specifies the point in animation to draw.");
39#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
68 char formatbuffer[1024];
69 int n = vsnprintf(formatbuffer,
sizeof(formatbuffer),
fmt,
args);
71 if (n>=0 && n<=
int(
sizeof(formatbuffer))) {
77 const uint8_t* input =
reinterpret_cast<const uint8_t*
>(
data);
78 const uint8_t*
end = &input[
size];
79 static const char codes[] =
80 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
81 "abcdefghijklmnopqrstuvwxyz0123456789+/";
82 while (input !=
end) {
83 uint8_t
b = (*input & 0xFC) >> 2;
85 b = (*input & 0x03) << 4;
92 b |= (*input & 0xF0) >> 4;
94 b = (*input & 0x0F) << 2;
101 b |= (*input & 0xC0) >> 6;
102 fputc(codes[
b],
out);
104 fputc(codes[
b],
out);
111 const char*
name,
bool last =
true) {
114 fputs(last ?
"\"\n" :
"\",\n", stdout);
118 const char*
name,
bool last =
true) {
139 fputs(
"Context is null.\n", stderr);
151 fputs(
"Unable to peekPixels.\n", stderr);
157 if ((!kRGBAIsNative)) {
159 fputs(
"Unable to alloc rgbaPixmap.\n", stderr);
163 fputs(
"Unable to read rgbaPixmap.\n", stderr);
166 pixmap = &rgbaPixmap;
176 fputs(
"Failed to create backEndTexture.\n", stderr);
194 constexpr int kSampleCnt = 1;
196 resourceProvider->createTexture(offscreenDims,
206 "Fiddle_SetupBackendObjects");
208 fputs(
"GrTexture is invalid.\n", stderr);
216 fputs(
"BackEndRenderTarget is invalid.\n", stderr);
232 fputs(
"Failed to create backendTextureRenderTarget.\n", stderr);
255#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
266 std::unique_ptr<SkCodec> codec =
nullptr;
272 perror(
"Unsupported file format\n");
276 perror(
"Corrupt source image file\n");
281 perror(
"Unable to decode the source image.\n");
306 std::unique_ptr<sk_gpu_test::GLTestContext> glContext;
309 fputs(
"Unable to get GrContext.\n", stderr);
312 fputs(
"Unable to create backend objects.\n", stderr);
318 fputs(
"Unable to get render surface.\n", stderr);
360 dump_output(textoutput.c_str(), textoutput.length(),
"Text",
false);
363 dump_output(glinfo.c_str(), glinfo.length(),
"GLInfo",
true);
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;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorWHITE
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
sk_sp< T > sk_ref_sp(T *obj)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
static void Parse(int argc, const char *const *argv)
SK_API GrBackendFormat defaultBackendFormat(SkColorType, GrRenderable) const
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
virtual GrRenderTarget * asRenderTarget()
bool tryAlloc(const SkImageInfo &)
const SkImageInfo & info() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
bool peekPixels(SkPixmap *pixmap) const
void clear(SkColor color)
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
GrBackendTexture backEndTextureRenderTarget
static sk_sp< SkData > encode_snapshot(GrDirectContext *ctx, const sk_sp< SkSurface > &surface)
static SkCanvas * prepare_canvas(SkCanvas *canvas)
static void dump_output(const void *data, size_t size, const char *name, bool last=true)
int main(int argc, char **argv)
std::ostringstream gTextOutput
sk_sp< sk_gpu_test::ManagedBackendTexture > managedBackendTexture
void SkDebugf(const char *fmt,...)
GrBackendRenderTarget backEndRenderTarget
sk_sp< GrRenderTarget > backingRenderTarget
GrBackendTexture backEndTexture
sk_sp< sk_gpu_test::ManagedBackendTexture > managedBackendTextureRenderTarget
static DEFINE_double(duration, 1.0, "The total duration, in seconds, of the animation we are drawing.")
std::ostringstream gGLDriverInfo
static void encode_to_base64(const void *data, size_t size, FILE *out)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
constexpr SkColor4f kTransparent
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< SkPixelRef > MakeWithData(const SkImageInfo &, size_t rowBytes, sk_sp< SkData > data)
void(* memset32)(uint32_t[], uint32_t, int)
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_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
sk_sp< const SkPicture > picture
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
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)
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
const myers::Point & get< 0 >(const myers::Segment &s)
static SkString fmt(SkColor4f c)
constexpr int32_t width() const
constexpr int64_t area() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkImageInfo makeColorType(SkColorType newColorType) const
static constexpr SkSize Make(SkScalar w, SkScalar h)
std::shared_ptr< const fml::Mapping > data