Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
skgpu::ganesh::AtlasTextOp Class Referencefinal

#include <AtlasTextOp.h>

Inheritance diagram for skgpu::ganesh::AtlasTextOp:
GrMeshDrawOp GrDrawOp GrOp SkNoncopyable

Classes

struct  Geometry
 

Public Types

enum class  MaskType : uint32_t {
  kGrayscaleCoverage , kLCDCoverage , kColorBitmap , kAliasedDistanceField ,
  kGrayscaleDistanceField , kLCDDistanceField , kLast = kLCDDistanceField
}
 
- Public Types inherited from GrDrawOp
enum class  ClipResult { kFail , kClippedGeometrically , kClippedInShader , kClippedOut }
 
- Public Types inherited from GrOp
enum class  CombineResult { kMerged , kMayChain , kCannotCombine }
 
enum class  HasAABloat : bool { kNo = false , kYes = true }
 
enum class  IsHairline : bool { kNo = false , kYes = true }
 
using Owner = std::unique_ptr< GrOp >
 

Public Member Functions

DEFINE_OP_CLASS_ID ~AtlasTextOp () override
 
void * operator new (size_t s)
 
void operator delete (void *b) noexcept
 
const char * name () const override
 
void visitProxies (const GrVisitProxyFunc &) const override
 
FixedFunctionFlags fixedFunctionFlags () const override
 
GrProcessorSet::Analysis finalize (const GrCaps &, const GrAppliedClip *, GrClampType) override
 
- Public Member Functions inherited from GrDrawOp
 GrDrawOp (uint32_t classID)
 
virtual bool usesMSAA () const
 
virtual ClipResult clipToShape (skgpu::ganesh::SurfaceDrawContext *, SkClipOp, const SkMatrix &, const GrShape &, GrAA)
 
virtual GrProcessorSet::Analysis finalize (const GrCaps &, const GrAppliedClip *, GrClampType)=0
 
virtual bool usesStencil () const
 
- Public Member Functions inherited from GrOp
virtual ~GrOp ()=default
 
virtual const char * name () const =0
 
virtual void visitProxies (const GrVisitProxyFunc &) const
 
CombineResult combineIfPossible (GrOp *that, SkArenaAlloc *alloc, const GrCaps &caps)
 
const SkRectbounds () const
 
void setClippedBounds (const SkRect &clippedBounds)
 
bool hasAABloat () const
 
bool hasZeroArea () const
 
void operator delete (void *p)
 
template<typename T >
const Tcast () const
 
template<typename T >
Tcast ()
 
uint32_t classID () const
 
uint32_t uniqueID () const
 
