Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::ganesh::SoftwarePathRenderer Class Referencefinal

#include <SoftwarePathRenderer.h>

Inheritance diagram for skgpu::ganesh::SoftwarePathRenderer:
skgpu::ganesh::PathRenderer SkRefCnt SkRefCntBase

Public Member Functions

const char * name () const override
 
 SoftwarePathRenderer (GrProxyProvider *proxyProvider, bool allowCaching)
 
- Public Member Functions inherited from skgpu::ganesh::PathRenderer
 PathRenderer ()=default
 
virtual const char * name () const =0
 
StencilSupport getStencilSupport (const GrStyledShape &shape) const
 
CanDrawPath canDrawPath (const CanDrawPathArgs &args) const
 
bool drawPath (const DrawPathArgs &args)
 
void stencilPath (const StencilPathArgs &args)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static bool GetShapeAndClipBounds (SurfaceDrawContext *, const GrClip *, const GrStyledShape &, const SkMatrix &viewMatrix, SkIRect *unclippedDevShapeBounds, SkIRect *clippedDevShapeBounds, SkIRect *devClipBounds)
 

Additional Inherited Members

- Public Types inherited from skgpu::ganesh::PathRenderer
enum  StencilSupport { kNoSupport_StencilSupport , kStencilOnly_StencilSupport , kNoRestriction_StencilSupport }
 
enum class  CanDrawPath { kNo , kAsBackup , kYes }
 
- Static Protected Member Functions inherited from skgpu::ganesh::PathRenderer
static void GetPathDevBounds (const SkPath &path, SkISize devSize, const SkMatrix &matrix, SkRect *bounds)
 

Detailed Description

This class uses the software side to render a path to an SkBitmap and then uploads the result to the gpu

Definition at line 22 of file SoftwarePathRenderer.h.

Constructor & Destructor Documentation

◆ SoftwarePathRenderer()

skgpu::ganesh::SoftwarePathRenderer::SoftwarePathRenderer ( GrProxyProvider proxyProvider,
bool  allowCaching 
)
inline

Definition at line 26 of file SoftwarePathRenderer.h.

27 : fProxyProvider(proxyProvider)
28 , fAllowCaching(allowCaching) {
29 }

Member Function Documentation

◆ GetShapeAndClipBounds()

bool skgpu::ganesh::SoftwarePathRenderer::GetShapeAndClipBounds ( SurfaceDrawContext sdc,
const GrClip clip,
const GrStyledShape shape,
const SkMatrix viewMatrix,
SkIRect unclippedDevShapeBounds,
SkIRect clippedDevShapeBounds,
SkIRect devClipBounds 
)
static

Definition at line 130 of file SoftwarePathRenderer.cpp.

136 {
137 // compute bounds as intersection of rt size, clip, and path
138 *devClipBounds = clip ? clip->getConservativeBounds()
139 : SkIRect::MakeWH(sdc->width(), sdc->height());
140
141 if (!get_unclipped_shape_dev_bounds(shape, matrix, unclippedDevShapeBounds)) {
142 *unclippedDevShapeBounds = SkIRect::MakeEmpty();
143 *clippedDevShapeBounds = SkIRect::MakeEmpty();
144 return false;
145 }
146 if (!clippedDevShapeBounds->intersect(*devClipBounds, *unclippedDevShapeBounds)) {
147 *clippedDevShapeBounds = SkIRect::MakeEmpty();
148 return false;
149 }
150 return true;
151}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
static bool get_unclipped_shape_dev_bounds(const GrStyledShape &shape, const SkMatrix &matrix, SkIRect *devBounds)
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
bool intersect(const SkIRect &r)
Definition: SkRect.h:513
static constexpr SkIRect MakeEmpty()
Definition: SkRect.h:45
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
Definition: SkRect.h:56

◆ name()

const char * skgpu::ganesh::SoftwarePathRenderer::name ( ) const
inlineoverridevirtual

Implements skgpu::ganesh::PathRenderer.

Definition at line 24 of file SoftwarePathRenderer.h.

24{ return "SW"; }

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