History log of /frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
832815cb53e951485ff5a0e6c705446d0bfb5883 02-Oct-2012 Raph Levien <raph@google.com> Fix for bug 7234184 F/TextLayoutCache: Failed to put an entry...

This bug was triggered by user code concurrently mutating the character
array while calling into a drawText method in another thread. When the
value of the array changed, it caused inconsistent state, leading to
assert failures.

This is arguably bad behavior by the user code, but it shouldn't cause a
native crash. The fix is to do a defensive copy of the text into the
key, so the value is guaranteed to remain constant throughout the text
layout process. The change is mostly deletion of code, because there was
an optimization to try to avoid such a copy. That optimization was not
actually effective, however, because the indexOfKey() operation in the
KeyedVector underlying the TextLayoutCache did the copy anyway. Thus,
even though this change looks like it's introducing a copy where there
wasn't one before, the actual performance impact should be nil.

Note that the ability to handle a mutating argument is now part of the
contract for TextLayoutEngine::getValue(), and is now documented. That
contract may change, as the result of future optimization. Also, care
was taken to only use the value after the copy.

Other performance issues with TextLayoutCache are tracked in bug
7271109.

Change-Id: I9c90e8e4d501f3f37e2f22a7851f032808d46fbe
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
1b10241a8f0affab9f46719e46c6fedff9e69b8b 25-Sep-2012 Raph Levien <raph@google.com> Fix for bug 6936752 Tamil text gets truncated on right-hand side

The getTextRunAdvances() method wasn't accounting for the true width of
the text. On closer examination, in Tamil the clusters consist of a
number of glyphs each of which has a nonzero advance (in some other
scripts, the first glyph in the cluster has an advance, and others are
effectively zero). Previously, we were just using the advance of the
first glyph in the cluster. This patch changes the behavior to sum the
advances of all the glyphs within the cluster.

Change-Id: I77a51235f4bb0dfaa72cbb920a8c3b217ad25404
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
13ba4e478d19001ddb6828bd1fd8fbc1e0cb208f 13-Sep-2012 Raph Levien <raph@google.com> Fix for b7155617 race condition in TextLayoutCache.cpp

There was the possibility for a race between clearing the caches and
using fonts. This patch simply protects both under the same mLock held
by the TextLayoutCache object.

Change-Id: Ib366e16a9a9ba702a46bc078d1bc0602713991e5
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ac1cbaf2e5575ac75a0160e13089d51a0bb232fa 18-Jul-2012 Billy Hewlett <billyh@google.com> DO NOT MERGE Han Preference

Cherry-pick Ib5dd86950156c5a438f25c289acb839206bb455a from master.

Data: label MTLmr3m with "ja" locale attribute, fallback_fonts-ja.xml removed,
as we only need a single fallback font file
Code: Add locale and variant to TextLayoutCache. Paint.java sets textLocale as
the language (for example, "ja") rather than the language/locale concatenated
(for example "ja_JP")

This checkin, along with Change-Id: Id8c91ae0be6cad8a7ef77a0cd5803676290986c1,
allows text view objects to set their locale dynamically and skia will use the
correct font for the locale.

Change-Id: Ieb60b0d7a39fcfef4f8ce90cd4f6065d33673710
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
4f3c8f7026d89a5d79e2621eb6428d5b9b1a25f3 19-Jul-2012 Raph Levien <raph@google.com> Fix overly verbose logging in TextLayoutCache

I meant to log certain debug values only when DEBUG_GLYPHS was set, but
I used #ifdef instead of #if (when it's not set, it's 0, rather than
undefined).

Change-Id: Ic27fee7dd355009c1873f0a2e12614849bbceebd
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
2301d32f7e2ba584abc31ac177dde754385d3c04 18-Jul-2012 Raph Levien <raph@google.com> Software-only implementation of glyph positioning (bug 5443796)

This patch implements glyph positioning in the Skia-based renderer. Note
that it depends on a fix for bug 6833339 being in place (correct
calculation of advance widths under skew and scale transforms),
otherwise there will be regressions.

Careful attention was paid to correct results in a wide variety of
conditions: alignments, text decorations, scale, skew, etc. Many of
these are exercised in the test app attached to bug 6833339.

Note that this patch also changes slightly the way that the total
advance is calculated - the running is accumulated and passed through to
computeRunValues(), so that the x positions of each glyph can be set
according to the total advance of all glyphs (in all runs) appearing
before (plus, of course, the offset for mark positioning).

