Flutter Engine
The Flutter Engine
|
#include <GrClip.h>
Public Member Functions | |
virtual Effect | apply (GrAppliedHardClip *out, SkIRect *bounds) const =0 |
Public Member Functions inherited from GrClip | |
virtual | ~GrClip () |
virtual SkIRect | getConservativeBounds () const =0 |
virtual PreClipResult | preApply (const SkRect &drawBounds, GrAA aa) const |
Private Member Functions | |
Effect | apply (GrRecordingContext *, skgpu::ganesh::SurfaceDrawContext *, GrDrawOp *, GrAAType aa, GrAppliedClip *out, SkRect *bounds) const final |
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 |
GrHardClip never uses coverage FPs. It can only enforce the clip using the already-existing stencil buffer contents and/or fixed-function state like scissor. Always aliased if MSAA is off.
|
pure virtual |
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.
Implemented in GrFixedClip, and skgpu::ganesh::StencilClip.
|
inlinefinalprivatevirtual |
This computes a GrAppliedClip from the clip which in turn can be used to build a GrPipeline. To determine the appropriate clipping implementation the GrClip subclass must know whether the draw will enable HW AA or uses the stencil buffer. On input 'bounds' is a conservative bounds of the draw that is to be clipped. If kClipped or kUnclipped is returned, the 'bounds' will have been updated to be contained within the clip bounds (or the device's, for wide-open clips). If kNoDraw is returned, 'bounds' and the applied clip are in an undetermined state and should be ignored (and the draw should be skipped).
Implements GrClip.
Definition at line 225 of file GrClip.h.