Flutter Engine
The Flutter Engine
|
#include <SkPDFDevice.h>
Public Member Functions | |
SkPDFDevice (SkISize pageSize, SkPDFDocument *document, const SkMatrix &initialTransform=SkMatrix::I()) | |
sk_sp< SkPDFDevice > | makeCongruentDevice () |
~SkPDFDevice () override | |
void | drawPaint (const SkPaint &paint) override |
void | drawPoints (SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint) override |
void | drawRect (const SkRect &r, const SkPaint &paint) override |
void | drawOval (const SkRect &oval, const SkPaint &paint) override |
void | drawRRect (const SkRRect &rr, const SkPaint &paint) override |
void | drawPath (const SkPath &origpath, const SkPaint &paint, bool pathIsMutable) override |
void | drawImageRect (const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override |
void | drawVertices (const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override |
void | drawMesh (const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override |
void | drawAnnotation (const SkRect &, const char key[], SkData *value) override |
void | drawDevice (SkDevice *, const SkSamplingOptions &, const SkPaint &) override |
void | drawSpecial (SkSpecialImage *, const SkMatrix &, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override |
sk_sp< SkSurface > | makeSurface (const SkImageInfo &, const SkSurfaceProps &) override |
sk_sp< SkDevice > | createDevice (const CreateInfo &, const SkPaint *) override |
void | drawSprite (const SkBitmap &bitmap, int x, int y, const SkPaint &paint) |
std::unique_ptr< SkPDFDict > | makeResourceDict () |
std::unique_ptr< SkStreamAsset > | content () |
const SkMatrix & | initialTransform () const |
Public Member Functions inherited from SkClipStackDevice | |
SkClipStackDevice (const SkImageInfo &info, const SkSurfaceProps &props) | |
SkClipStack & | cs () |
const SkClipStack & | cs () const |
void | pushClipStack () override |
void | popClipStack () override |
void | clipRect (const SkRect &rect, SkClipOp, bool aa) override |
void | clipRRect (const SkRRect &rrect, SkClipOp, bool aa) override |
void | clipPath (const SkPath &path, SkClipOp, bool aa) override |
void | clipRegion (const SkRegion &deviceRgn, SkClipOp) override |
void | replaceClip (const SkIRect &rect) override |
bool | isClipAntiAliased () const override |
bool | isClipWideOpen () const override |
bool | isClipEmpty () const override |
bool | isClipRect () const override |
void | android_utils_clipAsRgn (SkRegion *) const override |
SkIRect | devClipBounds () const override |
Public Member Functions inherited from SkDevice | |
SkDevice (const SkImageInfo &, const SkSurfaceProps &) | |
const SkImageInfo & | imageInfo () const |
int | width () const |
int | height () const |
bool | isOpaque () const |
SkIRect | bounds () const |
SkISize | size () const |
const SkSurfaceProps & | surfaceProps () const |
SkScalerContextFlags | scalerContextFlags () const |
virtual SkStrikeDeviceInfo | strikeDeviceInfo () const |
bool | writePixels (const SkPixmap &src, int x, int y) |
bool | readPixels (const SkPixmap &dst, int x, int y) |
bool | accessPixels (SkPixmap *pmap) |
bool | peekPixels (SkPixmap *) |
const SkM44 & | localToDevice44 () const |
const SkMatrix & | localToDevice () const |
const SkM44 & | deviceToGlobal () const |
const SkM44 & | globalToDevice () const |
SkIPoint | getOrigin () const |
bool | isPixelAlignedToGlobal () const |
SkMatrix | getRelativeTransform (const SkDevice &) const |
void | setLocalToDevice (const SkM44 &localToDevice) |
void | setGlobalCTM (const SkM44 &ctm) |
void | getGlobalBounds (SkIRect *bounds) const |
SkIRect | getGlobalBounds () const |
void | clipShader (sk_sp< SkShader > sh, SkClipOp op) |
virtual bool | android_utils_clipWithStencil () |
virtual bool | useDrawCoverageMaskForMaskFilters () const |
virtual bool | isNoPixelsDevice () const |
virtual void * | getRasterHandle () const |
virtual GrRecordingContext * | recordingContext () const |
virtual skgpu::graphite::Recorder * | recorder () const |
virtual skgpu::ganesh::Device * | asGaneshDevice () |
virtual skgpu::graphite::Device * | asGraphiteDevice () |
virtual void | setImmutable () |
void | drawGlyphRunList (SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) |
virtual sk_sp< sktext::gpu::Slug > | convertGlyphRunListToSlug (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) |
virtual void | drawSlug (SkCanvas *, const sktext::gpu::Slug *slug, const SkPaint &paint) |
virtual void | drawRegion (const SkRegion &r, const SkPaint &paint) |
virtual void | drawArc (const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint) |
virtual void | drawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &) |
virtual bool | shouldDrawAsTiledImageRect () const |
virtual bool | drawAsTiledImageRect (SkCanvas *, const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) |
virtual void | drawImageLattice (const SkImage *, const SkCanvas::Lattice &, const SkRect &dst, SkFilterMode, const SkPaint &) |
virtual void | drawShadow (const SkPath &, const SkDrawShadowRec &) |
virtual void | drawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], sk_sp< SkBlender >, const SkPaint &paint) |
virtual void | drawAtlas (const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &) |
virtual void | drawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode) |
virtual void | drawEdgeAAImageSet (const SkCanvas::ImageSetEntry[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) |
virtual void | drawDrawable (SkCanvas *, SkDrawable *, const SkMatrix *) |
virtual sk_sp< SkSpecialImage > | snapSpecial (const SkIRect &subset, bool forceCopy=false) |
virtual sk_sp< SkSpecialImage > | snapSpecialScaled (const SkIRect &subset, const SkISize &dstDims) |
sk_sp< SkSpecialImage > | snapSpecial () |
virtual void | drawCoverageMask (const SkSpecialImage *, const SkMatrix &maskToDevice, const SkSamplingOptions &, const SkPaint &) |
virtual bool | drawBlurredRRect (const SkRRect &, const SkPaint &, float deviceSigma) |
void | drawFilteredImage (const skif::Mapping &mapping, SkSpecialImage *src, SkColorType ct, const SkImageFilter *, const SkSamplingOptions &, const SkPaint &) |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
virtual | ~SkRefCntBase () |
bool | unique () const |
void | ref () const |
void | unref () const |
Protected Member Functions | |
sk_sp< SkSpecialImage > | makeSpecial (const SkBitmap &) override |
sk_sp< SkSpecialImage > | makeSpecial (const SkImage *) override |
Protected Member Functions inherited from SkDevice | |
void | setDeviceCoordinateSystem (const SkM44 &deviceToGlobal, const SkM44 &globalToDevice, const SkM44 &localToDevice, int bufferOriginX, int bufferOriginY) |
void | setOrigin (const SkM44 &globalCTM, int x, int y) |
bool | checkLocalToDeviceDirty () |
Private Member Functions | |
void | onDrawGlyphRunList (SkCanvas *, const sktext::GlyphRunList &, const SkPaint &paint) override |
Friends | |
class | ScopedContentEntry |
An SkPDFDevice is the drawing context for a page or layer of PDF content.
Definition at line 50 of file SkPDFDevice.h.
SkPDFDevice::SkPDFDevice | ( | SkISize | pageSize, |
SkPDFDocument * | document, | ||
const SkMatrix & | initialTransform = SkMatrix::I() |
||
) |
pageSize | Page size in point units. 1 point == 127/360 mm == 1/72 inch |
document | A non-null pointer back to the PDFDocument object. The document is responsible for de-duplicating across pages (via the SkPDFDocument) and for early serializing of large immutable objects, such as images (via SkPDFDocument::serialize()). |
initialTransform | Transform to be applied to the entire page. |
Definition at line 322 of file SkPDFDevice.cpp.
|
overridedefault |
std::unique_ptr< SkStreamAsset > SkPDFDevice::content | ( | ) |
Returns a SkStream with the page contents.
Definition at line 1047 of file SkPDFDevice.cpp.
|
overridevirtual |
Create a new device based on CreateInfo. If the paint is not null, then it represents a preview of how the new device will be composed with its creator device (this).
The subclass may be handed this device in drawDevice(), so it must always return a device that it knows how to draw, and that it knows how to identify if it is not of the same subclass (since drawDevice is passed a SkDevice*). If the subclass cannot fulfill that contract (e.g. PDF cannot support some settings on the paint) it should return NULL, and the caller may then decide to explicitly create a bitmapdevice, knowing that later it could not call drawDevice with it (but it could call drawSprite or drawBitmap).
Reimplemented from SkDevice.
Definition at line 224 of file SkPDFDevice.cpp.
|
overridevirtual |
Reimplemented from SkDevice.
Definition at line 342 of file SkPDFDevice.cpp.
|
overridevirtual |
The SkDevice passed will be an SkDevice which was returned by a call to onCreateDevice on this device with kNeverTile_TileExpectation.
The default implementation calls snapSpecial() and drawSpecial() with the relative transform from the input device to this device. The provided SkPaint cannot have a mask filter or image filter, and any shader is ignored.
Reimplemented from SkDevice.
Definition at line 1719 of file SkPDFDevice.cpp.
|
overridevirtual |
Implements SkDevice.
Definition at line 643 of file SkPDFDevice.cpp.
|
overridevirtual |
Implements SkDevice.
Definition at line 997 of file SkPDFDevice.cpp.
Implements SkDevice.
Definition at line 497 of file SkPDFDevice.cpp.
|
overridevirtual |
These are called inside the per-device-layer loop for each draw call. When these are called, we have already applied any saveLayer operations, and are handling any looping from the paint.
Implements SkDevice.
Definition at line 391 of file SkPDFDevice.cpp.
|
overridevirtual |
If pathIsMutable, then the implementation is allowed to cast path to a non-const pointer and modify it in place (as an optimization). Canvas may do this to implement helpers such as drawOval, by placing a temp path on the stack to hold the representation of the oval.
Implements SkDevice.
Definition at line 501 of file SkPDFDevice.cpp.
|
overridevirtual |
Implements SkDevice.
Definition at line 407 of file SkPDFDevice.cpp.
Implements SkDevice.
Definition at line 493 of file SkPDFDevice.cpp.
|
overridevirtual |
Draw the special image's subset to this device, subject to the given matrix transform instead of the device's current local to device matrix.
If 'constraint' is kFast, the rendered geometry of the image still reflects the extent of the SkSpecialImage's subset, but it's assumed that the pixel data beyond the subset is valid (e.g. SkSpecialImage::makeSubset() was called to crop a larger image).
Reimplemented from SkDevice.
Definition at line 1756 of file SkPDFDevice.cpp.
Definition at line 654 of file SkPDFDevice.cpp.
|
overridevirtual |
If skipColorXform is true, then the implementation should assume that the provided vertex colors are already in the destination color space.
Implements SkDevice.
Definition at line 990 of file SkPDFDevice.cpp.
|
inline |
Definition at line 115 of file SkPDFDevice.h.
|
inline |
Definition at line 65 of file SkPDFDevice.h.
std::unique_ptr< SkPDFDict > SkPDFDevice::makeResourceDict | ( | ) |
Create the resource dictionary for this device. Destructive.
Definition at line 1040 of file SkPDFDevice.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkDevice.
Definition at line 1773 of file SkPDFDevice.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkDevice.
Definition at line 1777 of file SkPDFDevice.cpp.
|
overridevirtual |
Reimplemented from SkDevice.
Definition at line 1025 of file SkPDFDevice.cpp.
|
overrideprivatevirtual |
Implements SkDevice.
Definition at line 981 of file SkPDFDevice.cpp.
|
friend |
Definition at line 124 of file SkPDFDevice.h.