After committing this patch, text rendering will no longer match between
the software and hardware rendering cases. Implementing positioning in
the hardware renderer will resolve that, and fully implement bug 5443796.

Change-Id: Ie0f7835d48bc120475a19afbfe159aa5304fcaa8
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
d6deccb346e913d906f484d279b19e0f6ea18d94 22-Jun-2012 Billy Hewlett <billyh@google.com> Remove hardcoded typeface pointers

There were a number of extraneous typeface pointers, one per
language, in TextLayoutCache. Removing these makes adding additional
supported fonts easier. This checkin now properly
unrefs typefaces returned by SkCreateTypefaceForScript. Additionally,
all harfbuzz shaped fonts (with exceptions Greek, Cyrillic, Hangul)
should call SkCreateTypefaceForScript.

Change-Id: I7dcf603a89e5ff52c6dab8fb87ae1807a79c351c
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
f62034d89611fbd3e1d41413847241757acd0c10 26-Jun-2012 Raph Levien <raph@google.com> Initialize shaper offset array. Needed for bug 5443796.

Harfbuzz apparently requires the offset array to be initialized to zero,
otherwise it can report corrupt glyph positions. This change also
contains a small amount of refactoring to avoid code duplication.

Change-Id: I2553974f40bc8e0549876c7d31243960ca92a8a2
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
6212a4f2ed2a5921de08b527cd1b25e1d155e56b 25-Jun-2012 Raph Levien <raph@google.com> Fix broken build when DEBUG_GLYPHS is set

Some of the logging lines referred to the "path" variable which no
longer exists. We log the Harfbuzz script instead, which hopefully
provides enough context.

This change only affects debug builds, but we will want to be working
intensively in this space.

Change-Id: I86c3b58c9fa2a8c47812ef5f0b5ce64fd8dcdc20
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
960511848ade732f7dab838a1625729698c7c952 21-Jun-2012 Billy Hewlett <billyh@google.com> Revert "Revert "Use Elegant fonts for Webkit, Compact fonts for Textview""

This reverts commit 6fadccd2484233ed570218b3f97c085ef1a1ec28
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
6fadccd2484233ed570218b3f97c085ef1a1ec28 21-Jun-2012 Billy Hewlett <billyh@google.com> Revert "Use Elegant fonts for Webkit, Compact fonts for Textview"

This reverts commit ecf80965d05e44b3701b3392aeb02028daacf1b0
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ecf80965d05e44b3701b3392aeb02028daacf1b0 07-Jun-2012 Billy Hewlett <billyh@google.com> Use Elegant fonts for Webkit, Compact fonts for Textview

Fonts can be marked with elegant or compact in fallback_fonts.xml.
Webkit uses elegant fonts, Textview uses compact fonts (the default),
unmarked fonts are used by both.

Bug: 6649136

Change-Id: Ie0debcddc13350bf60fe3139cd7ae533e466f02b
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
29b9885c258b46b00a8caf72ea1a6835d4594981 07-Jun-2012 Victoria Lease <violets@google.com> Merge "Fix hardcoded font path. Allow adding new font path thru Skia changes. Bug: 6609231"
517f67fe4b70c5a1907cb503d62b906a1eed2e1e 05-Jun-2012 Billy Hewlett <billyh@google.com> Fix hardcoded font path. Allow adding new font path thru Skia changes.
Bug: 6609231

Change-Id: I7b28c6f7ac1c227c7059b486635cadb39a6eacc3
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
75394d6d1ba633f6bf0218f563b8876b824c6fcf 03-Jun-2012 Raph Levien <raph@google.com> Fix bug 6558006: SystemUI native heap is huge. Fix memory leak

TextLayoutCache was leaking HB_Face objects, not freeing them when
purging the mCachedHBFaces cache. More full analysis is in the bug.

Change-Id: Ie5cd8b00c36b9d31963183c601cde49cbb73fafb
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
15cc68ced062a0dbd174718abfb1c783ac1aa433 15-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6495019 Character gets garbled when locale is changed

- add missing cached data clearing. The Shaper was caching the HB_Face so
clear them too
- do minor code refactoring

Change-Id: Ifa86cc63815bdb4b51ce688cf16e986415b1e8c1
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
92d7f9ff1c0c8a179ee935d86d3c94022980ead2 08-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #6408393 Character corruption is caused when locale is changed" into jb-dev
30ca5cd11a23f06f2f8eeaa587685450826f800f 08-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6408393 Character corruption is caused when locale is changed

