| 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& host_buffer) const {
48 using VS = TextureFillVertexShader;
49 constexpr size_t indices[6] = {0, 1, 2, 1, 2, 3};
50
51 BufferView buffer_view = 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& host_buffer) const {
78 using VS = PorterDuffBlendVertexShader;
79 constexpr size_t indices[6] = {0, 1, 2, 1, 2, 3};
80
81 BufferView buffer_view = 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 return source_;
131 }
132 return std::nullopt;
133 }
134
135 ////
136
137 AtlasContents::AtlasContents() = default;
138
139 AtlasContents::~AtlasContents() = default;
140
141 std::optional<Rect> AtlasContents::GetCoverage(const Entity& entity) const {
142 if (!geometry_) {
143 return std::nullopt;
144 }
145 return geometry_->ComputeBoundingBox().TransformBounds(entity.GetTransform());
146 }
147
148 void AtlasContents::SetGeometry(AtlasGeometry* geometry) {
149 geometry_ = geometry;
150 }
151
152 void AtlasContents::SetAlpha(Scalar alpha) {
153 alpha_ = alpha;
154 }
155
156 bool AtlasContents::Render(const ContentContext& renderer,
157 const Entity& entity,
158 RenderPass& pass) const {
159 if (geometry_->ShouldSkip() || alpha_ <= 0.0) {
160 return true;
161 }
162
163 const SamplerDescriptor& dst_sampler_descriptor =
164 geometry_->GetSamplerDescriptor();
165 raw_ptr<const Sampler> dst_sampler =
166 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
167 dst_sampler_descriptor);
168
169 auto& host_buffer = renderer.GetTransientsBuffer();
170 if (!geometry_->ShouldUseBlend()) {
171 using VS = TextureFillVertexShader;
172 using FS = TextureFillFragmentShader;
173
174 raw_ptr<const Sampler> dst_sampler =
175 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
176 dst_sampler_descriptor);
177
178 auto pipeline_options = OptionsFromPassAndEntity(pass, entity);
179 pipeline_options.primitive_type = PrimitiveType::kTriangle;
180 pipeline_options.depth_write_enabled =
181 pipeline_options.blend_mode == BlendMode::kSrc;
182
183 pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options));
184 pass.SetVertexBuffer(geometry_->CreateSimpleVertexBuffer(host_buffer));
185 #ifdef IMPELLER_DEBUG
186 pass.SetCommandLabel("DrawAtlas");
187 #endif // IMPELLER_DEBUG
188
189 VS::FrameInfo frame_info;
190 frame_info.mvp = entity.GetShaderTransform(pass);
191 frame_info.texture_sampler_y_coord_scale =
192 geometry_->GetAtlas()->GetYCoordScale();
193
194 VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
195
196 FS::FragInfo frag_info;
197 frag_info.alpha = alpha_;
198 FS::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info)));
199 FS::BindTextureSampler(pass, geometry_->GetAtlas(), dst_sampler);
200 return pass.Draw().ok();
201 }
202
203 BlendMode blend_mode = geometry_->GetBlendMode();
204
205 if (blend_mode <= BlendMode::kModulate) {
206 using VS = PorterDuffBlendPipeline::VertexShader;
207 using FS = PorterDuffBlendPipeline::FragmentShader;
208
209 #ifdef IMPELLER_DEBUG
210 pass.SetCommandLabel("DrawAtlas Blend");
211 #endif // IMPELLER_DEBUG
212 pass.SetVertexBuffer(geometry_->CreateBlendVertexBuffer(host_buffer));
213 BlendMode inverted_blend_mode =
214 geometry_->ShouldInvertBlendMode()
215 ? (InvertPorterDuffBlend(blend_mode).value_or(BlendMode::kSrc))
216 : blend_mode;
217 pass.SetPipeline(renderer.GetPorterDuffPipeline(
218 inverted_blend_mode, OptionsFromPassAndEntity(pass, entity)));
219
220 FS::FragInfo frag_info;
221 VS::FrameInfo frame_info;
222
223 FS::BindTextureSamplerDst(pass, geometry_->GetAtlas(), dst_sampler);
224 frame_info.texture_sampler_y_coord_scale =
225 geometry_->GetAtlas()->GetYCoordScale();
226
227 frag_info.input_alpha_output_alpha_tmx_tmy =
228 Vector4(1.0, alpha_, static_cast<int>(Entity::TileMode::kDecal),
229 static_cast<int>(Entity::TileMode::kDecal));
230 if (auto rect = geometry_->GetStrictSrcRect(); rect.has_value()) {
231 Rect src_rect = rect.value();
232 frag_info.source_rect =
233 Vector4(src_rect.GetX(), src_rect.GetY(), src_rect.GetBottom(),
234 src_rect.GetRight());
235 frag_info.use_strict_source_rect = 1.0;
236 } else {
237 frag_info.use_strict_source_rect = 0.0;
238 }
239
240 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
241
242 frame_info.mvp = entity.GetShaderTransform(pass);
243
244 auto uniform_view = host_buffer.EmplaceUniform(frame_info);
245 VS::BindFrameInfo(pass, uniform_view);
246
247 return pass.Draw().ok();
248 }
249
250 using VUS = VerticesUber1Shader::VertexShader;
251 using FS = VerticesUber1Shader::FragmentShader;
252
253 #ifdef IMPELLER_DEBUG
254 pass.SetCommandLabel("DrawAtlas Advanced Blend");
255 #endif // IMPELLER_DEBUG
256 pass.SetVertexBuffer(geometry_->CreateBlendVertexBuffer(host_buffer));
257
258 pass.SetPipeline(renderer.GetDrawVerticesUberPipeline(
259 blend_mode, OptionsFromPassAndEntity(pass, entity)));
260 FS::BindTextureSampler(pass, geometry_->GetAtlas(), dst_sampler);
261
262 VUS::FrameInfo frame_info;
263 FS::FragInfo frag_info;
264
265 frame_info.texture_sampler_y_coord_scale =
266 geometry_->GetAtlas()->GetYCoordScale();
267 frame_info.mvp = entity.GetShaderTransform(pass);
268
269 frag_info.alpha = alpha_;
270 frag_info.blend_mode = static_cast<int>(blend_mode);
271
272 // These values are ignored on platforms that natively support decal.
273 frag_info.tmx = static_cast<int>(Entity::TileMode::kDecal);
274 frag_info.tmy = static_cast<int>(Entity::TileMode::kDecal);
275
276 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
277 VUS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
278
279 return pass.Draw().ok();
280 }
281
282 ///////////////
283
284 ColorFilterAtlasContents::ColorFilterAtlasContents() = default;
285
286 ColorFilterAtlasContents::~ColorFilterAtlasContents() = default;
287
288 std::optional<Rect> ColorFilterAtlasContents::GetCoverage(
289 const Entity& entity) const {
290 if (!geometry_) {
291 return std::nullopt;
292 }
293 return geometry_->ComputeBoundingBox().TransformBounds(entity.GetTransform());
294 }
295
296 void ColorFilterAtlasContents::SetGeometry(AtlasGeometry* geometry) {
297 geometry_ = geometry;
298 }
299
300 void ColorFilterAtlasContents::SetAlpha(Scalar alpha) {
301 alpha_ = alpha;
302 }
303
304 void ColorFilterAtlasContents::SetMatrix(ColorMatrix matrix) {
305 matrix_ = matrix;
306 }
307
308 bool ColorFilterAtlasContents::Render(const ContentContext& renderer,
309 const Entity& entity,
310 RenderPass& pass) const {
311 if (geometry_->ShouldSkip() || alpha_ <= 0.0) {
312 return true;
313 }
314
315 const SamplerDescriptor& dst_sampler_descriptor =
316 geometry_->GetSamplerDescriptor();
317
318 raw_ptr<const Sampler> dst_sampler =
319 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
320 dst_sampler_descriptor);
321
322 auto& host_buffer = renderer.GetTransientsBuffer();
323
324 using VS = ColorMatrixColorFilterPipeline::VertexShader;
325 using FS = ColorMatrixColorFilterPipeline::FragmentShader;
326
327 #ifdef IMPELLER_DEBUG
328 pass.SetCommandLabel("Atlas ColorFilter");
329 #endif // IMPELLER_DEBUG
330 pass.SetVertexBuffer(geometry_->CreateSimpleVertexBuffer(host_buffer));
331 pass.SetPipeline(
332 renderer.GetColorMatrixColorFilterPipeline(OptionsFromPass(pass)));
333
334 FS::FragInfo frag_info;
335 VS::FrameInfo frame_info;
336
337 FS::BindInputTexture(pass, geometry_->GetAtlas(), dst_sampler);
338 frame_info.texture_sampler_y_coord_scale =
339 geometry_->GetAtlas()->GetYCoordScale();
340
341 frag_info.input_alpha = 1;
342 frag_info.output_alpha = alpha_;
343 const float* matrix = matrix_.array;
344 frag_info.color_v = Vector4(matrix[4], matrix[9], matrix[14], matrix[19]);
345 frag_info.color_m = Matrix(matrix[0], matrix[5], matrix[10], matrix[15], //
346 matrix[1], matrix[6], matrix[11], matrix[16], //
347 matrix[2], matrix[7], matrix[12], matrix[17], //
348 matrix[3], matrix[8], matrix[13], matrix[18] //
349 );
350
351 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
352
353 frame_info.mvp = entity.GetShaderTransform(pass);
354
355 auto uniform_view = host_buffer.EmplaceUniform(frame_info);
356 VS::BindFrameInfo(pass, uniform_view);
357
358 return pass.Draw().ok();
359 }
360
361 } // 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:156
impeller::AtlasContents::SetGeometry
void SetGeometry(AtlasGeometry *geometry)
Definition: atlas_contents.cc:148
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:141
impeller::AtlasContents::SetAlpha
void SetAlpha(Scalar alpha)
Definition: atlas_contents.cc:152
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 if a strict source rect should be applied, or nullopt.
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:288
impeller::ColorFilterAtlasContents::SetGeometry
void SetGeometry(AtlasGeometry *geometry)
Definition: atlas_contents.cc:296
impeller::ColorFilterAtlasContents::ColorFilterAtlasContents
ColorFilterAtlasContents()
impeller::ColorFilterAtlasContents::SetAlpha
void SetAlpha(Scalar alpha)
Definition: atlas_contents.cc:300
impeller::ColorFilterAtlasContents::~ColorFilterAtlasContents
~ColorFilterAtlasContents() override
impeller::ColorFilterAtlasContents::SetMatrix
void SetMatrix(ColorMatrix matrix)
Definition: atlas_contents.cc:304
impeller::ColorFilterAtlasContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: atlas_contents.cc:308
impeller::ContentContext
Definition: content_context.h:138
impeller::ContentContext::GetTransientsBuffer
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
Definition: content_context.h:297
impeller::ContentContext::GetPorterDuffPipeline
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
Definition: content_context.cc:1167
impeller::ContentContext::GetTexturePipeline
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1108
impeller::ContentContext::GetColorMatrixColorFilterPipeline
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1138
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:939
impeller::ContentContext::GetDrawVerticesUberPipeline
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
Definition: content_context.cc:1467
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 if a strict source rect should be applied, or nullopt.
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:48
impeller::Entity::GetTransform
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:44
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:163
impeller::RenderPipelineHandle::FragmentShader
FragmentShader_ FragmentShader
Definition: pipeline.h:164
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:75
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::GetBottom
constexpr auto GetBottom() const
Definition: rect.h:361
impeller::TRect::GetY
constexpr Type GetY() const
Returns the Y coordinate of the upper left corner, equivalent to |GetOrigin().y|.
Definition: rect.h:341
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:476
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:673
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:418
impeller::TRect::GetX
constexpr Type GetX() const
Returns the X coordinate of the upper left corner, equivalent to |GetOrigin().x|.
Definition: rect.h:337
impeller::TRect::GetRight
constexpr auto GetRight() const
Definition: rect.h:359
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:68