Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
GrDrawOp Class Referenceabstract

#include <GrDrawOp.h>

Inheritance diagram for GrDrawOp:
GrOp SkNoncopyable GrMeshDrawOp GrThreadSafeVertexTestOp LazyFailedInstantiationTestOp LazyProxyTest::Op skgpu::ganesh::DrawAtlasPathOp skgpu::ganesh::PathInnerTriangulateOp skgpu::ganesh::PathStencilCoverOp skgpu::ganesh::PathTessellateOp skgpu::ganesh::StrokeTessellateOp

Public Types

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

 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)
 

Protected Types

enum class  FixedFunctionFlags : uint32_t { kNone = 0x0 , kUsesHWAA = 0x1 , kUsesStencil = 0x2 }
 

Protected Member Functions

 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (FixedFunctionFlags)
 
virtual FixedFunctionFlags fixedFunctionFlags () const
 

Friends

class GrSimpleMeshDrawOpHelper
 
class GrSimpleMeshDrawOpHelperWithStencil
 

Additional Inherited Members

- 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 ()
 

Detailed Description

Base class for GrOps that draw. These ops can draw into an op list's GrRenderTarget.

Definition at line 29 of file GrDrawOp.h.

Member Enumeration Documentation

◆ ClipResult

enum class GrDrawOp::ClipResult
strong

Specifies the effect of clipToShape().

Enumerator
kFail 
kClippedGeometrically 
kClippedInShader 
kClippedOut 

Definition at line 44 of file GrDrawOp.h.

44 {
45 // No clip was applied.
46 kFail,
47 // The clip was applied to the op's actual geometry. The clip stack is free to disable the
48 // scissor test.
49 kClippedGeometrically,
50 // The clip was applied via shader coverage. The clip stack will still use a scissor test
51 // in order to reduce overdraw of transparent pixels.
52 kClippedInShader,
53 // The op can be thrown out entirely.
54 kClippedOut
55 };

◆ FixedFunctionFlags

enum class GrDrawOp::FixedFunctionFlags : uint32_t
strongprotected

DEPRECATED: This is a legacy implementation for usesMSAA() and usesStencil(). Newer ops should override those methods directly.

Enumerator
kNone 
kUsesHWAA 

Indices that the op will enable MSAA.

kUsesStencil 

Indices that the op reads and/or writes the stencil buffer

Definition at line 104 of file GrDrawOp.h.

104 : uint32_t {
105 kNone = 0x0,
106 /** Indices that the op will enable MSAA. */
107 kUsesHWAA = 0x1,
108 /** Indices that the op reads and/or writes the stencil buffer */
109 kUsesStencil = 0x2,
110 };
@ kNone
Definition: layer.h:53

Constructor & Destructor Documentation

◆ GrDrawOp()

GrDrawOp::GrDrawOp ( uint32_t  classID)
inline

Definition at line 31 of file GrDrawOp.h.

31: INHERITED(classID) {}
uint32_t classID() const
Definition: GrOp.h:158

Member Function Documentation

◆ clipToShape()

virtual ClipResult GrDrawOp::clipToShape ( skgpu::ganesh::SurfaceDrawContext ,
SkClipOp  ,
const SkMatrix ,
const GrShape ,
GrAA   
)
inlinevirtual

This is called while the clip is being computed, before finalize(), and before any attempts to combine with other ops. If the op knows how to clip its own geometry then it will generally be much faster than a generalized clip method.

Definition at line 62 of file GrDrawOp.h.

66 {
67 return ClipResult::kFail;
68 }

◆ finalize()

virtual GrProcessorSet::Analysis GrDrawOp::finalize ( const GrCaps ,
const GrAppliedClip ,
GrClampType   
)
pure virtual

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.

Implemented in skgpu::ganesh::AtlasTextOp, skgpu::ganesh::DrawAtlasPathOp, skiagm::BezierTestOp, CircleOp, ButtCapDashedCircleOp, EllipseOp, DIEllipseOp, CircularRRectOp, EllipticalRRectOp, and TestVertexOp.

◆ fixedFunctionFlags()

virtual FixedFunctionFlags GrDrawOp::fixedFunctionFlags ( ) const
inlineprotectedvirtual

Reimplemented in skiagm::BezierTestOp, skgpu::ganesh::AtlasTextOp, skgpu::ganesh::DrawAtlasPathOp, CircleOp, ButtCapDashedCircleOp, EllipseOp, DIEllipseOp, CircularRRectOp, EllipticalRRectOp, and TestVertexOp.

Definition at line 112 of file GrDrawOp.h.

112 {
113 // Override usesMSAA() and usesStencil() instead.
114 SK_ABORT("fixedFunctionFlags() not implemented.");
115 }
#define SK_ABORT(message,...)
Definition: SkAssert.h:70

◆ GR_DECL_BITFIELD_CLASS_OPS_FRIENDS()

GrDrawOp::GR_DECL_BITFIELD_CLASS_OPS_FRIENDS ( FixedFunctionFlags  )
protected

◆ usesMSAA()

virtual bool GrDrawOp::usesMSAA ( ) const
inlinevirtual

Called before setting up the GrAppliedClip and before finalize. This information is required to determine how to compute a GrAppliedClip from a GrClip for this op.

Definition at line 37 of file GrDrawOp.h.

37 {
39 }
virtual FixedFunctionFlags fixedFunctionFlags() const
Definition: GrDrawOp.h:112

◆ usesStencil()

virtual bool GrDrawOp::usesStencil ( ) const
inlinevirtual

Called after finalize, at which point every op should know whether it will need stencil.

Definition at line 82 of file GrDrawOp.h.

Friends And Related Function Documentation

◆ GrSimpleMeshDrawOpHelper

friend class GrSimpleMeshDrawOpHelper
friend

Definition at line 118 of file GrDrawOp.h.

◆ GrSimpleMeshDrawOpHelperWithStencil

Definition at line 119 of file GrDrawOp.h.


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