Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
LazyProxyTest::Clip Class Reference
Inheritance diagram for LazyProxyTest::Clip:
GrClip

Public Member Functions

 Clip (LazyProxyTest *test, GrTextureProxy *atlas)
 
- Public Member Functions inherited from GrClip
virtual ~GrClip ()
 
virtual PreClipResult preApply (const SkRect &drawBounds, GrAA aa) const
 

Private Member Functions

SkIRect getConservativeBounds () const final
 
Effect apply (GrRecordingContext *rContext, skgpu::ganesh::SurfaceDrawContext *, GrDrawOp *, GrAAType, GrAppliedClip *out, SkRect *bounds) const override
 

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
 

Detailed Description

Definition at line 221 of file LazyProxyTest.cpp.

Constructor & Destructor Documentation

◆ Clip()

LazyProxyTest::Clip::Clip ( LazyProxyTest test,
GrTextureProxy atlas 
)
inline

Definition at line 223 of file LazyProxyTest.cpp.

224 : fTest(test)
225 , fAtlas(atlas) {}

Member Function Documentation

◆ apply()

Effect LazyProxyTest::Clip::apply ( GrRecordingContext ,
skgpu::ganesh::SurfaceDrawContext ,
GrDrawOp ,
GrAAType  ,
GrAppliedClip ,
SkRect bounds 
) const
inlineoverrideprivatevirtual

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 231 of file LazyProxyTest.cpp.

236 {
237 GrProxyProvider* proxyProvider = rContext->priv().proxyProvider();
238 out->addCoverageFP(std::make_unique<ClipFP>(rContext, proxyProvider, fTest, fAtlas));
239 return Effect::kClipped;
240 }

◆ getConservativeBounds()

SkIRect LazyProxyTest::Clip::getConservativeBounds ( ) const
inlinefinalprivatevirtual

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 228 of file LazyProxyTest.cpp.

228 {
229 return SkIRect::MakeSize(fAtlas->dimensions());
230 }
SkISize dimensions() const
static constexpr SkIRect MakeSize(const SkISize &size)
Definition SkRect.h:66

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