 |
Flutter Impeller
|
|
Go to the documentation of this file.
11 : context_(
std::move(context)),
12 sample_count_(target.GetSampleCount()),
13 pixel_format_(target.GetRenderTargetPixelFormat()),
14 has_stencil_attachment_(target.GetStencilAttachment().has_value()),
15 render_target_size_(target.GetRenderTargetSize()),
16 render_target_(target),
18 orthographic_(
Matrix::MakeOrthographic(render_target_size_)) {
19 auto strong_context =
context_.lock();
20 FML_DCHECK(strong_context);
25 auto strong_context =
context_.lock();
68 if (!command.IsValid()) {
69 VALIDATION_LOG <<
"Attempted to add an invalid command to the render pass.";
73 if (command.scissor.has_value()) {
75 if (!target_rect.Contains(command.scissor.value())) {
76 VALIDATION_LOG <<
"Cannot apply a scissor that lies outside the bounds "
77 "of the render target.";
82 if (command.vertex_buffer.vertex_count == 0u ||
83 command.instance_count == 0u) {
89 commands_.emplace_back(std::move(command));
An object used to specify work to the GPU along with references to resources the GPU will used when d...
const RenderTarget & GetRenderTarget() const
const Matrix & GetOrthographicTransform() const
RenderPass(std::weak_ptr< const Context > context, const RenderTarget &target)
const PixelFormat pixel_format_
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
bool EncodeCommands() const
Encode the recorded commands to the underlying command buffer.
ISize GetRenderTargetSize() const
std::string SPrintF(const char *format,...)
virtual bool OnEncodeCommands(const Context &context) const =0
SampleCount GetSampleCount() const
The sample count of the attached render target.
const RenderTarget render_target_
std::vector< Command > commands_
const ISize render_target_size_
ISize GetRenderTargetSize() const
void SetLabel(std::string label)
constexpr static TRect MakeSize(const TSize< U > &size)
bool HasStencilAttachment() const
Whether the render target has an stencil attachment.
virtual void OnSetLabel(std::string label)=0
const bool has_stencil_attachment_
const Matrix orthographic_
const std::weak_ptr< const Context > & GetContext() const
bool AddCommand(Command &&command)
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into th...
const std::weak_ptr< const Context > context_
A 4x4 matrix using column-major storage.
HostBuffer & GetTransientsBuffer()
std::shared_ptr< HostBuffer > transients_buffer_
PixelFormat GetRenderTargetPixelFormat() const
The pixel format of the attached render target.
const SampleCount sample_count_