Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | List of all members
GlyphTrackingDevice Class Referencefinal
Inheritance diagram for GlyphTrackingDevice:
SkNoPixelsDevice SkDevice SkRefCnt SkRefCntBase

Public Member Functions

 GlyphTrackingDevice (const SkISize &dimensions, const SkSurfaceProps &props, SkStrikeServerImpl *server, sk_sp< SkColorSpace > colorSpace, sktext::gpu::SDFTControl SDFTControl)
 
sk_sp< SkDevicecreateDevice (const CreateInfo &cinfo, const SkPaint *) override
 
SkStrikeDeviceInfo strikeDeviceInfo () const override
 
- Public Member Functions inherited from SkNoPixelsDevice
 SkNoPixelsDevice (const SkIRect &bounds, const SkSurfaceProps &props)
 
 SkNoPixelsDevice (const SkIRect &bounds, const SkSurfaceProps &props, sk_sp< SkColorSpace > colorSpace)
 
bool resetForNextPicture (const SkIRect &bounds)
 
void pushClipStack () override
 
void popClipStack () override
 
void clipRect (const SkRect &rect, SkClipOp op, bool aa) override
 
void clipRRect (const SkRRect &rrect, SkClipOp op, bool aa) override
 
void clipPath (const SkPath &path, SkClipOp op, bool aa) override
 
void clipRegion (const SkRegion &globalRgn, SkClipOp op) override
 
void replaceClip (const SkIRect &rect) override
 
bool isClipAntiAliased () const override
 
bool isClipEmpty () const override
 
bool isClipRect () const override
 
bool isClipWideOpen () const override
 
void android_utils_clipAsRgn (SkRegion *rgn) const override
 
SkIRect devClipBounds () const override
 
- Public Member Functions inherited from SkDevice
 SkDevice (const SkImageInfo &, const SkSurfaceProps &)
 
const SkImageInfoimageInfo () const
 
int width () const
 
int height () const
 
bool isOpaque () const
 
SkIRect bounds () const
 
SkISize size () const
 
const SkSurfacePropssurfaceProps () 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 SkM44localToDevice44 () const
 
const SkMatrixlocalToDevice () const
 
const SkM44deviceToGlobal () const
 
const SkM44globalToDevice () 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
 
virtual SkIRect devClipBounds () const =0
 
virtual void pushClipStack ()=0
 
virtual void popClipStack ()=0
 
virtual void clipRect (const SkRect &rect, SkClipOp op, bool aa)=0
 
virtual void clipRRect (const SkRRect &rrect, SkClipOp op, bool aa)=0
 
virtual void clipPath (const SkPath &path, SkClipOp op, bool aa)=0
 
virtual void clipRegion (const SkRegion &region, SkClipOp op)=0
 
void clipShader (sk_sp< SkShader > sh, SkClipOp op)
 
virtual void replaceClip (const SkIRect &rect)=0
 
virtual bool isClipAntiAliased () const =0
 
virtual bool isClipEmpty () const =0
 
virtual bool isClipRect () const =0
 
virtual bool isClipWideOpen () const =0
 
virtual void android_utils_clipAsRgn (SkRegion *) const =0
 
virtual bool android_utils_clipWithStencil ()
 
virtual bool useDrawCoverageMaskForMaskFilters () const
 
virtual bool isNoPixelsDevice () const
 
virtual void * getRasterHandle () const
 
virtual GrRecordingContextrecordingContext () const
 
virtual skgpu::graphite::Recorderrecorder () const
 
virtual skgpu::ganesh::DeviceasGaneshDevice ()
 
virtual skgpu::graphite::DeviceasGraphiteDevice ()
 
virtual void setImmutable ()
 
virtual sk_sp< SkSurfacemakeSurface (const SkImageInfo &, const SkSurfaceProps &)
 
virtual sk_sp< SkDevicecreateDevice (const CreateInfo &, const SkPaint *)
 
