| Flutter Impeller |

atlas_contents.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <optional>
6
7 #include "impeller/core/formats.h"
8 #include "impeller/entity/contents/atlas_contents.h"
9 #include "impeller/entity/contents/content_context.h"
10 #include "impeller/entity/contents/filters/blend_filter_contents.h"
11 #include "impeller/entity/contents/pipelines.h"
12 #include "impeller/entity/entity.h"
13 #include "impeller/entity/texture_fill.frag.h"
14 #include "impeller/entity/texture_fill.vert.h"
15 #include "impeller/geometry/color.h"
16 #include "impeller/renderer/render_pass.h"
17
18 namespace impeller {
19
20 DrawImageRectAtlasGeometry::DrawImageRectAtlasGeometry(
21 std::shared_ptr<Texture> texture,
22 const Rect& source,
23 const Rect& destination,
24 const Color& color,
25 BlendMode blend_mode,
26 const SamplerDescriptor& desc,
27 bool use_strict_src_rect)
28 : texture_(std::move(texture)),
29 source_(source),
30 destination_(destination),
31 color_(color),
32 blend_mode_(blend_mode),
33 desc_(desc),
34 use_strict_src_rect_(use_strict_src_rect) {}
35
36 DrawImageRectAtlasGeometry::~DrawImageRectAtlasGeometry() = default;
37
38 bool DrawImageRectAtlasGeometry::ShouldUseBlend() const {
39 return true;
40 }
41
42 bool DrawImageRectAtlasGeometry::ShouldSkip() const {
43 return false;
44 }
45
46 VertexBuffer DrawImageRectAtlasGeometry::CreateSimpleVertexBuffer(
47 HostBuffer& data_host_buffer) const {
48 using VS = TextureFillVertexShader;
49 constexpr size_t indices[6] = {0, 1, 2, 1, 2, 3};
50
51 BufferView buffer_view = data_host_buffer.Emplace(
52 sizeof(VS::PerVertexData) * 6, alignof(VS::PerVertexData),
53 [&](uint8_t* raw_data) {
54 VS::PerVertexData* data =
55 reinterpret_cast<VS::PerVertexData*>(raw_data);
56 int offset = 0;
57 std::array<TPoint<float>, 4> destination_points =
58 destination_.GetPoints();
59 std::array<TPoint<float>, 4> texture_coords =
60 Rect::MakeSize(texture_->GetSize()).Project(source_).GetPoints();
61 for (size_t j = 0; j < 6; j++) {
62 data[offset].position = destination_points[indices[j]];
63 data[offset].texture_coords = texture_coords[indices[j]];
64 offset++;
65 }
66 });
67
68 return VertexBuffer{
69 .vertex_buffer = buffer_view,
70 .index_buffer = {},
71 .vertex_count = 6,
72 .index_type = IndexType::kNone,
73 };
74 }
75
76 VertexBuffer DrawImageRectAtlasGeometry::CreateBlendVertexBuffer(
77 HostBuffer& data_host_buffer) const {
78 using VS = PorterDuffBlendVertexShader;
79 constexpr size_t indices[6] = {0, 1, 2, 1, 2, 3};
80
81 BufferView buffer_view = data_host_buffer.Emplace(
82 sizeof(VS::PerVertexData) * 6, alignof(VS::PerVertexData),
83 [&](uint8_t* raw_data) {
84 VS::PerVertexData* data =
85 reinterpret_cast<VS::PerVertexData*>(raw_data);
86 int offset = 0;
87 std::array<TPoint<float>, 4> texture_coords =
88 Rect::MakeSize(texture_->GetSize()).Project(source_).GetPoints();
89 std::array<TPoint<float>, 4> destination_points =
90 destination_.GetPoints();
91 for (size_t j = 0; j < 6; j++) {
92 data[offset].vertices = destination_points[indices[j]];
93 data[offset].texture_coords = texture_coords[indices[j]];
94 data[offset].color = color_.Premultiply();
95 offset++;
96 }
97 });
98
99 return VertexBuffer{
100 .vertex_buffer = buffer_view,
101 .index_buffer = {},
102 .vertex_count = 6,
103 .index_type = IndexType::kNone,
104 };
105 }
106
107 Rect DrawImageRectAtlasGeometry::ComputeBoundingBox() const {
108 return destination_;
109 }
110
111 const std::shared_ptr<Texture>& DrawImageRectAtlasGeometry::GetAtlas() const {
112 return texture_;
113 }
114
115 const SamplerDescriptor& DrawImageRectAtlasGeometry::GetSamplerDescriptor()
116 const {
117 return desc_;
118 }
119
120 BlendMode DrawImageRectAtlasGeometry::GetBlendMode() const {
121 return blend_mode_;
122 }
123
124 bool DrawImageRectAtlasGeometry::ShouldInvertBlendMode() const {
125 return false;
126 }
127
128 std::optional<Rect> DrawImageRectAtlasGeometry::GetStrictSrcRect() const {
129 if (use_strict_src_rect_) {
130 // For a strict source rect, shrink the texture coordinate range by half a
131 // texel to ensure that linear filtering does not sample anything outside
132 // the source rect bounds.
133 return Rect::MakeSize(texture_->GetSize()).Project(source_.Expand(-0.5));
134 }
135 return std::nullopt;
136 }
137
138 ////
139
140 AtlasContents::AtlasContents() = default;
141
142 AtlasContents::~AtlasContents() = default;
143
144 std::optional<Rect> AtlasContents::GetCoverage(const Entity& entity) const {
145 if (!geometry_) {
146 return std::nullopt;
147 }
148 return geometry_->ComputeBoundingBox().TransformBounds(entity.GetTransform());
149 }
150
151 void AtlasContents::SetGeometry(AtlasGeometry* geometry) {
152 geometry_ = geometry;
153 }
154
155 void AtlasContents::SetAlpha(Scalar alpha) {
156 alpha_ = alpha;
157 }
158
159 bool AtlasContents::Render(const ContentContext& renderer,
160 const Entity& entity,
161 RenderPass& pass) const {
162 if (geometry_->ShouldSkip() || alpha_ <= 0.0) {
163 return true;
164 }
165
166 const SamplerDescriptor& dst_sampler_descriptor =
167 geometry_->GetSamplerDescriptor();
168 raw_ptr<const Sampler> dst_sampler =
169 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
170 dst_sampler_descriptor);
171
172 auto& data_host_buffer = renderer.GetTransientsDataBuffer();
173 if (!geometry_->ShouldUseBlend()) {
174 using VS = TextureFillVertexShader;
175 using FS = TextureFillFragmentShader;
176
177 raw_ptr<const Sampler> dst_sampler =
178 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
179 dst_sampler_descriptor);
180
181 auto pipeline_options = OptionsFromPassAndEntity(pass, entity);
182 pipeline_options.primitive_type = PrimitiveType::kTriangle;
183 pipeline_options.depth_write_enabled =
184 pipeline_options.blend_mode == BlendMode::kSrc;
185
186 pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options));
187 pass.SetVertexBuffer(geometry_->CreateSimpleVertexBuffer(data_host_buffer));
188 #ifdef IMPELLER_DEBUG
189 pass.SetCommandLabel("DrawAtlas");
190 #endif // IMPELLER_DEBUG
191
192 VS::FrameInfo frame_info;
193 frame_info.mvp = entity.GetShaderTransform(pass);
194 frame_info.texture_sampler_y_coord_scale =
195 geometry_->GetAtlas()->GetYCoordScale();
196
197 VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
198
199 FS::FragInfo frag_info;
200 frag_info.alpha = alpha_;
201 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform((frag_info)));
202 FS::BindTextureSampler(pass, geometry_->GetAtlas(), dst_sampler);
203 return pass.Draw().ok();
204 }
205
206 BlendMode blend_mode = geometry_->GetBlendMode();
207
208 if (blend_mode <= BlendMode::kModulate) {
209 using VS = PorterDuffBlendPipeline::VertexShader;
210 using FS = PorterDuffBlendPipeline::FragmentShader;
211
212 #ifdef IMPELLER_DEBUG
213 pass.SetCommandLabel("DrawAtlas Blend");
214 #endif // IMPELLER_DEBUG
215 pass.SetVertexBuffer(geometry_->CreateBlendVertexBuffer(data_host_buffer));
216 BlendMode inverted_blend_mode =
217 geometry_->ShouldInvertBlendMode()
218 ? (InvertPorterDuffBlend(blend_mode).value_or(BlendMode::kSrc))
219 : blend_mode;
220 pass.SetPipeline(renderer.GetPorterDuffPipeline(
221 inverted_blend_mode, OptionsFromPassAndEntity(pass, entity)));
222
223 FS::FragInfo frag_info;
224 VS::FrameInfo frame_info;
225
226 FS::BindTextureSamplerDst(pass, geometry_->GetAtlas(), dst_sampler);
227 frame_info.texture_sampler_y_coord_scale =
228 geometry_->GetAtlas()->GetYCoordScale();
229
230 frag_info.input_alpha_output_alpha_tmx_tmy =
231 Vector4(1.0, alpha_, static_cast<int>(Entity::TileMode::kDecal),
232 static_cast<int>(Entity::TileMode::kDecal));
233 if (auto rect = geometry_->GetStrictSrcRect(); rect.has_value()) {
234 Rect src_rect = rect.value();
235 frag_info.source_rect =
236 Vector4(src_rect.GetX(), src_rect.GetY(), src_rect.GetRight(),
237 src_rect.GetBottom());
238 frag_info.use_strict_source_rect = 1.0;
239 } else {
240 frag_info.use_strict_source_rect = 0.0;
241 }
242
243 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
244
245 frame_info.mvp = entity.GetShaderTransform(pass);
246
247 auto uniform_view = data_host_buffer.EmplaceUniform(frame_info);
248 VS::BindFrameInfo(pass, uniform_view);
249
250 return pass.Draw().ok();
251 }
252
253 using VUS = VerticesUber1Shader::VertexShader;
254 using FS = VerticesUber1Shader::FragmentShader;
255
256 #ifdef IMPELLER_DEBUG
257 pass.SetCommandLabel("DrawAtlas Advanced Blend");
258 #endif // IMPELLER_DEBUG
259 pass.SetVertexBuffer(geometry_->CreateBlendVertexBuffer(data_host_buffer));
260
261 pass.SetPipeline(renderer.GetDrawVerticesUberPipeline(
262 blend_mode, OptionsFromPassAndEntity(pass, entity)));
263 FS::BindTextureSampler(pass, geometry_->GetAtlas(), dst_sampler);
264
265 VUS::FrameInfo frame_info;
266 FS::FragInfo frag_info;
267
268 frame_info.texture_sampler_y_coord_scale =
269 geometry_->GetAtlas()->GetYCoordScale();
270 frame_info.mvp = entity.GetShaderTransform(pass);
271
272 frag_info.alpha = alpha_;
273 frag_info.blend_mode = static_cast<int>(blend_mode);
274
275 // These values are ignored on platforms that natively support decal.
276 frag_info.tmx = static_cast<int>(Entity::TileMode::kDecal);
277 frag_info.tmy = static_cast<int>(Entity::TileMode::kDecal);
278
279 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
280 VUS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
281
282 return pass.Draw().ok();
283 }
284
285 ///////////////
286
287 ColorFilterAtlasContents::ColorFilterAtlasContents() = default;
288
289 ColorFilterAtlasContents::~ColorFilterAtlasContents() = default;
290
291 std::optional<Rect> ColorFilterAtlasContents::GetCoverage(
292 const Entity& entity) const {
293 if (!geometry_) {
294 return std::nullopt;
295 }
296 return geometry_->ComputeBoundingBox().TransformBounds(entity.GetTransform());
297 }
298
299 void ColorFilterAtlasContents::SetGeometry(AtlasGeometry* geometry) {
300 geometry_ = geometry;
301 }
302
303 void ColorFilterAtlasContents::SetAlpha(Scalar alpha) {
304 alpha_ = alpha;
305 }
306
307 void ColorFilterAtlasContents::SetMatrix(ColorMatrix matrix) {
308 matrix_ = matrix;
309 }
310
311 bool ColorFilterAtlasContents::Render(const ContentContext& renderer,
312 const Entity& entity,
313 RenderPass& pass) const {
314 if (geometry_->ShouldSkip() || alpha_ <= 0.0) {
315 return true;
316 }
317
318 const SamplerDescriptor& dst_sampler_descriptor =
319 geometry_->GetSamplerDescriptor();
320
321 raw_ptr<const Sampler> dst_sampler =
322 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
323 dst_sampler_descriptor);
324
325 auto& data_host_buffer = renderer.GetTransientsDataBuffer();
326
327 using VS = ColorMatrixColorFilterPipeline::VertexShader;
328 using FS = ColorMatrixColorFilterPipeline::FragmentShader;
329
330 #ifdef IMPELLER_DEBUG
331 pass.SetCommandLabel("Atlas ColorFilter");
332 #endif // IMPELLER_DEBUG
333 pass.SetVertexBuffer(geometry_->CreateSimpleVertexBuffer(data_host_buffer));
334 pass.SetPipeline(
335 renderer.GetColorMatrixColorFilterPipeline(OptionsFromPass(pass)));
336
337 FS::FragInfo frag_info;
338 VS::FrameInfo frame_info;
339
340 FS::BindInputTexture(pass, geometry_->GetAtlas(), dst_sampler);
341 frame_info.texture_sampler_y_coord_scale =
342 geometry_->GetAtlas()->GetYCoordScale();
343
344 frag_info.input_alpha = 1;
345 frag_info.output_alpha = alpha_;
346 const float* matrix = matrix_.array;
347 frag_info.color_v = Vector4(matrix[4], matrix[9], matrix[14], matrix[19]);
348 frag_info.color_m = Matrix(matrix[0], matrix[5], matrix[10], matrix[15], //
349 matrix[1], matrix[6], matrix[11], matrix[16], //
350 matrix[2], matrix[7], matrix[12], matrix[17], //
351 matrix[3], matrix[8], matrix[13], matrix[18] //
352 );
353
354 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
355
356 frame_info.mvp = entity.GetShaderTransform(pass);
357
358 auto uniform_view = data_host_buffer.EmplaceUniform(frame_info);
359 VS::BindFrameInfo(pass, uniform_view);
360
361 return pass.Draw().ok();
362 }
363
364 } // namespace impeller
atlas_contents.h
blend_filter_contents.h
buffer_view
BufferView buffer_view
Definition: blit_command_gles.cc:154
impeller::AtlasContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: atlas_contents.cc:159
impeller::AtlasContents::SetGeometry
void SetGeometry(AtlasGeometry *geometry)
Definition: atlas_contents.cc:151
impeller::AtlasContents::GetCoverage
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.
Definition: atlas_contents.cc:144
impeller::AtlasContents::SetAlpha
void SetAlpha(Scalar alpha)
Definition: atlas_contents.cc:155
impeller::AtlasContents::~AtlasContents
~AtlasContents() override
impeller::AtlasContents::AtlasContents
AtlasContents()
impeller::AtlasGeometry
Definition: atlas_contents.h:21
impeller::AtlasGeometry::GetStrictSrcRect
virtual std::optional< Rect > GetStrictSrcRect() const
The source rect of the draw in texture coordinates if a strict source rect should be applied,...
Definition: atlas_contents.h:47
impeller::AtlasGeometry::CreateSimpleVertexBuffer
virtual VertexBuffer CreateSimpleVertexBuffer(HostBuffer &host_buffer) const =0
impeller::AtlasGeometry::ComputeBoundingBox
virtual Rect ComputeBoundingBox() const =0
impeller::AtlasGeometry::ShouldInvertBlendMode
virtual bool ShouldInvertBlendMode() const
Definition: atlas_contents.h:41
impeller::AtlasGeometry::ShouldUseBlend
virtual bool ShouldUseBlend() const =0
impeller::AtlasGeometry::GetSamplerDescriptor
virtual const SamplerDescriptor & GetSamplerDescriptor() const =0
impeller::AtlasGeometry::ShouldSkip
virtual bool ShouldSkip() const =0
impeller::AtlasGeometry::CreateBlendVertexBuffer
virtual VertexBuffer CreateBlendVertexBuffer(HostBuffer &host_buffer) const =0
impeller::AtlasGeometry::GetBlendMode
virtual BlendMode GetBlendMode() const =0
impeller::AtlasGeometry::GetAtlas
virtual const std::shared_ptr< Texture > & GetAtlas() const =0
impeller::ColorFilterAtlasContents::GetCoverage
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.
Definition: atlas_contents.cc:291
impeller::ColorFilterAtlasContents::SetGeometry
void SetGeometry(AtlasGeometry *geometry)
Definition: atlas_contents.cc:299
impeller::ColorFilterAtlasContents::ColorFilterAtlasContents
ColorFilterAtlasContents()
impeller::ColorFilterAtlasContents::SetAlpha
void SetAlpha(Scalar alpha)
Definition: atlas_contents.cc:303
impeller::ColorFilterAtlasContents::~ColorFilterAtlasContents
~ColorFilterAtlasContents() override
impeller::ColorFilterAtlasContents::SetMatrix
void SetMatrix(ColorMatrix matrix)
Definition: atlas_contents.cc:307
impeller::ColorFilterAtlasContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: atlas_contents.cc:311
impeller::ContentContext
Definition: content_context.h:122
impeller::ContentContext::GetPorterDuffPipeline
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
Definition: content_context.cc:1200
impeller::ContentContext::GetTexturePipeline
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1141
impeller::ContentContext::GetTransientsDataBuffer
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
Definition: content_context.h:299
impeller::ContentContext::GetColorMatrixColorFilterPipeline
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1171
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:964
impeller::ContentContext::GetDrawVerticesUberPipeline
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
Definition: content_context.cc:1510
impeller::DrawImageRectAtlasGeometry::DrawImageRectAtlasGeometry
DrawImageRectAtlasGeometry(std::shared_ptr< Texture > texture, const Rect &source, const Rect &destination, const Color &color, BlendMode blend_mode, const SamplerDescriptor &desc, bool use_strict_src_rect=false)
Definition: atlas_contents.cc:20
impeller::DrawImageRectAtlasGeometry::ComputeBoundingBox
Rect ComputeBoundingBox() const override
Definition: atlas_contents.cc:107
impeller::DrawImageRectAtlasGeometry::GetSamplerDescriptor
const SamplerDescriptor & GetSamplerDescriptor() const override
Definition: atlas_contents.cc:115
impeller::DrawImageRectAtlasGeometry::ShouldUseBlend
bool ShouldUseBlend() const override
Definition: atlas_contents.cc:38
impeller::DrawImageRectAtlasGeometry::GetStrictSrcRect
std::optional< Rect > GetStrictSrcRect() const override
The source rect of the draw in texture coordinates if a strict source rect should be applied,...
Definition: atlas_contents.cc:128
impeller::DrawImageRectAtlasGeometry::GetBlendMode
BlendMode GetBlendMode() const override
Definition: atlas_contents.cc:120
impeller::DrawImageRectAtlasGeometry::ShouldInvertBlendMode
bool ShouldInvertBlendMode() const override
Definition: atlas_contents.cc:124
impeller::DrawImageRectAtlasGeometry::CreateBlendVertexBuffer
VertexBuffer CreateBlendVertexBuffer(HostBuffer &host_buffer) const override
Definition: atlas_contents.cc:76
impeller::DrawImageRectAtlasGeometry::CreateSimpleVertexBuffer
VertexBuffer CreateSimpleVertexBuffer(HostBuffer &host_buffer) const override
Definition: atlas_contents.cc:46
impeller::DrawImageRectAtlasGeometry::ShouldSkip
bool ShouldSkip() const override
Definition: atlas_contents.cc:42
impeller::DrawImageRectAtlasGeometry::~DrawImageRectAtlasGeometry
~DrawImageRectAtlasGeometry()
impeller::DrawImageRectAtlasGeometry::GetAtlas
const std::shared_ptr< Texture > & GetAtlas() const override
Definition: atlas_contents.cc:111
impeller::Entity
Definition: entity.h:26
impeller::Entity::TileMode::kDecal
@ kDecal
impeller::Entity::GetShaderTransform
Matrix GetShaderTransform(const RenderPass &pass) const
Definition: entity.cc:50
impeller::Entity::GetTransform
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:46
impeller::HostBuffer
Definition: host_buffer.h:26
impeller::HostBuffer::Emplace
BufferView Emplace(const BufferType &buffer, size_t alignment=0)
Emplace non-uniform data (like contiguous vertices) onto the host buffer.
Definition: host_buffer.h:92
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
impeller::RenderPass::SetVertexBuffer
virtual bool SetVertexBuffer(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
Definition: render_pass.cc:127
impeller::RenderPass::SetPipeline
virtual void SetPipeline(PipelineRef pipeline)
The pipeline to use for this command.
Definition: render_pass.cc:86
impeller::RenderPass::Draw
virtual fml::Status Draw()
Record the currently pending command.
Definition: render_pass.cc:208
impeller::RenderPass::SetCommandLabel
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
Definition: render_pass.cc:97
impeller::RenderPipelineHandle::VertexShader
VertexShader_ VertexShader
Definition: pipeline.h:168
impeller::RenderPipelineHandle::FragmentShader
FragmentShader_ FragmentShader
Definition: pipeline.h:169
impeller::raw_ptr
A wrapper around a raw ptr that adds additional unopt mode only checks.
Definition: raw_ptr.h:15
color.h
desc_
std::optional< PipelineDescriptor > desc_
Definition: content_context.cc:77
content_context.h
formats.h
entity.h
impeller
Definition: allocation.cc:12
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::FS
LinePipeline::FragmentShader FS
Definition: line_contents.cc:14
impeller::InvertPorterDuffBlend
std::optional< BlendMode > InvertPorterDuffBlend(BlendMode blend_mode)
Definition: blend_filter_contents.cc:51
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::BlendMode::kModulate
@ kModulate
impeller::BlendMode::kSrc
@ kSrc
impeller::VS
LinePipeline::VertexShader VS
Definition: line_contents.cc:13
impeller::OptionsFromPassAndEntity
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
Definition: contents.cc:34
impeller::OptionsFromPass
ContentContextOptions OptionsFromPass(const RenderPass &pass)
Definition: contents.cc:19
std
Definition: comparable.h:95
pipelines.h
render_pass.h
impeller::BufferView
Definition: buffer_view.h:19
impeller::Color
Definition: color.h:124
impeller::Color::Premultiply
constexpr Color Premultiply() const
Definition: color.h:212
impeller::ColorMatrix
Definition: color.h:117
impeller::ColorMatrix::array
Scalar array[20]
Definition: color.h:118
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
impeller::TRect< Scalar >
impeller::TRect::Expand
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.
Definition: rect.h:618
impeller::TRect::GetBottom
constexpr auto GetBottom() const
Definition: rect.h:357
impeller::TRect::GetY
constexpr Type GetY() const
Returns the Y coordinate of the upper left corner, equivalent to |GetOrigin().y|.
Definition: rect.h:337
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:472
impeller::TRect::Project
constexpr TRect< T > Project(TRect< T > source) const
Returns a new rectangle that represents the projection of the source rectangle onto this rectangle....
Definition: rect.h:669
impeller::TRect::GetPoints
constexpr std::array< TPoint< T >, 4 > GetPoints() const
Get the points that represent the 4 corners of this rectangle in a Z order that is compatible with tr...
Definition: rect.h:414
impeller::TRect::GetX
constexpr Type GetX() const
Returns the X coordinate of the upper left corner, equivalent to |GetOrigin().x|.
Definition: rect.h:333
impeller::TRect::GetRight
constexpr auto GetRight() const
Definition: rect.h:355
impeller::TRect< Scalar >::MakeSize
constexpr static TRect MakeSize(const TSize< U > &size)
Definition: rect.h:150
impeller::Vector4
Definition: vector.h:232
impeller::VertexBuffer
Definition: vertex_buffer.h:15
impeller::VertexBuffer::vertex_buffer
BufferView vertex_buffer
Definition: vertex_buffer.h:16
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:69