12 : runs_(
std::move(runs)), bounds_(bounds), has_color_(has_color) {}
34 if (runs_.size() > 1) {
37 auto glyph_positions = runs_[0].GetGlyphPositions();
38 if (glyph_positions.size() > 10) {
41 if (glyph_positions.size() == 1) {
47 auto first_position = glyph_positions[0];
48 auto overlapping_rect =
49 Rect(first_position.position + first_position.glyph.bounds.origin,
50 first_position.glyph.bounds.size);
51 for (
auto i = 1u; i < glyph_positions.size(); i++) {
52 auto glyph_position = glyph_positions[i];
54 Rect(glyph_position.position + glyph_position.glyph.bounds.origin,
55 glyph_position.glyph.bounds.size);
56 auto intersection = glyph_rect.Intersection(overlapping_rect);
57 if (intersection.has_value()) {
60 overlapping_rect = overlapping_rect.Union(glyph_rect);
67 return std::round(scale * 100) / 100;
73 const Font& font = run.GetFont();
76 auto& set = glyph_map[{font, rounded_scale}];
78 run.GetGlyphPositions()) {
81 if (rounded_scale != scale) {
82 auto delta = std::abs(rounded_scale - scale);
83 FML_LOG(ERROR) << glyph_position.glyph.bounds.size * delta;
86 set.insert(glyph_position.glyph);