History log of /frameworks/minikin/libs/minikin/CmapCoverage.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9196194d76e4325c5bb0c23f22a5787a717067ed 18-Mar-2017 Seigo Nonaka <nona@google.com> Compute SparseBitSet for cmap format 14 subtables.

By computing cmap format 14 subtables similar to cmap format 4 or 12,
there are following benefits:
- FontCollection::hasVariationSelector becomes 70x faster for the worst
case, 10x faster for the normal case.
- FontFamily::hasGlyph becomes lock-free.
- FontCollection::itemize becomes 2x faster than before for some cases.

On the other hand, following negative things happen:
- Initial FontFamily construction takes 2.5x longer than before, but this
only happens in Zygote and should not happen at application launch time.
- FontFamily construction from buffer takes longer time than before but
it is still around 800µs.
- Consumes additionally memory (about 30kB for NotoSansCJK-Regular.ttc
of ttc index 0, 2.5kB for NotoColorEmoji.ttf), but this is shared across
all applications. No additional memory is necessary if the font doesn't
support variation sequences.

Bug: 36401726
Test: minikin_tests passed
Test: minikin_stress_tests passed
Test: android.graphics.cts.PaintTest passed
Merged-In: I3ebc9ad5050fb9ab6283810d31ae8d13af168ec5
Change-Id: Ia84c4b56aed35a899223e33c1a4a15734de58c33
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
818fbee83a72ca86f64527eb90b2f15ec9b28504 14-Apr-2017 Seigo Nonaka <nona@google.com> Reduce heap memory in minikin.

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
db1b6cb7765091453d9b4dc7f6c2fb4d7123ab11 25-Mar-2017 Seigo Nonaka <nona@google.com> Support cmap tables with platform ID == 0

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
32c12c0ac825453f4c3bba07718cfe684ec90bec 28-Dec-2016 Mark Salyzyn <salyzyn@google.com> resolve merge conflicts of 2377a00 to master

Test: build
Bug: 26552300
Bug: 31289077
Change-Id: I6181ae7e84f9bdcbed50841c70d07f6906a10eb7
555d84c6f98eafcbe677cdcb8e9605760acd8ce5 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> minikin: Replace cutils/log.h with android/log.h or log/log.h

- replace cutils/log.h with android/log.h (main buffer logging)
- replace cutils/log.h with log.log.h (+SafetyNet logging)
- define LOG_TAG before use.

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I7a4803dd66f31b7103e09e5ff5b8fa523fa0fd60
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
14e2d136aaef271ba131f917cf5f27baa31ae5ad 09-Jun-2016 Seigo Nonaka <nona@google.com> Always use minikin namespace.

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
bcb024df56c8ae7a5914d6f060ac99a2b5d118d9 18-Feb-2016 Seigo Nonaka <nona@google.com> Merge "Improve Paint.measureText and Paint.hasGlyph for variation sequences." into nyc-dev
6b1c227da6492a435f0341d7fe95d9992669920e 02-Feb-2016 Seigo Nonaka <nona@google.com> Improve Paint.measureText and Paint.hasGlyph for variation sequences.

Before this patch, the font fallback chain iterated all installed font
families if a variation selector was specified.

This CL narrows down the range of iteration.
To decide the font family for the variation sequence, we need to search
for both the variation sequence and its base code point.
The new range of the iteration is a union of them.

With this change, the running time of Paint.hasGlyph for the variation
sequence improves 50% and the running time of Paint.measureText for the
variation sequence improves 40% for the large text case on Nexus 6
userdebug.

Bug: 26784699
Bug: 11750374

Change-Id: Iced1349e3ca750821d8882c551551f65bb569794
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
734f037130e14b3d44bc74026d3d065c025a8280 11-Feb-2016 Raph Levien <raph@google.com> Add error logging on invalid cmap

This patch logs instances of fonts with invalid cmap tables.

Bug: 25645298
Bug: 26413177
Change-Id: I183985e9784a97a2b4307a22e036382b1fc90e5e
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
3034e8b4ab627278b88faae2f4813562f31a7c2b 15-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap
am: ca8ac8acda

* commit 'ca8ac8acdad662230ae37998c6c4091bb39402b6':
Reject fonts with invalid ranges in cmap
ca8ac8acdad662230ae37998c6c4091bb39402b6 06-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap

A corrupt or malicious font may have a negative size in its cmap
range, which in turn could lead to memory corruption. This patch
detects the case and rejects the font, and also includes an assertion
in the sparse bit set implementation if we missed any such case.

External issue:
https://code.google.com/p/android/issues/detail?id=192618

Bug: 26413177
Change-Id: Icc0c80e4ef389abba0964495b89aa0fae3e9f4b2
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
73abbd59344770601991248cc56846cd199812b8 06-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap

A corrupt or malicious font may have a negative size in its cmap
range, which in turn could lead to memory corruption. This patch
detects the case and rejects the font, and also includes an assertion
in the sparse bit set implementation if we missed any such case.

External issue:
https://code.google.com/p/android/issues/detail?id=192618

Bug: 26413177
Change-Id: Icc0c80e4ef389abba0964495b89aa0fae3e9f4b2
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
998293f985dc6c23f90b160f3bc647807c76d3fe 08-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts
am: 6299a6ba13

* commit '6299a6ba13906c695f7a4f6748f7bc5856a110e5':
Avoid integer overflows in parsing fonts
6299a6ba13906c695f7a4f6748f7bc5856a110e5 01-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts

A malformed TTF can cause size calculations to overflow. This patch
checks the maximum reasonable value so that the total size fits in 32
bits. It also adds some explicit casting to avoid possible technical
undefined behavior when parsing sized unsigned values.

Bug: 25645298
Change-Id: Id4716132041a6f4f1fbb73ec4e445391cf7d9616
(cherry picked from commit 183c9ec2800baa2ce099ee260c6cbc6121cf1274)
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
183c9ec2800baa2ce099ee260c6cbc6121cf1274 01-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts

A malformed TTF can cause size calculations to overflow. This patch
checks the maximum reasonable value so that the total size fits in 32
bits. It also adds some explicit casting to avoid possible technical
undefined behavior when parsing sized unsigned values.

Bug: 25645298
Change-Id: Id4716132041a6f4f1fbb73ec4e445391cf7d9616
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
5f11abd31fa8cfa723f54bd1c98ce4e27e7d3c77 23-Oct-2014 Raph Levien <raph@google.com> Silently ignore invalid rangeOffset values

Some fonts contain a cmap segment for char 0xffff that contains an
invalid rangeOffset. This was rejected by the existing code, which
means the font is considered to have empty Unicode coverage. This patch
just discards the invalid segment (consistent with OpenType Sanitizer),
making the custom font display.

Bug: 18106256
Change-Id: Icc8616a3030f80e62db906332be64d434ae72ea2
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
9cc9bbe1461f359f0b27c5e7645c17dda001ab1d 24-Apr-2013 Raph Levien <raph@google.com> Initial commit of Minikin library

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp