| Flutter Impeller |

text_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 "impeller/entity/contents/text_contents.h"
6
7 #include <cstring>
8 #include <optional>
9 #include <utility>
10
11 #include "impeller/core/buffer_view.h"
12 #include "impeller/core/formats.h"
13 #include "impeller/core/sampler_descriptor.h"
14 #include "impeller/entity/entity.h"
15 #include "impeller/geometry/color.h"
16 #include "impeller/geometry/point.h"
17 #include "impeller/renderer/render_pass.h"
18 #include "impeller/typographer/glyph_atlas.h"
19
20 namespace impeller {
21 Point SizeToPoint(Size size) {
22 return Point(size.width, size.height);
23 }
24
25 using VS = GlyphAtlasPipeline::VertexShader;
26 using FS = GlyphAtlasPipeline::FragmentShader;
27
28 TextContents::TextContents() = default;
29
30 TextContents::~TextContents() = default;
31
32 void TextContents::SetTextFrame(const std::shared_ptr<TextFrame>& frame) {
33 frame_ = frame;
34 }
35
36 void TextContents::SetColor(Color color) {
37 color_ = color;
38 }
39
40 Color TextContents::GetColor() const {
41 return color_.WithAlpha(color_.alpha * inherited_opacity_);
42 }
43
44 void TextContents::SetInheritedOpacity(Scalar opacity) {
45 inherited_opacity_ = opacity;
46 }
47
48 void TextContents::SetOffset(Vector2 offset) {
49 offset_ = offset;
50 }
51
52 void TextContents::SetForceTextColor(bool value) {
53 force_text_color_ = value;
54 }
55
56 std::optional<Rect> TextContents::GetCoverage(const Entity& entity) const {
57 return frame_->GetBounds().TransformBounds(entity.GetTransform());
58 }
59
60 void TextContents::SetTextProperties(Color color,
61 bool stroke,
62 Scalar stroke_width,
63 Cap stroke_cap,
64 Join stroke_join,
65 Scalar stroke_miter) {
66 if (frame_->HasColor()) {
67 // Alpha is always applied when rendering, remove it here so
68 // we do not double-apply the alpha.
69 properties_.color = color.WithAlpha(1.0);
70 }
71 if (stroke) {
72 properties_.stroke = true;
73 properties_.stroke_width = stroke_width;
74 properties_.stroke_cap = stroke_cap;
75 properties_.stroke_join = stroke_join;
76 properties_.stroke_miter = stroke_miter;
77 }
78 }
79
80 namespace {
81 Scalar AttractToOne(Scalar x) {
82 // Epsilon was decided by looking at the floating point inaccuracies in
83 // the ScaledK test.
84 const Scalar epsilon = 0.005f;
85 if (std::abs(x - 1.f) < epsilon) {
86 return 1.f;
87 }
88 if (std::abs(x + 1.f) < epsilon) {
89 return -1.f;
90 }
91 return x;
92 }
93
94 } // namespace
95
96 void TextContents::ComputeVertexData(
97 VS::PerVertexData* vtx_contents,
98 const std::shared_ptr<TextFrame>& frame,
99 Scalar scale,
100 const Matrix& entity_transform,
101 Vector2 offset,
102 std::optional<GlyphProperties> glyph_properties,
103 const std::shared_ptr<GlyphAtlas>& atlas) {
104 // Common vertex information for all glyphs.
105 // All glyphs are given the same vertex information in the form of a
106 // unit-sized quad. The size of the glyph is specified in per instance data
107 // and the vertex shader uses this to size the glyph correctly. The
108 // interpolated vertex information is also used in the fragment shader to
109 // sample from the glyph atlas.
110
111 constexpr std::array<Point, 4> unit_points = {Point{0, 0}, Point{1, 0},
112 Point{0, 1}, Point{1, 1}};
113
114 ISize atlas_size = atlas->GetTexture()->GetSize();
115 bool is_translation_scale = entity_transform.IsTranslationScaleOnly();
116 Matrix basis_transform = entity_transform.Basis();
117
118 VS::PerVertexData vtx;
119 size_t i = 0u;
120 size_t bounds_offset = 0u;
121 Rational rounded_scale = frame->GetScale();
122 Scalar inverted_rounded_scale = static_cast<Scalar>(rounded_scale.Invert());
123 Matrix unscaled_basis =
124 basis_transform *
125 Matrix::MakeScale({inverted_rounded_scale, inverted_rounded_scale, 1});
126
127 // In typical scales < 48x these values should be -1 or 1. We round to
128 // those to avoid inaccuracies.
129 unscaled_basis.m[0] = AttractToOne(unscaled_basis.m[0]);
130 unscaled_basis.m[5] = AttractToOne(unscaled_basis.m[5]);
131
132 for (const TextRun& run : frame->GetRuns()) {
133 const Font& font = run.GetFont();
134 const Matrix transform = frame->GetOffsetTransform();
135 FontGlyphAtlas* font_atlas = nullptr;
136
137 // Adjust glyph position based on the subpixel rounding
138 // used by the font.
139 Point subpixel_adjustment(0.5, 0.5);
140 switch (font.GetAxisAlignment()) {
141 case AxisAlignment::kNone:
142 break;
143 case AxisAlignment::kX:
144 subpixel_adjustment.x = 0.125;
145 break;
146 case AxisAlignment::kY:
147 subpixel_adjustment.y = 0.125;
148 break;
149 case AxisAlignment::kAll:
150 subpixel_adjustment.x = 0.125;
151 subpixel_adjustment.y = 0.125;
152 break;
153 }
154
155 Point screen_offset = (entity_transform * Point(0, 0));
156 for (const TextRun::GlyphPosition& glyph_position :
157 run.GetGlyphPositions()) {
158 const FrameBounds& frame_bounds = frame->GetFrameBounds(bounds_offset);
159 bounds_offset++;
160 auto atlas_glyph_bounds = frame_bounds.atlas_bounds;
161 auto glyph_bounds = frame_bounds.glyph_bounds;
162
163 // If frame_bounds.is_placeholder is true, this is the first frame
164 // the glyph has been rendered and so its atlas position was not
165 // known when the glyph was recorded. Perform a slow lookup into the
166 // glyph atlas hash table.
167 if (frame_bounds.is_placeholder) {
168 if (!font_atlas) {
169 font_atlas =
170 atlas->GetOrCreateFontGlyphAtlas(ScaledFont{font, rounded_scale});
171 }
172
173 if (!font_atlas) {
174 VALIDATION_LOG << "Could not find font in the atlas.";
175 continue;
176 }
177 SubpixelPosition subpixel = TextFrame::ComputeSubpixelPosition(
178 glyph_position, font.GetAxisAlignment(), transform);
179
180 std::optional<FrameBounds> maybe_atlas_glyph_bounds =
181 font_atlas->FindGlyphBounds(SubpixelGlyph{
182 glyph_position.glyph, //
183 subpixel, //
184 glyph_properties //
185 });
186 if (!maybe_atlas_glyph_bounds.has_value()) {
187 VALIDATION_LOG << "Could not find glyph position in the atlas.";
188 continue;
189 }
190 atlas_glyph_bounds = maybe_atlas_glyph_bounds.value().atlas_bounds;
191 }
192
193 Rect scaled_bounds = glyph_bounds.Scale(inverted_rounded_scale);
194 // For each glyph, we compute two rectangles. One for the vertex
195 // positions and one for the texture coordinates (UVs). The atlas
196 // glyph bounds are used to compute UVs in cases where the
197 // destination and source sizes may differ due to clamping the sizes
198 // of large glyphs.
199 Point uv_origin = atlas_glyph_bounds.GetLeftTop() / atlas_size;
200 Point uv_size = SizeToPoint(atlas_glyph_bounds.GetSize()) / atlas_size;
201
202 Point unrounded_glyph_position =
203 // This is for RTL text.
204 unscaled_basis * glyph_bounds.GetLeftTop() +
205 (basis_transform * glyph_position.position);
206
207 Point screen_glyph_position =
208 (screen_offset + unrounded_glyph_position + subpixel_adjustment)
209 .Floor();
210 for (const Point& point : unit_points) {
211 Point position;
212 if (is_translation_scale) {
213 position = (screen_glyph_position +
214 (unscaled_basis * point * glyph_bounds.GetSize()))
215 .Round();
216 } else {
217 position = entity_transform *
218 (glyph_position.position + scaled_bounds.GetLeftTop() +
219 point * scaled_bounds.GetSize());
220 }
221 vtx.uv = uv_origin + (uv_size * point);
222 vtx.position = position;
223 vtx_contents[i++] = vtx;
224 }
225 }
226 }
227 }
228
229 bool TextContents::Render(const ContentContext& renderer,
230 const Entity& entity,
231 RenderPass& pass) const {
232 Color color = GetColor();
233 if (color.IsTransparent()) {
234 return true;
235 }
236
237 GlyphAtlas::Type type = frame_->GetAtlasType();
238 const std::shared_ptr<GlyphAtlas>& atlas =
239 renderer.GetLazyGlyphAtlas()->CreateOrGetGlyphAtlas(
240 *renderer.GetContext(), renderer.GetTransientsBuffer(), type);
241
242 if (!atlas || !atlas->IsValid()) {
243 VALIDATION_LOG << "Cannot render glyphs without prepared atlas.";
244 return false;
245 }
246 if (!frame_->IsFrameComplete()) {
247 VALIDATION_LOG << "Failed to find font glyph bounds.";
248 return false;
249 }
250
251 // Information shared by all glyph draw calls.
252 pass.SetCommandLabel("TextFrame");
253 auto opts = OptionsFromPassAndEntity(pass, entity);
254 opts.primitive_type = PrimitiveType::kTriangle;
255 pass.SetPipeline(renderer.GetGlyphAtlasPipeline(opts));
256
257 // Common vertex uniforms for all glyphs.
258 VS::FrameInfo frame_info;
259 frame_info.mvp =
260 Entity::GetShaderTransform(entity.GetShaderClipDepth(), pass, Matrix());
261 bool is_translation_scale = entity.GetTransform().IsTranslationScaleOnly();
262 Matrix entity_transform = entity.GetTransform();
263
264 VS::BindFrameInfo(pass,
265 renderer.GetTransientsBuffer().EmplaceUniform(frame_info));
266
267 FS::FragInfo frag_info;
268 frag_info.use_text_color = force_text_color_ ? 1.0 : 0.0;
269 frag_info.text_color = ToVector(color.Premultiply());
270 frag_info.is_color_glyph = type == GlyphAtlas::Type::kColorBitmap;
271
272 FS::BindFragInfo(pass,
273 renderer.GetTransientsBuffer().EmplaceUniform(frag_info));
274
275 SamplerDescriptor sampler_desc;
276 if (is_translation_scale) {
277 sampler_desc.min_filter = MinMagFilter::kNearest;
278 sampler_desc.mag_filter = MinMagFilter::kNearest;
279 } else {
280 // Currently, we only propagate the scale of the transform to the atlas
281 // renderer, so if the transform has more than just a translation, we turn
282 // on linear sampling to prevent crunchiness caused by the pixel grid not
283 // being perfectly aligned.
284 // The downside is that this slightly over-blurs rotated/skewed text.
285 sampler_desc.min_filter = MinMagFilter::kLinear;
286 sampler_desc.mag_filter = MinMagFilter::kLinear;
287 }
288
289 // No mipmaps for glyph atlas (glyphs are generated at exact scales).
290 sampler_desc.mip_filter = MipFilter::kBase;
291
292 FS::BindGlyphAtlasSampler(
293 pass, // command
294 atlas->GetTexture(), // texture
295 renderer.GetContext()->GetSamplerLibrary()->GetSampler(
296 sampler_desc) // sampler
297 );
298
299 HostBuffer& host_buffer = renderer.GetTransientsBuffer();
300 size_t glyph_count = 0;
301 for (const auto& run : frame_->GetRuns()) {
302 glyph_count += run.GetGlyphPositions().size();
303 }
304 size_t vertex_count = glyph_count * 4;
305 size_t index_count = glyph_count * 6;
306
307 BufferView buffer_view = host_buffer.Emplace(
308 vertex_count * sizeof(VS::PerVertexData), alignof(VS::PerVertexData),
309 [&](uint8_t* data) {
310 VS::PerVertexData* vtx_contents =
311 reinterpret_cast<VS::PerVertexData*>(data);
312 ComputeVertexData(/*vtx_contents=*/vtx_contents,
313 /*frame=*/frame_,
314 /*scale=*/scale_,
315 /*entity_transform=*/entity_transform,
316 /*offset=*/offset_,
317 /*glyph_properties=*/GetGlyphProperties(),
318 /*atlas=*/atlas);
319 });
320 BufferView index_buffer_view = host_buffer.Emplace(
321 index_count * sizeof(uint16_t), alignof(uint16_t), [&](uint8_t* data) {
322 uint16_t* indices = reinterpret_cast<uint16_t*>(data);
323 size_t j = 0;
324 for (auto i = 0u; i < glyph_count; i++) {
325 size_t base = i * 4;
326 indices[j++] = base + 0;
327 indices[j++] = base + 1;
328 indices[j++] = base + 2;
329 indices[j++] = base + 1;
330 indices[j++] = base + 2;
331 indices[j++] = base + 3;
332 }
333 });
334
335 pass.SetVertexBuffer(std::move(buffer_view));
336 pass.SetIndexBuffer(index_buffer_view, IndexType::k16bit);
337 pass.SetElementCount(index_count);
338
339 return pass.Draw().ok();
340 }
341
342 std::optional<GlyphProperties> TextContents::GetGlyphProperties() const {
343 return (properties_.stroke || frame_->HasColor())
344 ? std::optional<GlyphProperties>(properties_)
345 : std::nullopt;
346 }
347
348 } // namespace impeller
type
GLenum type
Definition: blit_command_gles.cc:151
buffer_view
BufferView buffer_view
Definition: blit_command_gles.cc:152
buffer_view.h
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:296
impeller::ContentContext::GetLazyGlyphAtlas
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
Definition: content_context.h:264
impeller::ContentContext::GetGlyphAtlasPipeline
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1119
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:913
impeller::Entity
Definition: entity.h:20
impeller::Entity::GetShaderTransform
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
Definition: entity.cc:48
impeller::Entity::GetTransform
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:44
impeller::Entity::GetShaderClipDepth
float GetShaderClipDepth() const
Definition: entity.cc:88
impeller::FontGlyphAtlas
An object that can look up glyph locations within the GlyphAtlas for a particular typeface.
Definition: glyph_atlas.h:269
impeller::FontGlyphAtlas::FindGlyphBounds
std::optional< FrameBounds > FindGlyphBounds(const SubpixelGlyph &glyph) const
Find the location of a glyph in the atlas.
Definition: glyph_atlas.cc:131
impeller::Font
Describes a typeface along with any modifications to its intrinsic properties.
Definition: font.h:35
impeller::Font::GetAxisAlignment
AxisAlignment GetAxisAlignment() const
Definition: font.cc:41
impeller::GlyphAtlas::Type
Type
Describes how the glyphs are represented in the texture.
Definition: glyph_atlas.h:74
impeller::GlyphAtlas::Type::kColorBitmap
@ kColorBitmap
impeller::HostBuffer
Definition: host_buffer.h:28
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:93
impeller::HostBuffer::EmplaceUniform
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
Definition: host_buffer.h:48
impeller::Rational
Definition: rational.h:13
impeller::Rational::Invert
Rational Invert() const
Definition: rational.cc:50
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::SetIndexBuffer
virtual bool SetIndexBuffer(BufferView index_buffer, IndexType index_type)
Specify an index buffer to use for this command. To unset the index buffer, pass IndexType::kNone to ...
Definition: render_pass.cc:164
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::SetElementCount
virtual void SetElementCount(size_t count)
Definition: render_pass.cc:119
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:119
impeller::RenderPipelineHandle::FragmentShader
FragmentShader_ FragmentShader
Definition: pipeline.h:120
impeller::TextContents::~TextContents
~TextContents()
impeller::TextContents::SetOffset
void SetOffset(Vector2 offset)
Definition: text_contents.cc:48
impeller::TextContents::SetTextProperties
void SetTextProperties(Color color, bool stroke, Scalar stroke_width, Cap stroke_cap, Join stroke_join, Scalar stroke_miter)
Must be set after text frame.
Definition: text_contents.cc:60
impeller::TextContents::SetInheritedOpacity
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
Definition: text_contents.cc:44
impeller::TextContents::SetForceTextColor
void SetForceTextColor(bool value)
Force the text color to apply to the rendered glyphs, even if those glyphs are bitmaps.
Definition: text_contents.cc:52
impeller::TextContents::Render
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Definition: text_contents.cc:229
impeller::TextContents::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: text_contents.cc:56
impeller::TextContents::SetTextFrame
void SetTextFrame(const std::shared_ptr< TextFrame > &frame)
Definition: text_contents.cc:32
impeller::TextContents::SetColor
void SetColor(Color color)
Definition: text_contents.cc:36
impeller::TextContents::TextContents
TextContents()
impeller::TextContents::ComputeVertexData
static void ComputeVertexData(GlyphAtlasPipeline::VertexShader::PerVertexData *vtx_contents, const std::shared_ptr< TextFrame > &frame, Scalar scale, const Matrix &entity_transform, Vector2 offset, std::optional< GlyphProperties > glyph_properties, const std::shared_ptr< GlyphAtlas > &atlas)
Definition: text_contents.cc:96
impeller::TextContents::GetColor
Color GetColor() const
Definition: text_contents.cc:40
impeller::TextFrame::ComputeSubpixelPosition
static SubpixelPosition ComputeSubpixelPosition(const TextRun::GlyphPosition &glyph_position, AxisAlignment alignment, const Matrix &transform)
Definition: text_frame.cc:94
impeller::TextRun
Represents a collection of positioned glyphs from a specific font.
Definition: text_run.h:20
color.h
formats.h
value
int32_t value
Definition: dl_golden_unittests.cc:459
x
int32_t x
Definition: dl_golden_unittests.cc:458
entity.h
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
glyph_atlas.h
impeller
Definition: allocation.cc:12
impeller::IndexType::k16bit
@ k16bit
impeller::Join
Join
Definition: path.h:26
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::Point
TPoint< Scalar > Point
Definition: point.h:327
impeller::Cap
Cap
Definition: path.h:20
impeller::FS
LinePipeline::FragmentShader FS
Definition: line_contents.cc:14
impeller::AxisAlignment::kX
@ kX
impeller::AxisAlignment::kAll
@ kAll
impeller::AxisAlignment::kNone
@ kNone
impeller::AxisAlignment::kY
@ kY
impeller::MipFilter::kBase
@ kBase
The texture is sampled as if it only had a single mipmap level.
impeller::SizeToPoint
Point SizeToPoint(Size size)
Definition: text_contents.cc:21
impeller::ToVector
constexpr Vector4 ToVector(Color color)
Definition: shader_types.h:190
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::SubpixelPosition
SubpixelPosition
Definition: font_glyph_pair.h:61
impeller::MinMagFilter::kLinear
@ kLinear
impeller::MinMagFilter::kNearest
@ kNearest
Select nearest to the sample point. Most widely supported.
std
Definition: comparable.h:95
point.h
render_pass.h
sampler_descriptor.h
vtx
SolidFillVertexShader::PerVertexData vtx
Definition: stroke_path_geometry.cc:323
stroke_width
const Scalar stroke_width
Definition: stroke_path_geometry.cc:315
scale
const Scalar scale
Definition: stroke_path_geometry.cc:319
offset
SeparatedVector2 offset
Definition: stroke_path_geometry.cc:322
impeller::BufferView
Definition: buffer_view.h:19
impeller::Color
Definition: color.h:124
impeller::Color::alpha
Scalar alpha
Definition: color.h:143
impeller::Color::IsTransparent
constexpr bool IsTransparent() const
Definition: color.h:892
impeller::Color::WithAlpha
constexpr Color WithAlpha(Scalar new_alpha) const
Definition: color.h:278
impeller::Color::Premultiply
constexpr Color Premultiply() const
Definition: color.h:212
impeller::FrameBounds
Definition: glyph_atlas.h:55
impeller::FrameBounds::atlas_bounds
Rect atlas_bounds
The bounds of the glyph within the glyph atlas.
Definition: glyph_atlas.h:57
impeller::FrameBounds::glyph_bounds
Rect glyph_bounds
The local glyph bounds.
Definition: glyph_atlas.h:59
impeller::FrameBounds::is_placeholder
bool is_placeholder
Definition: glyph_atlas.h:62
impeller::GlyphProperties::color
Color color
Definition: font_glyph_pair.h:18
impeller::GlyphProperties::stroke_cap
Cap stroke_cap
Definition: font_glyph_pair.h:20
impeller::GlyphProperties::stroke_width
Scalar stroke_width
Definition: font_glyph_pair.h:19
impeller::GlyphProperties::stroke_join
Join stroke_join
Definition: font_glyph_pair.h:21
impeller::GlyphProperties::stroke_miter
Scalar stroke_miter
Definition: font_glyph_pair.h:22
impeller::GlyphProperties::stroke
bool stroke
Definition: font_glyph_pair.h:23
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::Matrix::IsTranslationScaleOnly
constexpr bool IsTranslationScaleOnly() const
Returns true if the matrix has a scale-only basis and is non-projective. Note that an identity matrix...
Definition: matrix.h:440
impeller::Matrix::m
Scalar m[16]
Definition: matrix.h:39
impeller::Matrix::Basis
constexpr Matrix Basis() const
The Matrix without its w components (without translation).
Definition: matrix.h:239
impeller::Matrix::MakeScale
static constexpr Matrix MakeScale(const Vector3 &s)
Definition: matrix.h:104
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
impeller::SamplerDescriptor::mip_filter
MipFilter mip_filter
Definition: sampler_descriptor.h:17
impeller::SamplerDescriptor::mag_filter
MinMagFilter mag_filter
Definition: sampler_descriptor.h:16
impeller::SamplerDescriptor::min_filter
MinMagFilter min_filter
Definition: sampler_descriptor.h:15
impeller::ScaledFont
A font and a scale. Used as a key that represents a typeface within a glyph atlas.
Definition: font_glyph_pair.h:41
impeller::SubpixelGlyph
A glyph and its subpixel position.
Definition: font_glyph_pair.h:90
impeller::SubpixelGlyph::glyph
Glyph glyph
Definition: font_glyph_pair.h:91
impeller::TPoint< Scalar >
impeller::TPoint::Round
static constexpr TPoint Round(const TPoint< U > &other)
Definition: point.h:49
impeller::TPoint::y
Type y
Definition: point.h:31
impeller::TPoint::x
Type x
Definition: point.h:30
impeller::TRect< Scalar >
impeller::TRect::GetSize
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
Definition: rect.h:331
impeller::TRect::Scale
constexpr TRect Scale(Type scale) const
Definition: rect.h:206
impeller::TRect::GetLeftTop
constexpr TPoint< T > GetLeftTop() const
Definition: rect.h:363
impeller::TSize< Scalar >
impeller::TSize::height
Type height
Definition: size.h:29
impeller::TSize::width
Type width
Definition: size.h:28
impeller::TextRun::GlyphPosition
Definition: text_run.h:22
text_contents.h
data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:67
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91