- free the TextLayoutCache on Locale change

- also free TextLayoutCache when memory is low

Change-Id: I39a37ac8ec3c292cfb1c0eea4bb41ff71897d089
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
6162876067cbaa93b870aee6e62c682104935fde 26-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6318791 Replace the Lohit Devanagari and Tamil with Droid versions

- take care of ttf filename changes and regular/bold versions

Change-Id: Ib71d2537df16ff954cef9619c12d611948d19efe
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
cf4284bce11acadb1c36564b067bce3b0b26a9f9 05-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Update Arabic font for SystemUI

- bug #5987379 Need an Arabic font with metrics "compatible" with Roboto
- use the Alt version with GSUB optimizations

Change-Id: I4d8c62cab37a7b010abab602c39899084d347fdc
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
1637dcd16cd314574a58602337a2c7222130b1b9 02-May-2012 Raph Levien <raph@google.com> Use paint typeface for shaping when it supports the requested script.

This is a hackish but workable fix for bug 6415796.

Change-Id: Iaba91e1e53e688a3ee05a1fdb68fd05102e369f2
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
b294435b5c6e0fee8c431ed3f6d77427d3d79dde 01-May-2012 Raph Levien <raph@google.com> Make Arabic script runs longer (for performance) - bug 6426451.

This change avoids selecting the incorrect font for drawing characters
when the first character in a run is a space.

Change-Id: Ibc672560d364b8de8c3e21de1c738c6dc5639395
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
66556c730deba60288adf66ba1685a9d2c724aae 25-Apr-2012 Raph Levien <raph@google.com> Merge "Improve char mirroring in TextLayoutCache"
3632b7f3ef0c6158507724a2496b24b457f3f007 25-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Improve char mirroring in TextLayoutCache

- now use ICU u_isMirrored() instead of a small hardcoded list of unicode points

see bug #5961254 Harfbuzz should be able to support Bidi_mirrored unicode attribute

Change-Id: I3243a58558a97930f0e7fdf5e9c1d5695d9393de
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
57e9723134e295c75a5aa0b20ca4764fc3959d25 25-Apr-2012 Raph Levien <raph@google.com> Partial fix for bug 6132077 (incorrect line breaking of Arabic text).

Fixed getTextRunAdvances so that advances are correctly aligned with
UTF-16 code point offices, rather than runs being reversed in RTL.

Change-Id: Ife59c0c26f745654c16656c86072e9102d8f6bc7
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
276de3e1eb11d1eb93076dca5a69c791d3ef63d8 13-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Add new Arabic font for SystemUI

- still work in progress
- bug #5987379

Change-Id: I0a7f7437c9061eab0abc9d5979c947eb5511992a
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
43e4985abfcb69db8fb39a95794eb34a2f142214 29-Mar-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6248364 Tamil and Denavagari text crash in Google+

- fix initialization of variables

Change-Id: Ibda4e1e6f55f867385eaf9a4c7a754c16815bbf0
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ff40ab7a418dd06cfe4758ceda17a775f2d4c776 28-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5180841 TextLayoutCache needs to support Indic

- add Tamil and Devanagari shaping support

Change-Id: I331ec52cd1987e157100deb699db27f855881c32
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ffd121233a38adfa49f7bb29bdceba7a4700e0c7 04-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Revert back to DroidSansArabic font for SystemUI"
ab8c73882e0c572f42a5c73ebabf18706b8cc7b6 31-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5929529 Parentheses aren't correctly rendered in RTL context

- do BiDi mirrored char mirroring in TextLayoutCache
- see BiDi mirrored chars list at:

http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBinaryProperties.txt

Change-Id: Ia0af0e252dbb0c55cc689bc9db34e05591bb6ee8
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
9b255cac775064038a5548c983205b2dfb029841 02-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Revert back to DroidSansArabic font for SystemUI

- see bug #5957987 Revert to use DroidSansArabic instead of DroidNaskh font for Arabic Shaping in SystemUI
- DroidNaskh was having FontMetrics not compatible with Roboto

Change-Id: I9f3031c250f907c80f3992f71d929dc91686e1e5
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
a731b082b2c43204e6e9f927ab82fb732934a83b 24-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Code cleaning: centralize use of #if USE_TEXT_LAYOUT_CACHE

