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

#include <GrAppliedClip.h>

Public Member Functions

 GrAppliedHardClip (const SkISize &rtDims)
 
 GrAppliedHardClip (const SkISize &logicalRTDims, const SkISize &backingStoreDims)
 
 GrAppliedHardClip (GrAppliedHardClip &&that)=default
 
 GrAppliedHardClip (const GrAppliedHardClip &)=default
 
const GrScissorStatescissorState () const
 
const GrWindowRectsStatewindowRectsState () const
 
uint32_t stencilStackID () const
 
bool hasStencilClip () const
 
bool addScissor (const SkIRect &irect, SkRect *clippedDrawBounds)
 
void setScissor (const SkIRect &irect)
 
void addWindowRectangles (const GrWindowRectsState &windowState)
 
void addWindowRectangles (const GrWindowRectangles &windows, GrWindowRectsState::Mode mode)
 
void addStencilClip (uint32_t stencilStackID)
 
bool doesClip () const
 
bool operator== (const GrAppliedHardClip &that) const
 
bool operator!= (const GrAppliedHardClip &that) const
 

Static Public Member Functions

static const GrAppliedHardClipDisabled ()
 

Detailed Description

Produced by GrHardClip. It provides a set of modifications to the hardware drawing state that implement the clip.

Definition at line 22 of file GrAppliedClip.h.

Constructor & Destructor Documentation

◆ GrAppliedHardClip() [1/4]

GrAppliedHardClip::GrAppliedHardClip ( const SkISize rtDims)
inline

Definition at line 32 of file GrAppliedClip.h.

32: fScissorState(rtDims) {}

◆ GrAppliedHardClip() [2/4]

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

Definition at line 33 of file GrAppliedClip.h.

34 : fScissorState(backingStoreDims) {
35 fScissorState.set(SkIRect::MakeSize(logicalRTDims));
36 }
bool set(const SkIRect &rect)
static constexpr SkIRect MakeSize(const SkISize &size)
Definition: SkRect.h:66

◆ GrAppliedHardClip() [3/4]

GrAppliedHardClip::GrAppliedHardClip ( GrAppliedHardClip &&  that)
default

◆ GrAppliedHardClip() [4/4]

GrAppliedHardClip::GrAppliedHardClip ( const GrAppliedHardClip )
explicitdefault

Member Function Documentation

◆ addScissor()

bool GrAppliedHardClip::addScissor ( const SkIRect irect,
SkRect clippedDrawBounds 
)
inline

Intersects the applied clip with the provided rect. Returns false if the draw became empty. 'clippedDrawBounds' will be intersected with 'irect'. This returns false if the clip becomes empty or the draw no longer intersects the clip. In either case the draw can be skipped.

Definition at line 51 of file GrAppliedClip.h.

51 {
52 return fScissorState.intersect(irect) && clippedDrawBounds->intersect(SkRect::Make(irect));
53 }
bool intersect(const SkIRect &rect)
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669
bool intersect(const SkRect &r)
Definition: SkRect.cpp:114

◆ addStencilClip()

void GrAppliedHardClip::addStencilClip ( uint32_t  stencilStackID)
inline

Definition at line 69 of file GrAppliedClip.h.

69 {
70 SkASSERT(SkClipStack::kInvalidGenID == fStencilStackID);
71 fStencilStackID = stencilStackID;
72 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
uint32_t stencilStackID() const
Definition: GrAppliedClip.h:43
static const uint32_t kInvalidGenID
Definition: SkClipStack.h:383

◆ addWindowRectangles() [1/2]

void GrAppliedHardClip::addWindowRectangles ( const GrWindowRectangles windows,
GrWindowRectsState::Mode  mode 
)
inline

Definition at line 64 of file GrAppliedClip.h.

64 {
65 SkASSERT(!fWindowRectsState.enabled());
66 fWindowRectsState.set(windows, mode);
67 }
void set(const GrWindowRectangles &windows, Mode mode)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ addWindowRectangles() [2/2]

void GrAppliedHardClip::addWindowRectangles ( const GrWindowRectsState windowState)
inline

Definition at line 59 of file GrAppliedClip.h.

59 {
60 SkASSERT(!fWindowRectsState.enabled());
61 fWindowRectsState = windowState;
62 }

◆ Disabled()

static const GrAppliedHardClip & GrAppliedHardClip::Disabled ( )
inlinestatic

Definition at line 24 of file GrAppliedClip.h.

24 {
25 // The size doesn't really matter here since it's returned as const& so an actual scissor
26 // will never be set on it, and applied clips are not used to query or bounds test like
27 // the GrClip is.
28 static const GrAppliedHardClip kDisabled({1 << 29, 1 << 29});
29 return kDisabled;
30 }

◆ doesClip()

bool GrAppliedHardClip::doesClip ( ) const
inline

Definition at line 74 of file GrAppliedClip.h.

74 {
75 return fScissorState.enabled() || this->hasStencilClip() || fWindowRectsState.enabled();
76 }
bool hasStencilClip() const
Definition: GrAppliedClip.h:44
bool enabled() const

◆ hasStencilClip()

bool GrAppliedHardClip::hasStencilClip ( ) const
inline

Definition at line 44 of file GrAppliedClip.h.

44{ return SkClipStack::kInvalidGenID != fStencilStackID; }

◆ operator!=()

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

Definition at line 83 of file GrAppliedClip.h.

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

◆ operator==()

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

Definition at line 78 of file GrAppliedClip.h.

78 {
79 return fScissorState == that.fScissorState &&
80 fWindowRectsState == that.fWindowRectsState &&
81 fStencilStackID == that.fStencilStackID;
82 }

◆ scissorState()

const GrScissorState & GrAppliedHardClip::scissorState ( ) const
inline

Definition at line 41 of file GrAppliedClip.h.

41{ return fScissorState; }

◆ setScissor()

void GrAppliedHardClip::setScissor ( const SkIRect irect)
inline

Definition at line 55 of file GrAppliedClip.h.

55 {
56 fScissorState.set(irect);
57 }

◆ stencilStackID()

uint32_t GrAppliedHardClip::stencilStackID ( ) const
inline

Definition at line 43 of file GrAppliedClip.h.

43{ return fStencilStackID; }

◆ windowRectsState()

const GrWindowRectsState & GrAppliedHardClip::windowRectsState ( ) const
inline

Definition at line 42 of file GrAppliedClip.h.

42{ return fWindowRectsState; }

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