From 1ed36dec9bd1edbcd09d485401376c7717fbaffd Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Wed, 26 Jul 2023 16:48:08 -0700 Subject: [PATCH 1/2] [Impeller] trimmed 3 bytes off of each Glyph --- impeller/typographer/glyph.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/impeller/typographer/glyph.h b/impeller/typographer/glyph.h index b036e415cc540..7c48c2acade66 100644 --- a/impeller/typographer/glyph.h +++ b/impeller/typographer/glyph.h @@ -17,7 +17,7 @@ namespace impeller { /// @brief The glyph index in the typeface. /// struct Glyph { - enum class Type { + enum class Type : uint8_t { kPath, kBitmap, }; @@ -39,6 +39,8 @@ struct Glyph { : index(p_index), type(p_type), bounds(p_bounds) {} }; +static_assert(sizeof(Glyph) == 20); + } // namespace impeller template <> From 74e97bbdbe219609b2e3a27e40fa7c68ee42fcab Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Thu, 27 Jul 2023 08:40:55 -0700 Subject: [PATCH 2/2] added comment --- impeller/typographer/glyph.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/impeller/typographer/glyph.h b/impeller/typographer/glyph.h index 7c48c2acade66..d3797568fdaa2 100644 --- a/impeller/typographer/glyph.h +++ b/impeller/typographer/glyph.h @@ -39,6 +39,8 @@ struct Glyph { : index(p_index), type(p_type), bounds(p_bounds) {} }; +// Many Glyph instances are instantiated, so care should be taken when +// increasing the size. static_assert(sizeof(Glyph) == 20); } // namespace impeller