- also clean some destructors (was not quite compulsory because
they are related to some Singletons)

Change-Id: I3091cac7b38628cda593d72570ba7a5d7ea2a15c
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
e414613bb8d9b1ee0234a2b0858d6f447d0d956a 25-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5901103 all_source_project_146981_Android - Android ICS LQA Regression:FA, AR, HE and TH - Font Corruption"
3941a22bfd36fe2866c2e0da93dbea2c60ec7c22 25-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5901103 all_source_project_146981_Android - Android ICS LQA Regression:FA, AR, HE and TH - Font Corruption

- use the first char of the "run" instead of the "string" for the BaseGlyphCount

Change-Id: I647528ec912bb69655cf301bbc73b66dc1a6fc82
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
bd901dee317d10c6a921922c3d7d788b90306c82 21-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5846413 "phone" keyboard layout is broken on master

- was a subtle regression introduced when fixing bug #5753006
- as we are now using SkPaint::kGlyphID_TextEncoding (glyph encoding)
instead of SkPaint::kUTF16_TextEncoding (UTF16 encoding), we need to
force the UTF16 encoding in some cases that are NOT going thru
the TextLayoutCache / Harfbuzz shaping

- fix also breakText() the same way

- also clean some old comment

- Warning: depends also on a CL from Skia for having getBaseGlyphCount() "const"

Change-Id: I3d1fc87f070884876c679b33541f810fbfb5df3f
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
c7c09960ff9cc71d4f27f57b456986f4b634310d 17-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5870701 Thai text can be clipped when there are more glyphs generated than the initial number of code points"
03e250aefa29387f30a01243682eab2371103f8e 14-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5870701 Thai text can be clipped when there are more glyphs generated than the initial number of code points

- compute total advances correctly by iterating on the advances array for up to mShaperItem.num_glyphs
- update unit tests

Change-Id: I00af68bef88702215e9222ed80dbffcc81df51a7
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
8564c8da817a845353d213acd8636b76f567b234 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
c726ff02c7749f134885decadd2ea86877119c3d 05-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5822825 Paint.measureText (char[] text, int index, int count) cannot handle text more than 32K long"
bd7cdc32eb30e779edeec3e0d1715376aae6c546 04-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5822825 Paint.measureText (char[] text, int index, int count) cannot handle text more than 32K long

- do not clear the smart pointer when the cache entry does not fit the cache size

Change-Id: I49f1aa1e70018bb7d6a8fb076d9269d0ec6a5d98
See: http://code.google.com/p/android/issues/detail?id=23337
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
5baa3a62a97544669fba6d65a11c07f252e654dd 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
a4d077006306b49d85e7609e8f5a061e345f6f6d 14-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5674155 Segmentation issue for Thai

- force Harfbuzz to shape with the Thai font

Change-Id: I3830acae17385b050e2745fca277cf66af103099
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
65194adc9a5174fc88fb579472799e8b4771796b 14-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5727213 Rendering issues with Bengali in Textview in IML63B

- force Harfbuzz to shape with the Bengali font
- also fix potential returned NULL value from SkTypeface::CreateFromFile(path)

Change-Id: I25be09d06e449b89bb4a62444e27f77e436b77ba
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
902a5b31c50022a1b7707be4d333e4ce6ec4a8fa 09-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache - fix diacritics composition

- normalize (with ICU) each BiDi run before shaping them

We are normalizing by "chuncks" and starting from the end of the string. Each "chunck"
is composed of the main code point and its associated diacritics.

Fix bug #5738435 TextLayoutCache should be able to take care about diacritics during shaping

Change-Id: I7288027a7fa8eafb8b9f38d449625be60214548a
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
b02d0ca5553300063e4332192632312600caf4b9 08-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Clean TextLayout code and remove RTL_USE_HARFBUZZ

- remove dependencies on ICU
- use TextLayouCache
- remove RTL_USE_HARFBUZZ define (we *are* using Harfbuzz now)
- also fix compilation warning

Change-Id: I022e11703438d07032e49e42724184f6bf16653e
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
a03bdedbdf1022d1391f5f0a6ea507e2ebbb0e9a 06-Dec-2011 Jeff Brown <jeffbrown@google.com> Harfbuzz assumes the length of the item is at least 1.

If the length is zero, then it will clobber memory at index -1
into the log_clusters array.

Explicitly handle the cases where the entire string or a single
run might have a length of 0.

