 |
Flutter Impeller
|
|
Go to the documentation of this file.
7 #include "fml/logging.h"
39 const std::optional<Rect>& current_clip_coverage)
const {
40 if (!current_clip_coverage.has_value()) {
41 return {.
type = ClipCoverage::Type::kAppend, .coverage = std::nullopt};
47 return {.type = ClipCoverage::Type::kAppend,
48 .coverage = current_clip_coverage};
51 return {.type = ClipCoverage::Type::kAppend, .coverage = std::nullopt};
53 auto coverage = geometry_->GetCoverage(entity.
GetTransform());
54 if (!coverage.has_value() || !current_clip_coverage.has_value()) {
55 return {.type = ClipCoverage::Type::kAppend, .coverage = std::nullopt};
58 .type = ClipCoverage::Type::kAppend,
59 .coverage = current_clip_coverage->Intersection(coverage.value()),
66 const std::optional<Rect> clip_coverage)
const {
98 .
AddVertices({{points[0]}, {points[1]}, {points[2]}, {points[3]}})
123 auto geometry_result = geometry_->GetPositionBuffer(renderer, entity, pass);
124 options.primitive_type = geometry_result.type;
127 auto allocator = renderer.
GetContext()->GetResourceAllocator();
128 cmd.
BindVertices(std::move(geometry_result.vertex_buffer));
130 info.mvp = geometry_result.transform;
146 std::optional<Rect> restore_coverage) {
147 restore_coverage_ = restore_coverage;
151 const Entity& entity)
const {
157 const std::optional<Rect>& current_clip_coverage)
const {
163 const std::optional<Rect> clip_coverage)
const {
195 {
Point(ltrb[0], ltrb[1])},
196 {
Point(ltrb[2], ltrb[1])},
197 {
Point(ltrb[0], ltrb[3])},
198 {
Point(ltrb[2], ltrb[3])},
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)
@ kDecrementClamp
Decrement the current stencil value by 1. Clamp it to zero.
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
bool CanInheritOpacity(const Entity &entity) const override
Whether or not this contents can accept the opacity peephole optimization.
@ kEqual
Comparison test passes if new_value == current_value.
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
std::shared_ptr< Pipeline< PipelineDescriptor > > GetClipPipeline(ContentContextOptions opts) const
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)
const Matrix & GetOrthographicTransform() const
@ kSetToReferenceValue
Reset the stencil value to the reference value.
bool ShouldRender(const Entity &entity, const std::optional< Rect > clip_coverage) const override
constexpr std::array< TPoint< T >, 4 > GetPoints() const
Get the points that represent the 4 corners of this rectangle. The order is: Top left,...
ClipCoverage GetClipCoverage(const Entity &entity, const std::optional< Rect > ¤t_clip_coverage) const override
Given the current pass space bounding rectangle of the clip buffer, return the expected clip coverage...
ISize GetRenderTargetSize() const
void SetGeometry(const std::shared_ptr< Geometry > &geometry)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
std::shared_ptr< Context > GetContext() const
bool BindVertices(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
VertexBuffer CreateVertexBuffer(HostBuffer &host_buffer) const
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t GetClipDepth() const
uint32_t stencil_reference
bool ShouldRender(const Entity &entity, const std::optional< Rect > clip_coverage) const override
constexpr static TRect MakeSize(const TSize< U > &size)
ClipCoverage GetClipCoverage(const Entity &entity, const std::optional< Rect > ¤t_clip_coverage) const override
Given the current pass space bounding rectangle of the clip buffer, return the expected clip coverage...
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.
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
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...
@ kLess
Comparison test passes if new_value < current_value.
HostBuffer & GetTransientsBuffer()