Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrAppliedClip Class Reference

#include <GrAppliedClip.h>

Public Member Functions

 GrAppliedClip (const SkISize &rtDims)
 
 GrAppliedClip (const SkISize &logicalRTDims, const SkISize &backingStoreDims)
 
 GrAppliedClip (GrAppliedClip &&that)=default
 
 GrAppliedClip (const GrAppliedClip &)=delete
 
const GrScissorStatescissorState () const
 
const GrWindowRectsStatewindowRectsState () const
 
uint32_t stencilStackID () const
 
bool hasStencilClip () const
 
int hasCoverageFragmentProcessor () const
 
const GrFragmentProcessorcoverageFragmentProcessor () const
 
std::unique_ptr< GrFragmentProcessordetachCoverageFragmentProcessor ()
 
const GrAppliedHardCliphardClip () const
 
GrAppliedHardCliphardClip ()
 
void addCoverageFP (std::unique_ptr< GrFragmentProcessor > fp)
 
bool doesClip () const
 
bool operator== (const GrAppliedClip &that) const
 
bool operator!= (const GrAppliedClip &that) const
 
void visitProxies (const GrVisitProxyFunc &func) const
 

Static Public Member Functions

static GrAppliedClip Disabled ()
 

Detailed Description

Produced by GrClip. It provides a set of modifications to GrPipeline that implement the clip.

Definition at line 94 of file GrAppliedClip.h.

Constructor & Destructor Documentation

◆ GrAppliedClip() [1/4]

GrAppliedClip::GrAppliedClip ( const SkISize rtDims)
inline

Definition at line 100 of file GrAppliedClip.h.

100: fHardClip(rtDims) {}

◆ GrAppliedClip() [2/4]

GrAppliedClip::GrAppliedClip ( const SkISize logicalRTDims,
const SkISize backingStoreDims 
)
inline

Definition at line 101 of file GrAppliedClip.h.

102 : fHardClip(logicalRTDims, backingStoreDims) {}

◆ GrAppliedClip() [3/4]

GrAppliedClip::GrAppliedClip ( GrAppliedClip &&  that)
default

◆ GrAppliedClip() [4/4]

GrAppliedClip::GrAppliedClip ( const GrAppliedClip )
delete

Member Function Documentation

◆ addCoverageFP()

void GrAppliedClip::addCoverageFP ( std::unique_ptr< GrFragmentProcessor fp)
inline

Definition at line 124 of file GrAppliedClip.h.

124 {
125 if (fCoverageFP == nullptr) {
126 fCoverageFP = std::move(fp);
127 } else {
128 // Compose this coverage FP with the previously-added coverage.
129 fCoverageFP = GrFragmentProcessor::Compose(std::move(fp), std::move(fCoverageFP));
130 }
131 }
static std::unique_ptr< GrFragmentProcessor > Compose(std::unique_ptr< GrFragmentProcessor > f, std::unique_ptr< GrFragmentProcessor > g)
const uint32_t fp

◆ coverageFragmentProcessor()

const GrFragmentProcessor * GrAppliedClip::coverageFragmentProcessor ( ) const
inline

Definition at line 112 of file GrAppliedClip.h.

112 {
113 SkASSERT(fCoverageFP != nullptr);
114 return fCoverageFP.get();
115 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ detachCoverageFragmentProcessor()

std::unique_ptr< GrFragmentProcessor > GrAppliedClip::detachCoverageFragmentProcessor ( )
inline

Definition at line 116 of file GrAppliedClip.h.

116 {
117 SkASSERT(fCoverageFP != nullptr);
118 return std::move(fCoverageFP);
119 }

◆ Disabled()

static GrAppliedClip GrAppliedClip::Disabled ( )
inlinestatic

Definition at line 96 of file GrAppliedClip.h.

96 {
97 return GrAppliedClip({1 << 29, 1 << 29});
98 }
GrAppliedClip(const SkISize &rtDims)

◆ doesClip()

bool GrAppliedClip::doesClip ( ) const
inline

Definition at line 133 of file GrAppliedClip.h.

133 {
134 return fHardClip.doesClip() || fCoverageFP != nullptr;
135 }
bool doesClip() const
Definition: GrAppliedClip.h:74

◆ hardClip() [1/2]

GrAppliedHardClip & GrAppliedClip::hardClip ( )
inline

Definition at line 122 of file GrAppliedClip.h.

122{ return fHardClip; }

◆ hardClip() [2/2]

const GrAppliedHardClip & GrAppliedClip::hardClip ( ) const
inline

Definition at line 121 of file GrAppliedClip.h.

121{ return fHardClip; }

◆ hasCoverageFragmentProcessor()

int GrAppliedClip::hasCoverageFragmentProcessor ( ) const
inline

Definition at line 111 of file GrAppliedClip.h.

111{ return fCoverageFP != nullptr; }

◆ hasStencilClip()

bool GrAppliedClip::hasStencilClip ( ) const
inline

Definition at line 110 of file GrAppliedClip.h.

110{ return fHardClip.hasStencilClip(); }
bool hasStencilClip() const
Definition: GrAppliedClip.h:44

◆ operator!=()

bool GrAppliedClip::operator!= ( const GrAppliedClip that) const
inline

Definition at line 147 of file GrAppliedClip.h.

147{ return !(*this == that); }

◆ operator==()

bool GrAppliedClip::operator== ( const GrAppliedClip that) const
inline

Definition at line 137 of file GrAppliedClip.h.

137 {
138 if (fHardClip != that.fHardClip ||
139 this->hasCoverageFragmentProcessor() != that.hasCoverageFragmentProcessor()) {
140 return false;
141 }
142 if (fCoverageFP != nullptr && !fCoverageFP->isEqual(*that.fCoverageFP)) {
143 return false;
144 }
145 return true;
146 }
int hasCoverageFragmentProcessor() const

◆ scissorState()

const GrScissorState & GrAppliedClip::scissorState ( ) const
inline

Definition at line 107 of file GrAppliedClip.h.

107{ return fHardClip.scissorState(); }
const GrScissorState & scissorState() const
Definition: GrAppliedClip.h:41

◆ stencilStackID()

uint32_t GrAppliedClip::stencilStackID ( ) const
inline

Definition at line 109 of file GrAppliedClip.h.

109{ return fHardClip.stencilStackID(); }
uint32_t stencilStackID() const
Definition: GrAppliedClip.h:43

◆ visitProxies()

void GrAppliedClip::visitProxies ( const GrVisitProxyFunc func) const
inline

Definition at line 149 of file GrAppliedClip.h.

149 {
150 if (fCoverageFP != nullptr) {
151 fCoverageFP->visitProxies(func);
152 }
153 }

◆ windowRectsState()

const GrWindowRectsState & GrAppliedClip::windowRectsState ( ) const
inline

Definition at line 108 of file GrAppliedClip.h.

108{ return fHardClip.windowRectsState(); }
const GrWindowRectsState & windowRectsState() const
Definition: GrAppliedClip.h:42

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