Bug: 5705479
Change-Id: Ibbd3a4edcb7e1cad09c34091b42bb315776ea558
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
738ef87eacd3e54132d1bf661dd9329050fddd2f 06-Dec-2011 Jeff Brown <jeffbrown@google.com> Ensure log_clusters array is big enough.

Bug: 5714171
Change-Id: I886f1af8af177827f052e6406a192f2fad5c2cec
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
868d1bdf3c01dbdcf15b780db72d1c9a3022829f 03-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "TextLayoutCache Fix compilation issue"
5448f0378ede9c5d33e7300fa318ef4a6925562f 03-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache Fix compilation issue

- fix compilation after refactoring and when setting DEBUG_ADVANCES to 1

Change-Id: I8eef7e3c4550c505325459948d3c8eebbdd5215a
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
2e5e96e9f06b3853dcade61c0aceb0dbaaff3032 01-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache Code cleaning

- remove commented code
- fix log

Change-Id: I8495b923c9426e33e645fe85ea04005520716f4e
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
56e6e5492780feb3824ff076551b563aade6a2ef 01-Dec-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache logging

- make logs more consistent and readable
- add more logs information

Change-Id: Idfe5bb53e9163c4c07a9b4267b66b0d0e164a498
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
0af10b54bf110653b74cb92793484b412a90b657 19-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache performances

- introduce TextLayoutEngine
- reduce calls to HB_NewFace as they are opening the font files under the cover
- refactor code for removing FontData structure
- fix logging

Change-Id: Id9658fcd454b74c34ecf4e9dfd1bd2201e04b988
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
a4f5aa87c73de7a2581dc4dd72e0f90ccea79a18 18-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix TextLayoutCache Skia Typeface caching

- fix reference passing for globals

Change-Id: I806dd4406d455b98c6be733847419b06b6774ccc
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
d9e688cab3015d858110fb8240cf7378c6befd82 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Clean up GenerationCache.

Use const references to keys and values where appropriate to avoid
copying them unnecessarily.

Deleted some dead code.

Simplified a few pieces that were doing unnecessary redundant work.

Change-Id: Ib2145b7094a40db2d679e05dafe050fe1e87b846
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ad169f49af9fac1b80faa124496103dff2ac29f4 12-Nov-2011 Jeff Brown <jeffbrown@google.com> am 0e4669c8: am f1f0c873: Fix bug in TextLayoutCacheKey handling embedded nulls.

* commit '0e4669c81009cea51d9d7b42b7ff665f44e78aa6':
Fix bug in TextLayoutCacheKey handling embedded nulls.
0e4669c81009cea51d9d7b42b7ff665f44e78aa6 12-Nov-2011 Jeff Brown <jeffbrown@google.com> am f1f0c873: Fix bug in TextLayoutCacheKey handling embedded nulls.

* commit 'f1f0c873b1d119a19342cb67ca77b59607951659':
Fix bug in TextLayoutCacheKey handling embedded nulls.
06daa7b6b2186cf1e83e14d2adbb0d2050b79c39 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Improve the logging in TextLayoutCache.

Also deleted some dead code.

Change-Id: I1feb5744177ae751ff1417f49f3c45139a35246b
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
f1f0c873b1d119a19342cb67ca77b59607951659 12-Nov-2011 Jeff Brown <jeffbrown@google.com> Fix bug in TextLayoutCacheKey handling embedded nulls.

We were not passing the length of the UTF-16 string to
String16::setTo. As a result, it was copying the contents of
the text up to the first null it found.

First problem, these strings are not typically null terminated!

Second problem, if the string contained a null character, then
we might truncate it. However, we only truncated the string
when the copy constructor was invoked (say, when we called
get() on the cache) but not in internalTextCopy() (before
adding the key to the cache).

As a result of the second problem, we would first search
the cache for a key that matched a partially copied truncated
string (potentially reading uninitialized memory that followed it).
Finding none, we would add the entry to the cache using
the correct key.

If the cache already had a value associated with the correct key,
then the put would fail, returning false. Charging ever onwards,
we would add the size of the entry to the cache size.

Proceeding in this manner, it was possible for the cache to
believe it had less remaining space than it really did. At that
point, it was possible for the cache to evict all entries and
yet still not think it had room to add a new one, so it would
continue trying to make space indefinitely.

