Flutter Engine
The Flutter Engine
|
#include <StencilClip.h>
Public Member Functions | |
StencilClip (const SkISize &rtDims, uint32_t stencilStackID=SK_InvalidGenID) | |
StencilClip (const SkISize &rtDims, const SkIRect &scissorRect, uint32_t stencilStackID=SK_InvalidGenID) | |
const GrFixedClip & | fixedClip () const |
GrFixedClip & | fixedClip () |
uint32_t | stencilStackID () const |
bool | hasStencilClip () const |
void | setStencilClip (uint32_t stencilStackID) |
SkIRect | getConservativeBounds () const final |
Effect | apply (GrAppliedHardClip *out, SkIRect *bounds) const final |
PreClipResult | preApply (const SkRect &drawBounds, GrAA aa) const final |
virtual Effect | apply (GrAppliedHardClip *out, SkIRect *bounds) const =0 |
Public Member Functions inherited from GrClip | |
virtual | ~GrClip () |
virtual SkIRect | getConservativeBounds () const =0 |
virtual Effect | apply (GrRecordingContext *, skgpu::ganesh::SurfaceDrawContext *, GrDrawOp *, GrAAType, GrAppliedClip *, SkRect *bounds) const =0 |
virtual PreClipResult | preApply (const SkRect &drawBounds, GrAA aa) const |
Additional Inherited Members | |
Public Types inherited from GrClip | |
enum class | Effect { kClipped , kUnclipped , kClippedOut } |
enum class | BoundsType { kExterior , kInterior } |
Static Public Member Functions inherited from GrClip | |
static bool | IsInsideClip (const SkIRect &innerClipBounds, const SkRect &drawBounds, GrAA aa) |
static bool | IsOutsideClip (const SkIRect &outerClipBounds, const SkRect &drawBounds, GrAA aa) |
static SkIRect | GetPixelIBounds (const SkRect &bounds, GrAA aa, BoundsType mode=BoundsType::kExterior) |
static bool | IsPixelAligned (const SkRect &rect) |
Static Public Attributes inherited from GrClip | |
static constexpr SkScalar | kBoundsTolerance = 1e-3f |
static constexpr SkScalar | kHalfPixelRoundingTolerance = 5e-2f |
Implements GrHardClip with the currently-existing stencil buffer contents and GrFixedClip.
Definition at line 19 of file StencilClip.h.
|
inlineexplicit |
Definition at line 21 of file StencilClip.h.
|
inline |
Definition at line 25 of file StencilClip.h.
|
inlinefinalvirtual |
Sets the appropriate hardware state modifications on GrAppliedHardClip that will implement the clip. On input 'bounds' is a conservative bounds of the draw that is to be clipped. After return 'bounds' has been intersected with a conservative bounds of the clip.
Implements GrHardClip.
Definition at line 42 of file StencilClip.h.
|
inline |
Definition at line 32 of file StencilClip.h.
|
inline |
Definition at line 31 of file StencilClip.h.
|
inlinefinalvirtual |
Compute a conservative pixel bounds restricted to the given render target dimensions. The returned bounds represent the limits of pixels that can be drawn; anything outside of the bounds will be entirely clipped out.
Implements GrClip.
Definition at line 38 of file StencilClip.h.
|
inline |
Definition at line 35 of file StencilClip.h.
|
inlinefinalvirtual |
Perform preliminary, conservative analysis on the draw bounds as if it were provided to apply(). The results of this are returned the PreClipResults struct, where 'result.fEffect' corresponds to what 'apply' would return. If this value is kUnclipped or kNoDraw, then it can be assumed that apply() would also always result in the same Effect.
If kClipped is returned, apply() may further refine the effect to kUnclipped or kNoDraw, with one exception. When 'result.fIsRRect' is true, preApply() reports the single round rect and anti-aliased state that would act as an intersection on the draw geometry. If no further action is taken to modify the draw, apply() will represent this round rect in the applied clip.
When set, 'result.fRRect' will intersect with the render target bounds but may extend beyond it. If the render target bounds are the only clip effect on the draw, this is reported as kUnclipped and not as a degenerate rrect that matches the bounds.
Reimplemented from GrClip.
Definition at line 55 of file StencilClip.h.
|
inline |
Definition at line 36 of file StencilClip.h.
|
inline |
Definition at line 34 of file StencilClip.h.