This patch reduces about 73 kB memory.
The original SparseBitSet could contain full 32bit integers, but all of
that is not necessary for Unicode code points. By reducing the supported
range to up to Unicode maximum, U+10FFFF, we can save extra memory.
SparseBitSet holds 256-bit sliced pages and indices of them.
Previously, we needed to hold up to 2^24-1 pages for keeping 32-bit
integers.
This CL limits the number of pages to 2^16-1 (65535), so that
SparseBitSet only supports 24-bit integers now, but this is sufficient
for keeping all Unicode code points. With this change, we can change the
index integer type from uint32_t to uint16_t.
Bug: 37357593
Test: minikin_tests passes
Change-Id: I462cc27927752c942ac5da0bf303a5afb81b87a3
Some fonts don't have cmap subtables of Microsoft Platform ID (3) and
only have cmap subtables of Unicode Platform ID (0).
Bug: 32505843
Test: minikin_unittest passed
Test: android.graphics.cts.TypefaceTest passed
Change-Id: I24aa49860790c0ae8d8e578efd728b95ec0f93ae
To share the calculated coverage information across the processes, make
SparseBitSet serializable.
Bug: 34042446
Test: minikin_tests passes
Change-Id: I0463138adcf234739bb3ce1cdadf382021921f3e
Here is a new policy of the namespace of minikin.
- All components should be in minikin namespace.
- All tests are also in minikin namespace and no anonymous namespace.
Bug: 29233740
Change-Id: I71a8a35049bb8d624f7a78797231e90fed1e2b8c
This is the initial draft of Minikin, a library intended to perform text
layout functions. This version does basic weight selection and font runs
for scripts, and also has a simple renderer for drawing into bitmaps,
but is lacking measurement, line breaking, and a number of other
important features. It also lacks caching and other performance
refinements.
Change-Id: I789a2e47d11d71202dc84b4751b51a5e2cd9c451