Bug: 5576812
Change-Id: I05251594f6b2da0a5dc09f7200f04fe9100ec766
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
208d4592f6e8db90eab30cfca3dc294731258d1c 09-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential crash when shaping Hebrew with bold

- make code more resilient
- make correct initialization of gHebrewRegularTypeface

Change-Id: I97e98d36b830ad35979184c1459e8c8503eb3d28
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
e187a2f55fe8684c853a0701cbc4a71392f437e0 08-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5559439 Bogus tab title in browser

- no need to shigt glyph IDs if we are a "common" script
- also code cleaning (suppress dead code)

Change-Id: I17bcf960f925a897a30894a3c581053f7fe5905f
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
4f4b83c50c67d4520af3d5b4733b1627208275ce 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> am 07b4b314: am bcf05a69: Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

* commit '07b4b3145333bc8ece9fdbb68ade726b3d6485cd':
Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"
07b4b3145333bc8ece9fdbb68ade726b3d6485cd 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> am bcf05a69: Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

* commit 'bcf05a69090f342d328f1537d1d83406b883290b':
Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"
bcf05a69090f342d328f1537d1d83406b883290b 02-Nov-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5553401 TextLayoutCache is too verbose: "computeValuesWithHarfbuzz -- need to force to single run"

- make single run case non verbose

Change-Id: I5c3b87aeb613697233290ddecac3ca00f58f8313
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ef9bb3c3ea3aa08071ea0c32a505b379c322e5b5 17-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5438102 Double Arabic harakat overlap instead of stack In TextView

IMPORTANT: this change needs two patches for Harfbuzz:
- one concerning hb_utf16_script_run_prev() which was not returning the correct "previous" script
- one for the "script_properties" table that was missing Arabic code point ranges and declaring
HB_Script_Inherited instead of HB_Script_Arabic

The current change is doing the following:
- pass the correct typeface for Harbuzz shaping (depending on the script of the run)
- offset correctly the glyphIDs returned by Harfbuzz

We need to offset the glyphsID as Harfbuzz will return local glyphIDs (meaning in the
local range of the font used for shapping).

We then cannot use those glyphIDs when we are using a fallback Font (Arabic, Hebrews...)
because the FontRenderer needs glyphIDs in the range of all the Fonts (including the fallbacks)

Change-Id: I494897435bbc59293b02392ee2059cebcdf0e571
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
904221a342fe977fe05270b7dde6ac94d13383f6 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances - DO NOT MERGE

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
26e9ee28decfe934f57f6e8dcaf5620b5502e926 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances - DO NOT MERGE

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
ad41b7c0d42b34a039bd9055f2134f8708d0ee67 31-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix bug #5504346 Hung in native_getTextRunAdvances"
5beeda08a7bd300ec22daaa9ae4e2d02a8c121ad 25-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5504346 Hung in native_getTextRunAdvances

- better check of ICU returned values
- default to single run if ICU is returning errors

Change-Id: I836818bda4fc72a27b2201f01023cd23c5d99ecb
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
a99ed6284eac0b00686ca60c595a0b98beddcb79 14-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix compilation issue when DEBUG_GLYPHS define is activated

Change-Id: I61693952ffdc02f77058311fc982fbbf8df24c6c
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
5c863f741e8e484bb39decd516c9fa4c6322e671 06-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5371117 Regression : The Hebrew / Arabic text behavior in ICS latest build is wrong

- welcome back start / count
- goodbye log clusters
- clean Paint code
- make private some functions as they should be
- improve memory allocation (create only one Shaper and reuse it for for shaping the runs in
the same input text)

Change-Id: I89a320c7f041319851308c8c9a919fbeafa82cdd
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
8ebf1efd66516340bedbf0d0a19d5e96cc28fa20 03-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix potential issue with the TextLayoutCache with glyphs"
155fa38a71ff11e1617b1e3dfda770543df8eb1d 01-Oct-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential issue with the TextLayoutCache with glyphs

- there may be a mapping of one char to many glyphs

Change-Id: I48846d176d61dc8d8e513ca144fdf8ad805e63b7
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
717060b076350ea811153290281075396a554fed 28-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Improve TextLayoutCache performances a bit

- the gain is about 5% and the timing is more stable
- use compare_type() and strictly_order_type()

Change-Id: Iab81869a8ba461ce786a468b6c59b8f34e8db838
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
5293cea4e05556b4144d9487b47282a21c9f6941 27-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug # 5376028 Arabic text is kinda broken - disappearing glyphs

