45 if (!
info.validRowBytes(rowBytes)) {
50 static const size_t kMaxTotalSize =
SK_MaxS32;
51 if (
size > kMaxTotalSize) {
59 void (*
releaseProc)(
void* pixels,
void* context),
void* context,
64 fWeOwnThePixels =
false;
73 fWeOwnThePixels =
true;
98 if (fWeOwnThePixels) {
102 pr->setTemporarilyImmutable();
120 pr->restoreMutability();
149 bmDev->replaceBitmapBackendForRasterSurface(fBitmap);
172 if (
nullptr == pixels) {
176 return sk_make_sp<SkSurface_Raster>(
info, pixels, rowBytes,
releaseProc, context, props);
183 return WrapPixels(
info, pixels, rowBytes,
nullptr,
nullptr, props);
198 return sk_make_sp<SkSurface_Raster>(
info, std::move(pr), props);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static float prev(float f)
static void releaseProc(const void *ptr, void *context)
static bool SkImageInfoIsValid(const SkImageInfo &info)
SK_SPI sk_sp< SkImage > SkMakeImageFromRasterBitmap(const SkBitmap &, SkCopyPixelsMode)
@ kIfMutable_SkCopyPixelsMode
only copy src pixels if they are marked mutable
@ kAlways_SkCopyPixelsMode
always copy src pixels (even if they are marked immutable)
const SkPixelRef * SkBitmapImageGetPixelRef(const SkImage *rasterImage)
static int64_t sk_64_mul(int64_t a, int64_t b)
static constexpr int32_t SK_MaxS32
constexpr size_t kIgnoreRowBytesValue
bool SkSurfaceValidateRasterInfo(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
SkPixelRef * pixelRef() const
size_t computeByteSize() const
bool writePixels(const SkPixmap &src, int dstX, int dstY)
const SkImageInfo & info() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
bool setInfo(const SkImageInfo &imageInfo, size_t rowBytes=0)
void setPixelRef(sk_sp< SkPixelRef > pixelRef, int dx, int dy)
bool tryAllocPixels(const SkImageInfo &info, size_t rowBytes)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< const SkCapabilities > RasterBackend()
sk_sp< SkImage > refCachedImage()
SkCanvas * getCachedCanvas()
bool hasCachedImage() const
void onDraw(SkCanvas *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
SkCanvas * onNewCanvas() override
SkSurface_Raster(const SkImageInfo &, void *, size_t rb, void(*releaseProc)(void *pixels, void *context), void *context, const SkSurfaceProps *)
sk_sp< const SkCapabilities > onCapabilities() override
sk_sp< SkSurface > onNewSurface(const SkImageInfo &) override
bool onCopyOnWrite(ContentChangeMode) override
void onWritePixels(const SkPixmap &, int x, int y) override
void onRestoreBackingMutability() override
sk_sp< SkImage > onNewImageSnapshot(const SkIRect *subset) override
@ kDiscard_ContentChangeMode
discards surface on change
const SkSurfaceProps & props() const
SK_API sk_sp< SkPixelRef > MakeAllocate(const SkImageInfo &, size_t rowBytes)
SkSamplingOptions sampling
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > WrapPixels(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
void(void *pixels, void *context) PixelsReleaseProc
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
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
constexpr int32_t top() const
constexpr SkISize size() const
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
constexpr int32_t left() const
bool contains(int32_t x, int32_t y) const
SkImageInfo makeDimensions(SkISize newSize) const