8#ifndef SkDevice_DEFINED
9#define SkDevice_DEFINED
132 return fSurfaceProps;
213 fLocalToDevice33 = fLocalToDevice.
asM33();
214 fLocalToDeviceDirty =
true;
361 bool pathIsMutable =
false) = 0;
387 bool skipColorXform =
false) = 0;
514 bool wasDirty = fLocalToDeviceDirty;
515 fLocalToDeviceDirty =
false;
544 void simplifyGlyphRunRSXFormAndRedraw(
SkCanvas*,
550 SkM44 fLocalToDevice;
553 SkM44 fDeviceToGlobal;
554 SkM44 fGlobalToDevice;
566 bool fLocalToDeviceDirty =
true;
591 return this->clip().fIsRect &&
622 int fDeferredSaveCount;
628 , fDeferredSaveCount(0)
633 bool isAA,
bool fillsBounds);
638 const ClipState& clip()
const {
return fClipStack.
back(); }
639 ClipState& writableClip();
648 , fPrevLocalToDevice(
device->localToDevice())
658 const SkM44 fPrevLocalToDevice;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
SkShaderBase * as_SB(SkShader *shader)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void drawFilteredImage(const skif::Mapping &mapping, SkSpecialImage *src, SkColorType ct, const SkImageFilter *, const SkSamplingOptions &, const SkPaint &)
const SkImageInfo & imageInfo() const
bool writePixels(const SkPixmap &src, int x, int y)
virtual sk_sp< SkDevice > createDevice(const CreateInfo &, const SkPaint *)
virtual void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform=false)=0
virtual void drawRRect(const SkRRect &rr, const SkPaint &paint)=0
virtual void drawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
SkScalerContextFlags scalerContextFlags() const
virtual void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint)=0
virtual void drawRegion(const SkRegion &r, const SkPaint &paint)
SkIPoint getOrigin() const
SkDevice(const SkImageInfo &, const SkSurfaceProps &)
virtual void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &)
virtual void clipPath(const SkPath &path, SkClipOp op, bool aa)=0
virtual bool onReadPixels(const SkPixmap &, int x, int y)
bool readPixels(const SkPixmap &dst, int x, int y)
void setLocalToDevice(const SkM44 &localToDevice)
virtual SkStrikeDeviceInfo strikeDeviceInfo() const
virtual bool isClipEmpty() const =0
void clipShader(sk_sp< SkShader > sh, SkClipOp op)
virtual bool onAccessPixels(SkPixmap *)
virtual void drawShadow(const SkPath &, const SkDrawShadowRec &)
virtual bool isClipRect() const =0
virtual void clipRegion(const SkRegion ®ion, SkClipOp op)=0
virtual void drawCoverageMask(const SkSpecialImage *, const SkMatrix &maskToDevice, const SkSamplingOptions &, const SkPaint &)
virtual skgpu::ganesh::Device * asGaneshDevice()
virtual bool drawBlurredRRect(const SkRRect &, const SkPaint &, float deviceSigma)
virtual sk_sp< skif::Backend > createImageFilteringBackend(const SkSurfaceProps &surfaceProps, SkColorType colorType) const
void drawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
virtual void drawEdgeAAImageSet(const SkCanvas::ImageSetEntry[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)
virtual bool isClipWideOpen() const =0
const SkM44 & globalToDevice() const
virtual void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &)
virtual skgpu::graphite::Device * asGraphiteDevice()
virtual void * getRasterHandle() const
sk_sp< SkSpecialImage > snapSpecial()
virtual bool onWritePixels(const SkPixmap &, int x, int y)
virtual void setImmutable()
virtual void popClipStack()=0
virtual sk_sp< SkSpecialImage > snapSpecialScaled(const SkIRect &subset, const SkISize &dstDims)
virtual void pushClipStack()=0
bool accessPixels(SkPixmap *pmap)
const SkMatrix & localToDevice() const
virtual void drawSlug(SkCanvas *, const sktext::gpu::Slug *slug, const SkPaint &paint)
void setOrigin(const SkM44 &globalCTM, int x, int y)
virtual GrRecordingContext * recordingContext() const
virtual void android_utils_clipAsRgn(SkRegion *) const =0
virtual void drawSpecial(SkSpecialImage *, const SkMatrix &localToDevice, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint constraint=SkCanvas::kStrict_SrcRectConstraint)
bool isPixelAlignedToGlobal() const
virtual void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &)
virtual void clipRRect(const SkRRect &rrect, SkClipOp op, bool aa)=0
virtual SkIRect devClipBounds() const =0
const SkSurfaceProps & surfaceProps() const
virtual void clipRect(const SkRect &rect, SkClipOp op, bool aa)=0
virtual bool onPeekPixels(SkPixmap *)
virtual bool android_utils_clipWithStencil()
virtual sk_sp< SkSpecialImage > makeSpecial(const SkBitmap &)
const SkM44 & deviceToGlobal() const
virtual void drawDrawable(SkCanvas *, SkDrawable *, const SkMatrix *)
virtual void onDrawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &, const SkPaint &paint)=0
virtual skgpu::graphite::Recorder * recorder() const
void setDeviceCoordinateSystem(const SkM44 &deviceToGlobal, const SkM44 &globalToDevice, const SkM44 &localToDevice, int bufferOriginX, int bufferOriginY)
void setGlobalCTM(const SkM44 &ctm)
virtual sk_sp< sktext::gpu::Slug > convertGlyphRunListToSlug(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
bool peekPixels(SkPixmap *)
virtual sk_sp< SkSurface > makeSurface(const SkImageInfo &, const SkSurfaceProps &)
virtual void drawPaint(const SkPaint &paint)=0
virtual void drawMesh(const SkMesh &mesh, sk_sp< SkBlender >, const SkPaint &)=0
virtual bool isClipAntiAliased() const =0
virtual bool useDrawCoverageMaskForMaskFilters() const
virtual void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], sk_sp< SkBlender >, const SkPaint &paint)
bool checkLocalToDeviceDirty()
virtual void drawRect(const SkRect &r, const SkPaint &paint)=0
virtual void drawImageRect(const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)=0
const SkM44 & localToDevice44() const
virtual bool drawAsTiledImageRect(SkCanvas *, const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)
virtual void drawArc(const SkArc &arc, const SkPaint &paint)
virtual void drawAnnotation(const SkRect &, const char[], SkData *)
void getGlobalBounds(SkIRect *bounds) const
virtual void drawPath(const SkPath &path, const SkPaint &paint, bool pathIsMutable=false)=0
virtual void onClipShader(sk_sp< SkShader >)=0
SkMatrix getRelativeTransform(const SkDevice &) const
virtual bool shouldDrawAsTiledImageRect() const
virtual void drawOval(const SkRect &oval, const SkPaint &paint)=0
SkIRect getGlobalBounds() const
virtual bool isNoPixelsDevice() const
virtual void replaceClip(const SkIRect &rect)=0
virtual void drawImageLattice(const SkImage *, const SkCanvas::Lattice &, const SkRect &dst, SkFilterMode, const SkPaint &)
static SkRect MapRect(const SkM44 &m, const SkRect &r)
void android_utils_clipAsRgn(SkRegion *rgn) const override
void drawRRect(const SkRRect &, const SkPaint &) override
void clipRegion(const SkRegion &globalRgn, SkClipOp op) override
void clipRect(const SkRect &rect, SkClipOp op, bool aa) override
bool isClipWideOpen() const override
bool resetForNextPicture(const SkIRect &bounds)
void drawPath(const SkPath &, const SkPaint &, bool) override
SkIRect devClipBounds() const override
void drawOval(const SkRect &, const SkPaint &) override
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override
void popClipStack() override
bool isNoPixelsDevice() const override
bool isClipAntiAliased() const override
void replaceClip(const SkIRect &rect) override
void drawImageRect(const SkImage *, const SkRect *, const SkRect &, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
void clipPath(const SkPath &path, SkClipOp op, bool aa) override
void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &) override
void drawPaint(const SkPaint &paint) override
bool isClipEmpty() const override
void onDrawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &, const SkPaint &) override
void pushClipStack() override
void drawSlug(SkCanvas *, const sktext::gpu::Slug *, const SkPaint &) override
void drawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
bool isClipRect() const override
void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint &) override
SkNoPixelsDevice(const SkIRect &bounds, const SkSurfaceProps &props)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool aa) override
void drawRect(const SkRect &, const SkPaint &) override
bool setRect(const SkIRect &rect)
sk_sp< SkShader > makeInvertAlpha() const
sk_sp< SkShader > makeWithCTM(const SkMatrix &) const
PODArray< SkPoint > dstClips
ClipOpAndAA opAA SkRegion region
sk_sp< SkBlender > blender SkRect rect
PODArray< SkMatrix > preViewMatrices
PODArray< SkColor > colors
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
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
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
const SkPixelGeometry fPixelGeometry
SkRasterHandleAllocator * fAllocator
CreateInfo(const SkImageInfo &info, SkPixelGeometry geo, SkRasterHandleAllocator *allocator)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
SkISize dimensions() const
static SkRect Make(const SkISize &size)
void roundOut(SkIRect *dst) const
const SkSurfaceProps fSurfaceProps
const SkScalerContextFlags fScalerContextFlags
const sktext::gpu::SDFTControl *const fSDFTControl