Flutter Engine
The Flutter Engine
|
#include <DrawList.h>
Classes | |
struct | Draw |
Public Member Functions | |
void | recordDraw (const Renderer *renderer, const Transform &localToDevice, const Geometry &geometry, const Clip &clip, DrawOrder ordering, const PaintParams *paint, const StrokeStyle *stroke) |
int | renderStepCount () const |
const Rect & | dstCopyBounds () const |
const Transform & | deduplicateTransform (const Transform &) |
Public Attributes | |
SkTBlockList< Transform, 16 > | fTransforms {SkBlockAllocator::GrowthPolicy::kFibonacci} |
SkTBlockList< Draw, 16 > | fDraws {SkBlockAllocator::GrowthPolicy::kFibonacci} |
int | fRenderStepCount = 0 |
Rect | fDstCopyBounds = Rect::InfiniteInverted() |
Static Public Attributes | |
static constexpr int | kMaxRenderSteps = 4096 |
A DrawList represents a collection of drawing commands (and related clip/shading state) in a form that closely mirrors what can be rendered efficiently and directly by the GPU backend (while balancing how much pre-processing to do for draws that might get eliminated later due to occlusion culling).
A draw command combines:
Commands are accumulated in an arbitrary order and then sorted by increasing sort z when the list is prepared into an actual command buffer. The result of a draw command is the rasterization of the transformed shape, restricted by its primitive clip (e.g. a scissor rect) and a depth test of "GREATER" vs. its write/test z. (A test of GREATER, as opposed to GEQUAL, avoids double hits for draws that may have overlapping geometry, e.g. stroking.) If the command has a shading description, the color buffer will be modified; if not, it will be a depth-only draw.
In addition to sorting the collected commands, the command list can be optimized during preparation. Commands that are fully occluded by later operations can be skipped entirely without affecting the final results. Adjacent commands (post sort) that would use equivalent GPU pipelines are merged to produce fewer (but larger) operations on the GPU.
Other than flush-time optimizations (sort, cull, and merge), the command list does what you tell it to. Draw-specific simplification, style application, and advanced clipping should be handled at a higher layer.
Definition at line 57 of file DrawList.h.
const Transform & skgpu::graphite::DrawList::deduplicateTransform | ( | const Transform & | localToDevice | ) |
Definition at line 16 of file DrawList.cpp.
|
inline |
Definition at line 87 of file DrawList.h.
void skgpu::graphite::DrawList::recordDraw | ( | const Renderer * | renderer, |
const Transform & | localToDevice, | ||
const Geometry & | geometry, | ||
const Clip & | clip, | ||
DrawOrder | ordering, | ||
const PaintParams * | paint, | ||
const StrokeStyle * | stroke | ||
) |
Definition at line 25 of file DrawList.cpp.
|
inline |
Definition at line 84 of file DrawList.h.
SkTBlockList<Draw, 16> skgpu::graphite::DrawList::fDraws {SkBlockAllocator::GrowthPolicy::kFibonacci} |
Definition at line 111 of file DrawList.h.
Rect skgpu::graphite::DrawList::fDstCopyBounds = Rect::InfiniteInverted() |
Definition at line 121 of file DrawList.h.
int skgpu::graphite::DrawList::fRenderStepCount = 0 |
Definition at line 114 of file DrawList.h.
SkTBlockList<Transform, 16> skgpu::graphite::DrawList::fTransforms {SkBlockAllocator::GrowthPolicy::kFibonacci} |
Definition at line 110 of file DrawList.h.
|
staticconstexpr |
Definition at line 68 of file DrawList.h.