void prePrepare (GrRecordingContext *context, const GrSurfaceProxyView &dstView, GrAppliedClip *clip, const GrDstProxyView &dstProxyView, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
void prepare (GrOpFlushState *state)
 
void execute (GrOpFlushState *state, const SkRect &chainBounds)
 
void chainConcat (GrOp::Owner)
 
bool isChainHead () const
 
bool isChainTail () const
 
GrOpnextInChain () const
 
GrOpprevInChain () const
 
GrOp::Owner cutChain ()
 
void setBounds (const SkRect &newBounds, HasAABloat aabloat, IsHairline zeroArea)
 
void setTransformedBounds (const SkRect &srcBounds, const SkMatrix &m, HasAABloat aabloat, IsHairline zeroArea)
 
void makeFullScreen (GrSurfaceProxy *proxy)
 

Static Public Member Functions

static void ClearCache ()
 
- Static Public Member Functions inherited from GrMeshDrawOp
static bool CanUpgradeAAOnMerge (GrAAType aa1, GrAAType aa2)
 
- Static Public Member Functions inherited from GrOp
template<typename Op , typename... Args>
static Owner Make (GrRecordingContext *context, Args &&... args)
 
template<typename Op , typename... Args>
static Owner MakeWithProcessorSet (GrRecordingContext *context, const SkPMColor4f &color, GrPaint &&paint, Args &&... args)
 
template<typename Op , typename... Args>
static Owner MakeWithExtraMemory (GrRecordingContext *context, size_t extraSize, Args &&... args)
 
static uint32_t GenOpClassID ()
 

Static Public Attributes

static constexpr int kMaskTypeCount = static_cast<int>(MaskType::kLast) + 1
 

Friends

class GrOp
 

Additional Inherited Members

- Protected Types inherited from GrDrawOp
enum class  FixedFunctionFlags : uint32_t { kNone = 0x0 , kUsesHWAA = 0x1 , kUsesStencil = 0x2 }
 
- Protected Member Functions inherited from GrMeshDrawOp
 GrMeshDrawOp (uint32_t classID)
 
void createProgramInfo (const GrCaps *caps, SkArenaAlloc *arena, const GrSurfaceProxyView &writeView, bool usesMSAASurface, GrAppliedClip &&appliedClip, const GrDstProxyView &dstProxyView, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
void createProgramInfo (GrMeshDrawTarget *)
 
virtual void onPrePrepareDraws (GrRecordingContext *, const GrSurfaceProxyView &writeView, GrAppliedClip *, const GrDstProxyView &, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
- Protected Member Functions inherited from GrDrawOp
 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (FixedFunctionFlags)
 
virtual FixedFunctionFlags fixedFunctionFlags () const
 
- Static Protected Member Functions inherited from GrMeshDrawOp
static bool CombinedQuadCountWillOverflow (GrAAType aaType, bool willBeUpgradedToAA, int combinedQuadCount)
 

Detailed Description

Definition at line 52 of file AtlasTextOp.h.

Member Enumeration Documentation

◆ MaskType

enum class skgpu::ganesh::AtlasTextOp::MaskType : uint32_t
strong
Enumerator
kGrayscaleCoverage 
kLCDCoverage 
kColorBitmap 
kAliasedDistanceField 
kGrayscaleDistanceField 
kLCDDistanceField 
kLast 

Definition at line 121 of file AtlasTextOp.h.

121 : uint32_t {
122 kGrayscaleCoverage,
123 kLCDCoverage,
124 kColorBitmap,
125#if !defined(SK_DISABLE_SDF_TEXT)
126 kAliasedDistanceField,
127 kGrayscaleDistanceField,
128 kLCDDistanceField,
129
130 kLast = kLCDDistanceField
131#else
132 kLast = kColorBitmap
133#endif
134 };

Constructor & Destructor Documentation

◆ ~AtlasTextOp()

DEFINE_OP_CLASS_ID skgpu::ganesh::AtlasTextOp::~AtlasTextOp ( )
inlineoverride

Definition at line 56 of file AtlasTextOp.h.

56 {
57 for (const Geometry* g = fHead; g != nullptr;) {
58 const Geometry* next = g->fNext;
59 g->~Geometry();
60 g = next;
61 }
62 }
static float next(float f)

Member Function Documentation

◆ ClearCache()

void skgpu::ganesh::AtlasTextOp::ClearCache ( )
static

Definition at line 79 of file AtlasTextOp.cpp.

79 {
80 ::operator delete(gCache);
81 gCache = nullptr;
82}
static thread_local void * gCache
Definition: AtlasTextOp.cpp:62

◆ finalize()

GrProcessorSet::Analysis skgpu::ganesh::AtlasTextOp::finalize ( const GrCaps ,
const GrAppliedClip ,
GrClampType   
)
overridevirtual

This is called after the GrAppliedClip has been computed and just prior to recording the op or combining it with a previously recorded op. The op should convert any proxies or resources it owns to "pending io" status so that resource allocation can be more optimal. Additionally, at this time the op must report whether a copy of the destination (or destination texture itself) needs to be provided to the GrXferProcessor when this op executes.

Implements GrDrawOp.

Definition at line 185 of file AtlasTextOp.cpp.

187 {
190 if (this->maskType() == MaskType::kColorBitmap) {
191 color.setToUnknown();
192 } else {
193 // finalize() is called before any merging is done, so at this point there's at most one
194 // Geometry with a color. Later, for non-bitmap ops, we may have mixed colors.
195 color.setToConstant(fHead->fColor);
196 }
197
198 switch (this->maskType()) {
200#if !defined(SK_DISABLE_SDF_TEXT)
203#endif
205 break;
207#if !defined(SK_DISABLE_SDF_TEXT)
209#endif
211 break;
214 break;
215 }
216
217 auto analysis = fProcessors.finalize(color, coverage, clip, &GrUserStencilSettings::kUnused,
218 caps, clampType, &fHead->fColor);
219 // TODO(michaelludwig): Once processor analysis can be done external to op creation/finalization
220 // the atlas op metadata can be fully const. This is okay for now since finalize() happens
221 // before the op is merged, so during combineIfPossible, metadata is effectively const.
222 fUsesLocalCoords = analysis.usesLocalCoords();
223 return analysis;
224}
GrProcessorAnalysisCoverage
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
Analysis finalize(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage, const GrAppliedClip *, const GrUserStencilSettings *, const GrCaps &, GrClampType, SkPMColor4f *inputColorOverride)
DlColor color
static const GrUserStencilSettings & kUnused

◆ fixedFunctionFlags()

GrDrawOp::FixedFunctionFlags skgpu::ganesh::AtlasTextOp::fixedFunctionFlags ( ) const
overridevirtual

Reimplemented from GrDrawOp.

Definition at line 181 of file AtlasTextOp.cpp.

◆ name()

const char * skgpu::ganesh::AtlasTextOp::name ( ) const
inlineoverridevirtual

Implements GrOp.

Definition at line 113 of file AtlasTextOp.h.

113{ return "AtlasTextOp"; }

◆ operator delete()

void skgpu::ganesh::AtlasTextOp::operator delete ( void *  b)
noexcept

Definition at line 71 of file AtlasTextOp.cpp.

71 {
72 if (gCache == nullptr) {
73 gCache = bytes;
74 return;
75 }
76 ::operator delete(bytes);
77}

◆ operator new()

void * skgpu::ganesh::AtlasTextOp::operator new ( size_t  s)

Definition at line 63 of file AtlasTextOp.cpp.

63 {
64 if (gCache != nullptr) {
65 return std::exchange(gCache, nullptr);
66 }
67
68 return ::operator new(s);
69}
struct MyStruct s

◆ visitProxies()

void skgpu::ganesh::AtlasTextOp::visitProxies ( const GrVisitProxyFunc func) const
overridevirtual

Reimplemented from GrOp.

Definition at line 160 of file AtlasTextOp.cpp.

160 {
161 fProcessors.visitProxies(func);
162}
void visitProxies(const GrVisitProxyFunc &) const

Friends And Related Function Documentation

◆ GrOp

friend class GrOp
friend

Definition at line 138 of file AtlasTextOp.h.

Member Data Documentation

◆ kMaskTypeCount

constexpr int skgpu::ganesh::AtlasTextOp::kMaskTypeCount = static_cast<int>(MaskType::kLast) + 1
inlinestaticconstexpr

Definition at line 135 of file AtlasTextOp.h.


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