- make the log clusters happy

Change-Id: I73ca9512f0ca02549dad5270d6ec198ae9b00a4e
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
79df5323e7ed541b854cea5684a89e8be8c2dfc9 20-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits

- makes TextLayoutCache not carring about start/count. Basically he will cache the result for
the full string and gives back the "chunk" corresponding to start/count
- changed the TextLayoutCacheValue API to take start/count parameters
- add Harfbuzz LogClusters in TextLayoutCacheValue as it is needed for extracting the start/count "chunk"

Change-Id: I4b38a4442428606de9a093303bbbe98181e1f89c
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
7aac2979605f4811cf096f7c62d363381c68f6b2 20-Sep-2011 Jeff Brown <jeffbrown@google.com> TextLayoutCacheKey needs to store start and count.

Bad merge.

Change-Id: Id6507b3a7e35808a6d34501a45d79fcb7470657d
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
4dd99e5912c73d5a9db165cefd4852b51ea438e8 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache code refactoring

- use vector (instead of array) for advances and glyphs
- reverse glyphs directly in computeRunValuesWithHarfbuzz() (instead of reversing them after)

Change-Id: I716a8f914fd043818d7cb80cca76ee5fb0effb96
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
e0d558ac92cd9e550b3d08bf09d9bb12c2a506c6 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Merge "Fix potential leak in TextLayouCache"
54dc642cc1e188b9eeecadb648b9e8c610f4b857 19-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Make TextLayoutCache no more dependent on ICU

- move ICU call to TextLayout

Change-Id: Id5a21e7b69e484536cfb5b86fbb0c112fb661dfa
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
e74fef3b55dc1b5daf40b3a6aea857582071560f 18-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix potential leak in TextLayouCache

- need a copy constructor for the key as the GenerationCache we are using
is actually a KeyedVector<K, sp<Entry<K, V> > >
- use the getText() API to access the text in the cache key

Change-Id: I5b60ebc062b62308ed7ac1284cfe2a9f28e2b8b1
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
9c418dbc56efd334c68872d281f75138e16eae46 18-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Revert "Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits"

This reverts commit d686d76814f18061e06995df0d5de9feb9f70a7e
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
d686d76814f18061e06995df0d5de9feb9f70a7e 14-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits

- makes TextLayoutCache not carring about start/count. Basically he will cache the result for
the full string and gives back the "chunk" corresponding to start/count
- changed the TextLayoutCacheValue API to take start/count parameters
- added the Harfbuzz LogClusters in TextLayoutCacheValue as it is needed for extracting the start/count "chunk"
- fix potential issue of cache key leaking

Change-Id: I9276f9bec744e8de36349acfba8429f7c6f83394
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
51f383d65f9ee3c7d73d0508b576550e7998c5b5 14-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix some TextLayoutCache issues

- wrong ContextCount was passed
- better logs

Change-Id: Ie78ba70f98f3cf017c168ab8848cc080fc175f31
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
163268b3a8d4dd7e650e6c540f832bf60f6bf4c9 08-Sep-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5274332 TextLayoutCache is having multiple instances

- also fix the missing LOG_TAG define

Change-Id: I25e96d1ba372e84768604f18702e0724fdecefb0
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
abb0f299fdc72755a18cf8848d57919890f0cd42 19-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Update TextLayout logging

- centralize logging into TextLayoutCache
- add offset logging

Change-Id: I52f229b2a8aed121715b37a5a42936875b23f3c9
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
596072306191932c3a7f845b549795380eeb4c53 17-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5174495 Harfbuzz shaping is broken after taking care of Indic

- revert back to old working code where the script was setup for Harfbuzz\
depending of the direction of the run

Change-Id: I7ec740732b51ccf05b6744b7f9d2fcb35555478d
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
5de5b1a91e25ef4931661fdd089d7e0e2b7da035 09-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix Harbuzz shaper for being able to do select other scripts than Common or Arabic

- need to take care of diacritics marks that return HB_Script_Inherited for a script

Change-Id: Icbfea46b305e15849b25410fed07d9cd5dfeb818
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
f09e46e938cd041315f25de3d23560c12c08bf4e 08-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Revert "Adapt TextLayoutCache for new Harfbuzz scripts"

This reverts commit 7f4ae758ba4724f7c3031d33ad8e749c11d1e059

This CL created a regression:

