15 : runs_(
std::move(runs)), bounds_(bounds), has_color_(has_color) {}
45 constexpr
Scalar kMaximumTextScale = 48;
47 return std::clamp(result, 0.0f, kMaximumTextScale);
94 std::optional<GlyphProperties> properties) {
95 bound_values_.clear();
98 properties_ = properties;
110 std::optional<GlyphProperties> TextFrame::GetProperties()
const {
114 void TextFrame::AppendFrameBounds(
const FrameBounds& frame_bounds) {
115 bound_values_.push_back(frame_bounds);
118 void TextFrame::ClearFrameBounds() {
119 bound_values_.clear();
124 for (
const auto&
x : runs_) {
125 run_size +=
x.GetGlyphCount();
127 return bound_values_.size() == run_size;
131 FML_DCHECK(index < bound_values_.size());
132 return bound_values_[index];
136 return std::make_pair(generation_, atlas_id_);
139 void TextFrame::SetAtlasGeneration(
size_t value, intptr_t atlas_id) {
141 atlas_id_ = atlas_id;
Type
Describes how the glyphs are represented in the texture.
void SetPerFrameData(Scalar scale, Point offset, const Matrix &transform, std::optional< GlyphProperties > properties)
Store text frame scale, offset, and properties for hashing in th glyph atlas.
Rect GetBounds() const
The conservative bounding box for this text frame.
bool IsFrameComplete() const
Verifies that all glyphs in this text frame have computed bounds information.
GlyphAtlas::Type GetAtlasType() const
The type of atlas this run should be place in.
bool HasColor() const
Returns the paint color this text frame was recorded with.
const FrameBounds & GetFrameBounds(size_t index) const
Retrieve the frame bounds for the glyph at [index].
std::pair< size_t, intptr_t > GetAtlasGenerationAndID() const
static Point ComputeSubpixelPosition(const TextRun::GlyphPosition &glyph_position, AxisAlignment alignment, const Matrix &transform)
size_t GetRunCount() const
The number of runs in this text frame.
Matrix GetOffsetTransform() const
static Scalar RoundScaledFontSize(Scalar scale)
const std::vector< TextRun > & GetRuns() const
Returns a reference to all the text runs in this frame.
AxisAlignment
Determines the axis along which there is subpixel positioning.
static constexpr Scalar ComputeFractionalPosition(Scalar value)
A 4x4 matrix using column-major storage.
static constexpr Matrix MakeTranslation(const Vector3 &t)