 |
Flutter Impeller
|
|
Go to the documentation of this file.
7 #include "fml/logging.h"
26 geometry_ = std::move(geometry);
39 const std::optional<Rect>& current_stencil_coverage)
const {
40 if (!current_stencil_coverage.has_value()) {
41 return {.
type = StencilCoverage::Type::kAppend, .coverage = std::nullopt};
47 return {.type = StencilCoverage::Type::kAppend,
48 .coverage = current_stencil_coverage};
51 return {.type = StencilCoverage::Type::kAppend,
52 .coverage = std::nullopt};
55 if (!coverage.has_value() || !current_stencil_coverage.has_value()) {
56 return {.type = StencilCoverage::Type::kAppend,
57 .coverage = std::nullopt};
60 .type = StencilCoverage::Type::kAppend,
61 .coverage = current_stencil_coverage->Intersection(coverage.value()),
69 const std::optional<Rect>& stencil_coverage)
const {
101 .
AddVertices({{points[0]}, {points[1]}, {points[2]}, {points[3]}})
126 auto geometry_result = geometry_->GetPositionBuffer(renderer, entity, pass);
127 options.primitive_type = geometry_result.type;
130 auto allocator = renderer.
GetContext()->GetResourceAllocator();
133 info.mvp = geometry_result.transform;
149 std::optional<Rect> restore_coverage) {
150 restore_coverage_ = restore_coverage;
154 const Entity& entity)
const {
160 const std::optional<Rect>& current_stencil_coverage)
const {
161 return {.
type = StencilCoverage::Type::kRestore, .coverage = std::nullopt};
166 const std::optional<Rect>& stencil_coverage)
const {
197 {
Point(ltrb[0], ltrb[1])},
198 {
Point(ltrb[2], ltrb[1])},
199 {
Point(ltrb[0], ltrb[3])},
200 {
Point(ltrb[2], ltrb[3])},
bool ShouldRender(const Entity &entity, const std::optional< Rect > &stencil_coverage) const override
StencilCoverage GetStencilCoverage(const Entity &entity, const std::optional< Rect > ¤t_stencil_coverage) const override
Given the current screen space bounding rectangle of the stencil, return the expected stencil coverag...
ContentContextOptions OptionsFromPass(const RenderPass &pass)
An object used to specify work to the GPU along with references to resources the GPU will used when d...
#define DEBUG_COMMAND_INFO(obj, arg)
uint32_t GetStencilDepth() const
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
bool CanInheritOpacity(const Entity &entity) const override
Whether or not this contents can accept the opacity peephole optimization.
std::shared_ptr< Pipeline< PipelineDescriptor > > GetClipPipeline(ContentContextOptions opts) const
void SetGeometry(std::unique_ptr< Geometry > geometry)
void SetClipOperation(Entity::ClipOperation clip_op)
void SetRestoreCoverage(std::optional< Rect > coverage)
The area on the pass texture where this clip restore will be applied. If unset, the entire pass textu...
VertexBufferBuilder & AddVertices(std::initializer_list< VertexType_ > vertices)
constexpr std::array< TPoint< T >, 4 > GetPoints() const
Get the points that represent the 4 corners of this rectangle. The order is: Top left,...
const Matrix & GetTransformation() const
ISize GetRenderTargetSize() const
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
@ kSetToReferenceValue
Reset the stencil value to the reference value.
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
std::shared_ptr< Context > GetContext() const
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
StencilCoverage GetStencilCoverage(const Entity &entity, const std::optional< Rect > ¤t_stencil_coverage) const override
Given the current screen space bounding rectangle of the stencil, return the expected stencil coverag...
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
VertexBuffer CreateVertexBuffer(HostBuffer &host_buffer) const
@ kLess
Comparison test passes if new_value < current_value.
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t stencil_reference
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
bool ShouldRender(const Entity &entity, const std::optional< Rect > &stencil_coverage) const override
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
bool CanInheritOpacity(const Entity &entity) const override
Whether or not this contents can accept the opacity peephole optimization.
static constexpr Matrix MakeOrthographic(TSize< T > size)
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
@ kEqual
Comparison test passes if new_value == current_value.
bool BindVertices(const VertexBuffer &buffer)
Specify the vertex and index buffer to use for this command.
std::shared_ptr< Pipeline< PipelineDescriptor > > pipeline
VertexShader_ VertexShader
bool AddCommand(Command &&command)
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into th...
HostBuffer & GetTransientsBuffer()