#5134317 Arabic Keyboard does not appear
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
7f4ae758ba4724f7c3031d33ad8e749c11d1e059 03-Aug-2011 Russell Brenner <russellbrenner@google.com> Adapt TextLayoutCache for new Harfbuzz scripts

The Harfbuzz script setting was wired to HB_Script_Common for left-
to-right text and HB_Script_Arabic for right-to-left. This change
selects from additional scripts using some utility APIs from
Harfbuzz.

Change-Id: I34a6f1e0407c8d122bc968443948e7863d1f91ed
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
c2063a5b18bc2e54f000b411c82f43992a53854e 18-Jul-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5037425 Canvas.drawText can't handle Right-to-Left text and text composing

- optimization for single run case was broken
- pass isRTL boolean along the call stack instead of the dirFlags integer
(which was only used as a "isRTL" in the shaper)
- update unit tests

Change-Id: I33110b76a433633a0b92fbd1db03785204e0c3e6
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
b092f55c37f19aa4ee714242337136b9061f8ca8 24-Jun-2011 Doug Felt <dougfelt@google.com> Fix potential advances overrun in TextLayoutCache.

Change-Id: Ibec544f249833a28fe8ef9a15fc8ab48fddfc51c
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
78b868ff42cc368c45f851443678a822560dc266 18-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #4441002 Crash in SkPathEffectGlue::OneD_constructor

- take care of empty strings in TextLayoutCache when computing advances/glyphs with Harfbuzz

Change-Id: I8eb5f632feb7a86e5c4a6db03d073c4b7d859dbc
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
589e4e27ee071f028a4bc72b91a1fb053ab13404 26-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #4338103 (Android Arabic and Hebrew input is broken)

- fix glyph order when there is only a single run
- update tests

Change-Id: I113f28a8c76cab622fb75ce84bc50d1d38fa254e
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
010d5c4e5ba7a229f621f08f5d1c5cbff7643402 22-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayout cache - update size and improve logging

- set size to 256K
- add pid logging
- fix percent gain computation

Change-Id: Id6da4d606147294e05597022414531c346860f45
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
06732fde78b1caf8b5e6c0ef93357cfacedd1823 19-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Return chars advances instead of glyphs advances

- take care of log_clusters for char/glyph mapping
- remove verbose logs

Change-Id: Id19af2b4a46cc4ada0b99263a3208de14a979ba5
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
689e515ed2b8064c15e54d8ab69d87de54c5e0d6 14-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Add Unicode BiDi Algo before drawing text in Canvas

- only for temporary API
- update BiDiTest

Change-Id: Ifd445799dc0fda4da896246e41978cd8d71aa035
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
fcf2be1846935e7983ea2fe87fdd4d7af27764b6 06-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache - add glyphs caching

- cache glyphs after Harfbuzz shaping
- use "m" prefix for member variables
- add temporary API for drawing text with glyphs
- update BiDiTest app

Change-Id: I619b3f313b15f010018daad21b3e5e486619b4e4
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
48796a81be31e42ee267347156c94445cb9fb67a 06-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> TextLayoutCache - more code refactoring

- move code from .h file to .cpp file

Change-Id: Ib8201a20e2767ef5d92707a6f4d8d79a3673e04d
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
1de9e7a9dffb4391a446000f748e4c017d948f6b 05-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Code refactoring for TextLayoutCache

- rename TextLayoutCache entry name
- update references to old name
- better variable names in TextLayoutCache::getRunAdvances()

Change-Id: I5173fbc8af79437ce4786084580426f130120ce8
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
9f82b580d744ce4baf057b061994394dcf239eed 08-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Use Harfbuzz instead of ICU4C for computing advances

- use Harfbuzz shaper for shaping and getting glyphs
- add test app for showing result of drawText() and drawGlyphs()
- add private API in Canvas and Paint for test app

Change-Id: Ia15be216f8636d2d864066e9b7de2f53008c30f6
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp
d313c665e618af3194f504064bcd284fe5368682 25-Feb-2011 Fabrice Di Meglio <fdimeglio@google.com> Add TextLayout Cache

- use GenerationCache for caching
- move GenerationCache.h from libs/hwui/utils to include/utils
- add #define for cache activation / deactivation

Change-Id: Ifaf519f0b5e33b087a453e4aa6430162d8438f20
/frameworks/base/core/jni/android/graphics/TextLayoutCache.cpp