53 :
fFlags(
flags), fPixelGeometry(pg), fTextContrast(textContrast), fTextGamma(textGamma) {}
72 if (0 == fGenerationID) {
95 const SkIRect surfBounds = { 0, 0, fWidth, fHeight };
97 if (!
bounds.intersect(surfBounds)) {
101 if (
bounds == surfBounds) {
130 int srcX,
int srcY) {
131 return this->
readPixels({dstInfo, dstPixels, dstRowBytes}, srcX, srcY);
151 info, srcRect, rescaleGamma, rescaleMode,
callback, context);
163 (dstSize.
width() & 0b1) || (dstSize.
height() & 0b1)) {
169 std::move(dstColorSpace),
187 (dstSize.
width() & 0b1) || (dstSize.
height() & 0b1)) {
193 std::move(dstColorSpace),
203 if (pmap.
addr() ==
nullptr || pmap.
width() <= 0 || pmap.
height() <= 0) {
214 if (!
asSB(
this)->aboutToDraw(
mode)) {
223 if (
src.peekPixels(&pm)) {
235 bool deleteSemaphoresAfterWait) {
236 return asSB(
this)->
onWait(numSemaphores, waitSemaphores, deleteSemaphoresAfterWait);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static bool SkImageInfoIsValid(const SkImageInfo &info)
static SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps *props)
@ kUnknown_SkPixelGeometry
static const SkSurface_Base * asConstSB(const SkSurface *surface)
static SkSurface_Base * asSB(SkSurface *surface)
void sk_ignore_unused_variable(const T &)
#define SK_GAMMA_CONTRAST
#define SK_GAMMA_EXPONENT
bool peekPixels(SkPixmap *pixmap)
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
const void * addr() const
virtual GrRecordingContext * onGetRecordingContext() const
virtual void onAsyncRescaleAndReadPixelsYUV420(SkYUVColorSpace, bool readAlpha, sk_sp< SkColorSpace > dstColorSpace, SkIRect srcRect, SkISize dstSize, RescaleGamma, RescaleMode, ReadPixelsCallback, ReadPixelsContext)
virtual bool onCharacterize(GrSurfaceCharacterization *) const
virtual sk_sp< SkImage > onNewImageSnapshot(const SkIRect *subset=nullptr)
virtual skgpu::graphite::Recorder * onGetRecorder() const
sk_sp< SkImage > refCachedImage()
virtual sk_sp< const SkCapabilities > onCapabilities()
virtual sk_sp< SkSurface > onNewSurface(const SkImageInfo &)=0
uint32_t newGenerationID()
virtual bool onWait(int numSemaphores, const GrBackendSemaphore *waitSemaphores, bool deleteSemaphoresAfterWait)
virtual void onWritePixels(const SkPixmap &, int x, int y)=0
virtual bool onIsCompatible(const GrSurfaceCharacterization &) const
SkCanvas * getCachedCanvas()
virtual void onDraw(SkCanvas *, SkScalar x, SkScalar y, const SkSamplingOptions &, const SkPaint *)
virtual void onAsyncRescaleAndReadPixels(const SkImageInfo &, const SkIRect srcRect, RescaleGamma, RescaleMode, ReadPixelsCallback, ReadPixelsContext)
@ kDiscard_ContentChangeMode
discards surface on change
@ kRetain_ContentChangeMode
preserves surface on change
void(ReadPixelsContext, std::unique_ptr< const AsyncReadResult >) ReadPixelsCallback
GrRecordingContext * recordingContext() const
sk_sp< const SkCapabilities > capabilities()
bool characterize(GrSurfaceCharacterization *characterization) const
sk_sp< SkSurface > makeSurface(const SkImageInfo &imageInfo)
void draw(SkCanvas *canvas, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint)
void asyncRescaleAndReadPixels(const SkImageInfo &info, const SkIRect &srcRect, RescaleGamma rescaleGamma, RescaleMode rescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
bool isCompatible(const GrSurfaceCharacterization &characterization) const
virtual SkImageInfo imageInfo() const
bool peekPixels(SkPixmap *pixmap)
sk_sp< SkImage > makeImageSnapshot()
void asyncRescaleAndReadPixelsYUVA420(SkYUVColorSpace yuvColorSpace, sk_sp< SkColorSpace > dstColorSpace, const SkIRect &srcRect, const SkISize &dstSize, RescaleGamma rescaleGamma, RescaleMode rescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
void asyncRescaleAndReadPixelsYUV420(SkYUVColorSpace yuvColorSpace, sk_sp< SkColorSpace > dstColorSpace, const SkIRect &srcRect, const SkISize &dstSize, RescaleGamma rescaleGamma, RescaleMode rescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
SkSurface(int width, int height, const SkSurfaceProps *surfaceProps)
void writePixels(const SkPixmap &src, int dstX, int dstY)
void notifyContentWillChange(ContentChangeMode mode)
bool wait(int numSemaphores, const GrBackendSemaphore *waitSemaphores, bool deleteSemaphoresAfterWait=true)
skgpu::graphite::Recorder * recorder() const
bool readPixels(const SkPixmap &dst, int srcX, int srcY)
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Optional< SkRect > bounds
SkSamplingOptions sampling
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
constexpr bool contains(std::string_view str, std::string_view needle)
static bool Intersects(const SkIRect &a, const SkIRect &b)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
bool contains(int32_t x, int32_t y) const
constexpr int32_t width() const
constexpr int32_t height() const