void drawGlyphRunList (SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
 
virtual sk_sp< sktext::gpu::SlugconvertGlyphRunListToSlug (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
 
virtual void drawSlug (SkCanvas *, const sktext::gpu::Slug *slug, const SkPaint &paint)
 
virtual void drawPaint (const SkPaint &paint)=0
 
virtual void drawPoints (SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint)=0
 
virtual void drawRect (const SkRect &r, const SkPaint &paint)=0
 
virtual void drawRegion (const SkRegion &r, const SkPaint &paint)
 
virtual void drawOval (const SkRect &oval, const SkPaint &paint)=0
 
virtual void drawArc (const SkArc &arc, const SkPaint &paint)
 
virtual void drawRRect (const SkRRect &rr, const SkPaint &paint)=0
 
virtual void drawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &)
 
virtual void drawPath (const SkPath &path, const SkPaint &paint, bool pathIsMutable=false)=0
 
virtual void drawImageRect (const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)=0
 
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 drawVertices (const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform=false)=0
 
virtual void drawMesh (const SkMesh &mesh, sk_sp< SkBlender >, const SkPaint &)=0
 
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 drawAnnotation (const SkRect &, const char[], SkData *)
 
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< SkSpecialImagesnapSpecial (const SkIRect &subset, bool forceCopy=false)
 
virtual sk_sp< SkSpecialImagesnapSpecialScaled (const SkIRect &subset, const SkISize &dstDims)
 
sk_sp< SkSpecialImagesnapSpecial ()
 
virtual void drawDevice (SkDevice *, const SkSamplingOptions &, const SkPaint &)
 
virtual void drawSpecial (SkSpecialImage *, const SkMatrix &localToDevice, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint constraint=SkCanvas::kStrict_SrcRectConstraint)
 
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

void onDrawGlyphRunList (SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) override
 
sk_sp< sktext::gpu::SlugconvertGlyphRunListToSlug (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) override
 
- Protected Member Functions inherited from SkNoPixelsDevice
void drawPaint (const SkPaint &paint) override
 
void drawPoints (SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint &) override
 
void drawImageRect (const SkImage *, const SkRect *, const SkRect &, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
 
void drawRect (const SkRect &, const SkPaint &) override
 
void drawOval (const SkRect &, const SkPaint &) override
 
void drawRRect (const SkRRect &, const SkPaint &) override
 
void drawPath (const SkPath &, const SkPaint &, bool) override
 
void drawDevice (SkDevice *, const SkSamplingOptions &, const SkPaint &) override
 
void drawVertices (const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override
 
void drawMesh (const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
 
void drawSlug (SkCanvas *, const sktext::gpu::Slug *, const SkPaint &) override
 
void onDrawGlyphRunList (SkCanvas *, const sktext::GlyphRunList &, const SkPaint &) override
 
bool isNoPixelsDevice () const override
 
- Protected Member Functions inherited from SkDevice
virtual sk_sp< SkSpecialImagemakeSpecial (const SkBitmap &)
 
virtual sk_sp< SkSpecialImagemakeSpecial (const SkImage *)
 
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 ()
 

Detailed Description

Definition at line 447 of file SkChromeRemoteGlyphCache.cpp.

Constructor & Destructor Documentation

◆ GlyphTrackingDevice()

GlyphTrackingDevice::GlyphTrackingDevice ( const SkISize dimensions,
const SkSurfaceProps props,
SkStrikeServerImpl server,
sk_sp< SkColorSpace colorSpace,
sktext::gpu::SDFTControl  SDFTControl 
)
inline

Definition at line 449 of file SkChromeRemoteGlyphCache.cpp.

452 : SkNoPixelsDevice(SkIRect::MakeSize(dimensions), props, std::move(colorSpace))
453 , fStrikeServerImpl(server)
454 , fSDFTControl(SDFTControl) {
455 SkASSERT(fStrikeServerImpl != nullptr);
456 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkNoPixelsDevice(const SkIRect &bounds, const SkSurfaceProps &props)
Definition: SkDevice.cpp:512
static constexpr SkIRect MakeSize(const SkISize &size)
Definition: SkRect.h:66

Member Function Documentation

◆ convertGlyphRunListToSlug()

sk_sp< sktext::gpu::Slug > GlyphTrackingDevice::convertGlyphRunListToSlug ( const sktext::GlyphRunList glyphRunList,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkDevice.

Definition at line 495 of file SkChromeRemoteGlyphCache.cpp.

496 {
497 // Full matrix for placing glyphs.
498 SkMatrix positionMatrix = this->localToDevice();
499 positionMatrix.preTranslate(glyphRunList.origin().x(), glyphRunList.origin().y());
500
501 // Use the SkStrikeServer's strike cache to generate the Slug.
503 glyphRunList,
504 paint,
505 this->strikeDeviceInfo(),
506 fStrikeServerImpl);
507 }
SkStrikeDeviceInfo strikeDeviceInfo() const override
const SkMatrix & localToDevice() const
Definition: SkDevice.h:179
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.cpp:263
SkPoint origin() const
Definition: GlyphRun.h:114
const Paint & paint
Definition: color_source.cc:38
sk_sp< Slug > MakeSlug(const SkMatrix &drawMatrix, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint, SkStrikeDeviceInfo strikeDeviceInfo, sktext::StrikeForGPUCacheInterface *strikeCache)
Definition: TextBlob.cpp:255
constexpr float y() const
Definition: SkPoint_impl.h:187
constexpr float x() const
Definition: SkPoint_impl.h:181

◆ createDevice()

sk_sp< SkDevice > GlyphTrackingDevice::createDevice ( const CreateInfo ,
const SkPaint  
)
inlineoverridevirtual

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 458 of file SkChromeRemoteGlyphCache.cpp.

458 {
460 this->surfaceProps().cloneWithPixelGeometry(cinfo.fPixelGeometry);
461
462 return sk_make_sp<GlyphTrackingDevice>(cinfo.fInfo.dimensions(),
464 fStrikeServerImpl,
465 cinfo.fInfo.refColorSpace(),
466 fSDFTControl);
467 }
const SkSurfaceProps & surfaceProps() const
Definition: SkDevice.h:131
SkSurfaceProps cloneWithPixelGeometry(SkPixelGeometry newPixelGeometry) const

◆ onDrawGlyphRunList()

void GlyphTrackingDevice::onDrawGlyphRunList ( SkCanvas ,
const sktext::GlyphRunList glyphRunList,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkNoPixelsDevice.

Definition at line 474 of file SkChromeRemoteGlyphCache.cpp.

476 {
477 SkMatrix drawMatrix = this->localToDevice();
478 drawMatrix.preTranslate(glyphRunList.origin().x(), glyphRunList.origin().y());
479
480 // Just ignore the resulting SubRunContainer. Since we're passing in a null SubRunAllocator
481 // no SubRuns will be produced.
482 STSubRunAllocator<sizeof(SubRunContainer), alignof(SubRunContainer)> tempAlloc;
483 auto container = SubRunContainer::MakeInAlloc(glyphRunList,
484 drawMatrix,
485 paint,
486 this->strikeDeviceInfo(),
487 fStrikeServerImpl,
488 &tempAlloc,
489 SubRunContainer::kStrikeCalculationsOnly,
490 "Cache Diff");
491 // Calculations only. No SubRuns.
492 SkASSERT(container->isEmpty());
493 }

◆ strikeDeviceInfo()

SkStrikeDeviceInfo GlyphTrackingDevice::strikeDeviceInfo ( ) const
inlineoverridevirtual

Reimplemented from SkDevice.

Definition at line 469 of file SkChromeRemoteGlyphCache.cpp.

469 {
470 return {this->surfaceProps(), this->scalerContextFlags(), &fSDFTControl};
471 }
SkScalerContextFlags scalerContextFlags() const
Definition: SkDevice.cpp:498

The documentation for this class was generated from the following file: