30 : fUploadContext(nullptr)
31 , fUrlDataManager(rootUrl)
41 if (fContextFactory) {
42 delete fContextFactory;
55 return buffer.detachAsData();
75 this->enableGPU(fGPUEnabled);
83 auto* canvas = this->getCanvas();
85 fDebugCanvas->drawTo(canvas, n,
m);
87 return writeCanvasToPng(this->getCanvas());
97 fDebugCanvas->draw(canvas);
115 bounds = fPicture->cullRect().roundOut();
117 int maxRTSize = this->directContext()->maxRenderTargetSize();
134struct ColorAndProfile {
139ColorAndProfile ColorModes[] = {
140 { kN32_SkColorType,
false },
141 { kN32_SkColorType,
true },
149 ColorAndProfile cap = ColorModes[fColorMode];
154 cap.fSRGB ? colorSpace :
nullptr);
159 auto context = this->directContext();
161 ColorAndProfile cap = ColorModes[fColorMode];
166 cap.fSRGB ? colorSpace :
nullptr);
178 return enableGPU(fGPUEnabled);
192 fDebugCanvas->drawTo(this->getCanvas(), this->getLastOp());
193 this->directContext()->flush(fSurface.get());
200 fSurface.reset(this->createCPUSurface());
209 fprintf(stderr,
"Could not create picture from stream.\n");
214 this->enableGPU(fGPUEnabled);
218 fDebugCanvas = std::make_unique<DebugCanvas>(
bounds.width(),
bounds.height());
219 fDebugCanvas->drawPicture(fPicture);
222 fDebugCanvas->drawTo(this->getCanvas(), this->getLastOp());
223 this->directContext()->flush(fSurface.get());
228 SkCanvas* canvas = this->getCanvas();
234 writer.
appendBool(
"drawGpuOpBounds", fDebugCanvas->getDrawGpuOpBounds());
235 writer.
appendS32(
"colorMode", fColorMode);
236 fDebugCanvas->toJSON(writer, fUrlDataManager, canvas);
240 return stream.detachAsData();
244 SkCanvas* canvas = this->getCanvas();
249 fDebugCanvas->toJSONOpsTask(writer, canvas);
252 return stream.detachAsData();
261 fDebugCanvas->drawTo(canvas, n);
267 SkM44 vm = fDebugCanvas->getCurrentMatrix();
279 return stream.detachAsData();
284 bmp.
allocPixels(this->getCanvas()->imageInfo().makeWH(1, 1));
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static int kDefaultHeight
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
constexpr SkColor SK_ColorTRANSPARENT
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static void MakeJsonMatrix44(SkJSONWriter &, const SkM44 &)
static void MakeJsonIRect(SkJSONWriter &, const SkIRect &)
static void WritePNG(const SkBitmap &bitmap, SkWStream &out)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
SkColor getColor(int x, int y) const
void clear(SkColor color)
SkImageInfo imageInfo() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
static sk_sp< SkColorSpace > MakeSRGBLinear()
void appendS32(int32_t value)
void beginObject(const char *name=nullptr, bool multiline=true)
void appendBool(bool value)
void appendName(const char *name)
void appendCString(const char *value)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkData > serialize(const SkSerialProcs *procs=nullptr) const
static sk_sp< SkPicture > MakeFromStream(SkStream *stream, const SkDeserialProcs *procs=nullptr)
ContextInfo getContextInfo(ContextType type, ContextOverrides=ContextOverrides::kNone)
static float min(float r, float g, float b)
Optional< SkRect > bounds
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 of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
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 mode
GrContextOptions grContextOpts
bool setOverdraw(bool enable)
SkColor getPixel(int x, int y)
sk_sp< SkData > getJsonInfo(int n)
sk_sp< SkData > drawToPng(int n, int m=-1)
bool enableGPU(bool enable)
sk_sp< SkData > writeOutSkp()
sk_sp< SkData > getJsonOpsTask()
bool initPictureFromStream(SkStream *)
sk_sp< SkData > getJsonOps()
Request(SkString rootUrl)
bool setColorMode(int mode)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)