Flutter Engine
The Flutter Engine
|
#include <ComputePathAtlas.h>
Public Member Functions | |
virtual bool | recordDispatches (Recorder *, ComputeTask::DispatchGroupList *) const =0 |
void | reset () |
Public Member Functions inherited from skgpu::graphite::PathAtlas | |
PathAtlas (Recorder *recorder, uint32_t requestedWidth, uint32_t requestedHeight) | |
virtual | ~PathAtlas () |
std::pair< const Renderer *, std::optional< MaskAndOrigin > > | addShape (const Rect &transformedShapeBounds, const Shape &shape, const Transform &localToDevice, const SkStrokeRec &style) |
virtual bool | isSuitableForAtlasing (const Rect &transformedShapeBounds, const Rect &clipBounds) const |
uint32_t | width () const |
uint32_t | height () const |
Static Public Member Functions | |
static std::unique_ptr< ComputePathAtlas > | CreateDefault (Recorder *) |
Protected Member Functions | |
ComputePathAtlas (Recorder *) | |
const TextureProxy * | texture () const |
const TextureProxy * | addRect (skvx::half2 maskSize, SkIPoint16 *outPos) |
bool | isSuitableForAtlasing (const Rect &transformedShapeBounds, const Rect &clipBounds) const override |
virtual void | onReset ()=0 |
Protected Member Functions inherited from skgpu::graphite::PathAtlas | |
virtual const TextureProxy * | onAddShape (const Shape &, const Transform &transform, const SkStrokeRec &, skvx::half2 maskSize, skvx::half2 *outPos)=0 |
Additional Inherited Members | |
Public Types inherited from skgpu::graphite::PathAtlas | |
using | MaskAndOrigin = std::pair< CoverageMaskShape, SkIPoint > |
Static Public Attributes inherited from skgpu::graphite::PathAtlas | |
static constexpr int | kEntryPadding = 1 |
Protected Attributes inherited from skgpu::graphite::PathAtlas | |
Recorder * | fRecorder |
uint32_t | fWidth = 0 |
uint32_t | fHeight = 0 |
Base class for PathAtlas implementations that rasterize coverage masks on the GPU using compute shaders.
When a new shape gets added, it gets tracked as input to a series of GPU compute passes. This data is recorded by recordDispatches()
into a DispatchGroup which can be added to a ComputeTask.
After a successful call to recordDispatches()
, the client is free to call reset()
and start adding new shapes for a future atlas render.
Definition at line 42 of file ComputePathAtlas.h.
|
explicitprotected |
Definition at line 44 of file ComputePathAtlas.cpp.
|
protected |
Definition at line 89 of file ComputePathAtlas.cpp.
|
static |
Definition at line 417 of file ComputePathAtlas.cpp.
|
overrideprotectedvirtual |
Returns true if a path coverage mask with the given device-space bounds is sufficiently small to benefit from atlasing without causing too many atlas renders.
transformedShapeBounds
represents the device-space bounds of the coverage mask shape unrestricted by clip and viewport bounds.
clipBounds
represents the conservative bounding box of the union of the clip stack that should apply to the shape.
Reimplemented from skgpu::graphite::PathAtlas.
Definition at line 61 of file ComputePathAtlas.cpp.
|
protectedpure virtual |
|
pure virtual |
void skgpu::graphite::ComputePathAtlas::reset | ( | ) |
Definition at line 111 of file ComputePathAtlas.cpp.
|
inlineprotected |
Definition at line 58 of file ComputePathAtlas.h.