History log of /frameworks/base/core/jni/android/graphics/Paint.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
032a35954c6ceb9ab76c728c7638408e0fc07972 15-Apr-2016 Raph Levien <raph@google.com> Don't do layout in hasGlyph for codepoint + vs

In the case where the input is a base codepoint + a variation selector,
the code currently checks hasVariationSelector and then does a layout,
checking for a single glyph. However, HarfBuzz in some cases will change
the VS into a space glyph, so hasGlyph will return false.

This patch makes hasGlyph rely entirely on the hasVariationSelector
method in the case of a base codepoint + a VS

Bug: 27531970
Bug: 28182689
Change-Id: Id190c427149213509f2d779ec1aa330feb4b62d8
/frameworks/base/core/jni/android/graphics/Paint.cpp
589cddc034f87fcd02adb24e168ef6b2ed851b82 05-Apr-2016 Seigo Nonaka <nona@google.com> Paint.hasGlyph should return false on unsupported flags.

By Noto font update, now it has a special glyph for unsupported flags.
Paint.hasGlyph should return false in this case even if it has a glyph.

Bug: 27999343
Change-Id: Icbd31db83d945d66de1477aa888275f6c0ef79b0
/frameworks/base/core/jni/android/graphics/Paint.cpp
aea43f8414c79492beccc55a274700b644bf747a 01-Apr-2016 Keisuke Kuroyanagi <ksk@google.com> Merge "Fix: doRunAdvance returns wrong value when offset == count." into nyc-dev
b3677715e64277fb59045684a7722ef8a8ab2541 28-Mar-2016 Keisuke Kuroyanagi <ksk@google.com> Fix: doRunAdvance returns wrong value when offset == count.

Bug: 27869952
Change-Id: I56278676da4c354ced4244e4b073bb0d82edf93b
/frameworks/base/core/jni/android/graphics/Paint.cpp
bad99183916ba2bac6659efc8a28273e344ba511 17-Mar-2016 sergeyv <sergeyv@google.com> Clean up and rename TypefaceImpl

bug:25865834
Change-Id: I77e8a627163e040a5c25865054a8a936052af367
/frameworks/base/core/jni/android/graphics/Paint.cpp
dccca44ffda4836b56a21da95a046c9708ffd49c 21-Mar-2016 sergeyv <sergeyv@google.com> Reland: Move text logic from jni to hwui level

Initial CL: https://googleplex-android-review.git.corp.google.com/#/c/886854/

Change-Id: I9dfd85fe1d2a2c44f4360c8a29fd58d80e6f31c8
/frameworks/base/core/jni/android/graphics/Paint.cpp
afbd0f1fef46ef0ddf633dfde0de724db3da1405 21-Mar-2016 Sergei Vasilinetc <sergeyv@google.com> Revert "Move text logic from jni to hwui level"

This reverts commit a7f6bba1a3565c19715e878dfe7f0e01022944ff.

Change-Id: If4f36f87a85411b6128fd92d391313803ccaf9dd
/frameworks/base/core/jni/android/graphics/Paint.cpp
a7f6bba1a3565c19715e878dfe7f0e01022944ff 16-Mar-2016 sergeyv <sergeyv@google.com> Move text logic from jni to hwui level

bug:25865834
Change-Id: I2d8c9c9544afcb5ce1784f732aed3e54e0eda372
/frameworks/base/core/jni/android/graphics/Paint.cpp
4c8a52647814badd361ebd13813180b8db9b923e 18-Feb-2016 Keisuke Kuroyanagi <ksk@google.com> Optimize: Use measureText instead of doLayout.

measureText is a light weight method dedicated to measure text width.
With this CL, breakText, doRunAdvance and doOffsetForAdvance use
measureText.

Bug: 24505153

Change-Id: Ibd62de2e0fe2e196cf07472f2270cc8c6325daab
/frameworks/base/core/jni/android/graphics/Paint.cpp
a3024bd7026deb777556dd75dd34a719ea1c2b39 17-Sep-2015 Keisuke Kuroyanagi <ksk@google.com> Use light weight method for text measurement.

Bug: 24505153

Change-Id: I94823e8d546fbe0a29bc05e8841672c4cf9b5ecd
/frameworks/base/core/jni/android/graphics/Paint.cpp
775873a66a946fae2b0535abb51df9817bd1b20c 29-Dec-2015 Richard Uhler <ruhler@google.com> Use NativeAllocationRegistry for Paint, Canvas, and Bitmap

Bug: 23130675
Change-Id: I3fbd84ba417ac63df75f87ee2c56e3e7f3c9eb46
/frameworks/base/core/jni/android/graphics/Paint.cpp
4ea7d1d2ab51fd7f67087db669dbaf693560b838 15-Dec-2015 Seigo Nonaka <nona@google.com> Move Language normalization code from Paint.cpp to Minikin.

This is 2nd attempt of I277a08b5a17d45c3edb8fb597fdf6786bbe9f83b

The language code to BCP47 conversion is done by Minikin.

Also this CL addresses the signature changes by
I8df992a6851021903478972601a9a5c9424b100c

Bug: 26168983
Change-Id: Id106e9bb5c3eaa6652b44a1735f427accaca1368
/frameworks/base/core/jni/android/graphics/Paint.cpp
143f50789ecd6d9e9bcd47c38f4daee35c63004f 22-Dec-2015 Bart Sears <bsears@google.com> Revert "Move Language normalization code from Paint.cpp to Minikin."

This reverts commit 5640ae00e76f71a35b10b805bbee55efac6b16f2.

Change-Id: If6dfcd74154c3fa49d1fb037ae78fd84f9844591
/frameworks/base/core/jni/android/graphics/Paint.cpp
5640ae00e76f71a35b10b805bbee55efac6b16f2 15-Dec-2015 Seigo Nonaka <nona@google.com> Move Language normalization code from Paint.cpp to Minikin.

The language code to BCP47 conversion is done by Minikin.

Also this CL addresses the signature changes by
I8df992a6851021903478972601a9a5c9424b100c

Bug: 26168983
Change-Id: I277a08b5a17d45c3edb8fb597fdf6786bbe9f83b
/frameworks/base/core/jni/android/graphics/Paint.cpp
cfc607cf57d453f977c9c4bf09b41ac481c4bbec 02-Dec-2015 Seigo Nonaka <nona@google.com> Introduce cache mechanism for LocaleList.

Setting the LocaleList to the native Paint object is not a lightweight
operation since it needs to propagate a string object to the native code
which then needs to parse it for making minikin language list.

To avoid performance regressions, cache the minikin language ID in
android.graphics.Paint and send the LocaleList with cached ID
instead of a string the next time native code is called.

BUG: 25122318
Change-Id: Ib5ce8bcff8a1c0a2b1a1c3d1868ea8be5a0e642f
/frameworks/base/core/jni/android/graphics/Paint.cpp
bb1a96647a82df5a134bf631fc9db342e7ef61de 21-Oct-2015 Seigo Nonaka <nona@google.com> Make Paint.hasGlyph variation selector aware.

With this CL, Paint.hasGlyph returns true if the typeface supports
the passed code point and variation selector pair.

Bug: 11256006

Change-Id: If29cd0c5942dc78bd862804106e29539bdeee569
/frameworks/base/core/jni/android/graphics/Paint.cpp
eba81d0f88f52ca097204ca526e796a83fdd57d5 26-Oct-2015 Derek Sollenberger <djsollen@google.com> Add missing include for SkPath

Change-Id: Ib1577714d0e5c7e7c7d0e6593debe30e78f0df59
/frameworks/base/core/jni/android/graphics/Paint.cpp
f036ead2a218ffa43697fcaa999b666a4c6d13cf 20-Oct-2015 Roozbeh Pournader <roozbeh@google.com> Pass the whole locale list down to Minikin.

Also, compute LocaleList's string representation at construction.
This is to further push the cost of doing costly operations related
to LocaleLists to construction time.

Change-Id: Ia55b8ce66b1088ff54cb42eb1e11149b5bd10f17
/frameworks/base/core/jni/android/graphics/Paint.cpp
dbffd250003e60c0f11ac3ad2b63f91f67962610 01-Oct-2015 John Reck <jreck@google.com> Fix Paint's JNI

Bug: 22409077
Change-Id: I99e1a11bf14f5b62c41107528f573eaf9f2d4b2f
/frameworks/base/core/jni/android/graphics/Paint.cpp
2c53a0759742eeec8f123ad81b7a26aef222c378 29-Sep-2015 Keisuke Kuroyanagi <ksk@google.com> Merge "Consolidate native methods for text measurement."
536afe6ef79a663e59c3b9781c561f7029ee9319 29-Sep-2015 Keisuke Kuroyanagi <ksk@google.com> Consolidate native methods for text measurement.

Bug: 24505153

Change-Id: I6a00b0516442f7d6108ed0598516365310bd85e8
/frameworks/base/core/jni/android/graphics/Paint.cpp
434a481b2191562582c79be29f24c2e0b5ca60d0 24-Sep-2015 Elliott Hughes <enh@google.com> am ea1831d2: am b57dd722: resolved conflicts for a884d81e to stage-aosp-master

* commit 'ea1831d211ea0e6b2d161c714bb0786369ef2df5':
constify JNINativeMethod function pointer tables
b57dd722f1dc0663417da37d3a82f8283ad3c982 24-Sep-2015 Elliott Hughes <enh@google.com> resolved conflicts for a884d81e to stage-aosp-master

Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
76f6a86de25e1bf74717e047e55fd44b089673f3 19-Sep-2015 Daniel Micay <danielmicay@gmail.com> constify JNINativeMethod function pointer tables

Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
/frameworks/base/core/jni/android/graphics/Paint.cpp
e3a40ea488c7cfa396d5901255719a6ddab791d4 19-Aug-2015 Ben Wagner <bungeman@google.com> Use static_assert instead of SK_COMPILE_ASSERT.

Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion.

Change-Id: I0b294efcf494983f8241e9d5a2c476e2f2a9fff0
/frameworks/base/core/jni/android/graphics/Paint.cpp
c6024cdd3553760aa99bfbabecc6a3d8443f5c47 10-Jul-2015 John Reck <jreck@google.com> JNI optimization tweaks to Paint high-frequency methods

Bug: 22378829

Use fast-jni for getFontMetrics, drops from 35us -> 30us
Note the "heavy" part of the method, getMetricsInternal, is
already called by other fast-jni methods.

Use critical array access for getRunAdvance_* methods. This
will avoid the copy and the access is appropriately scoped
and fast enough to not significantly block the moving GC.
Improves from 88us -> 79us on short text

Change-Id: I7c1481c23f6dba3420fbcf48220f6335cf9f6d10
/frameworks/base/core/jni/android/graphics/Paint.cpp
476f7158222e49ec24a5fc08f0bbb33fb8ca10bf 10-Jul-2015 John Reck <jreck@google.com> Create a thread_local cache for textLocale

Bug:22378829

toLanguageTag is significantly more expensive than previously
thought (note ULOC_FULLNAME_CAPACITY is 157) and weighs
in at around 40us. Given that this is called on every Paint
and that there are typically thousands of Paint objects
created this adds up very quickly.

Given that the locale is almost always Locale.getDefault(),
a very simple thread_local cache of size 1 fixes this trivially

Change-Id: I819e60cac7a4b27e9dd5538332c22ce5bbd0851c
/frameworks/base/core/jni/android/graphics/Paint.cpp
1149cdc84b77d0cbe3c44a7ec6abd29fc63913b5 24-Jun-2015 Raph Levien <raph@google.com> Make measureText(String, int, int) not use context

The measureText method when applied to a string should just measure
the substring, rather than treat the entire string as context. It was
less likely to cause problems than the similar issues with char
arrays, but still wrong. This patch makes the behavior consistent.

Bug: 20087437
Change-Id: I1c6e07a694b151f4fb097edae8e271805e996d06
/frameworks/base/core/jni/android/graphics/Paint.cpp
36ff86c9a3d61dfab43b7f35631bf86d65150252 03-Jun-2015 Raph Levien <raph@google.com> Apply contextStart consistently in getRunAdvance

The contextStart needs to be applied to all offsets relative to the
actual start of context. The code was missing "offset", which caused
mischief especially in mixed LTR and RTL text.

Bug: 21573666
Change-Id: I47a1b6cde5862442b9c7236ee72b2ceb0df9b2e9
/frameworks/base/core/jni/android/graphics/Paint.cpp
1c17ba5f83ad58e3db2aacff3c56323f6fe2bb06 21-Apr-2015 Raph Levien <raph@google.com> Merge "Add Paint methods for cursor positioning"
a027ec5c2dbfbbf10cac9ea538f5e230b093be2f 07-Apr-2015 Raph Levien <raph@google.com> Add Paint methods for cursor positioning

Adds methods to Paint for finding an offset corresponding to an
advance, and for finding the advance corresponding to an offset,
useful for positioning and drawing a cursor.

Change-Id: Id57402ddd1980650f1d0d2f8bbdb75e43612ec51
/frameworks/base/core/jni/android/graphics/Paint.cpp
3544e6fa5629398cb0e541bd9aea0ec03073c0d2 06-Apr-2015 Raph Levien <raph@google.com> Merge "Don't use context in measureText(char[])"
80b485daa64d0ef2339c133f0d9cbc3c2c977c32 03-Apr-2015 Raph Levien <raph@google.com> Don't use context in measureText(char[])

The measureText(CharSequence) method calls into measureText(char[]),
using a temporary buffer, which may be longer than the CharSequence,
and may have additional characters. The existing implementation was
treating the entire char[] as potential context, but this is
incorrect.

This patch does the measurement on just the substring; measureText
doesn't process context. There are other methods for that, such as
getTextRunAdvances.

Bug: 19962931
Change-Id: Ia00cc004f9fa9d45aaf028683e78404d66c1388f
/frameworks/base/core/jni/android/graphics/Paint.cpp
f7f969e67e9ab420404807b1b103dcd18d7aa7b7 01-Apr-2015 Raph Levien <raph@google.com> Add Paint.hasGlyph method

This patch adds a method to determine whether a typeface has a glyph
to support a particular Unicode character or sequence.

The implementation is based on shaping the text and checking for the
presence of .notdef glyphs, and counting the number of glyphs in the
ligature case. In the case of variation selector control characters, it
currently just returns false because there is no variation selector
support yet (Mongolian Free Variation Selectors work because they're
shaped with GSUB instead).

Change-Id: I8ee4ae0d6e81a0ac57f961eb02dcc35aabd87042
/frameworks/base/core/jni/android/graphics/Paint.cpp
0b8606266c1afc69cbeb73acda67c85d87943318 25-Mar-2015 Derek Sollenberger <djsollen@google.com> Fix DrawFilter's usage in HWUI.

Also add additional compile time checks to ensure that the Java
and Skia APIs remain in sync.

bug:19890753
Change-Id: I8503cacf2859307e3f480a78603f9f05901b58cc
/frameworks/base/core/jni/android/graphics/Paint.cpp
2a1ce8a4e5258b6599cb8e86864eb816d24d69b4 16-Mar-2015 Mike Reed <reed@google.com> use SkFilterQuality instead of SkPaint::FilterLevel

Change-Id: I5d26869de746107b8a35a7a662236f993a824b0d
/frameworks/base/core/jni/android/graphics/Paint.cpp
210a189e226d5ce64f760d557efc6570409c8147 09-Mar-2015 Raph Levien <raph@google.com> Add HyphenEdit support to Paint

This adds HyphenEdit on the C++ and also to Java via JNI. HyphenEdit is
a Minikin feature for adding hyphens to text without having to edit the
string on the client side.

Change-Id: Icfb228407c1d11a716d055f813da7507acb38fbf
/frameworks/base/core/jni/android/graphics/Paint.cpp
158b6c98508f111de041853cab1d7a87b771b651 21-Nov-2014 Andreas Gampe <agampe@google.com> resolve merge conflicts of 7d13d9d to master.

Change-Id: I4d8a7ec4a25471565859050939ec05b0c1261627
7d13d9db1ef90063cb542ccd6554042a6a3263b7 21-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 3fc5e3ca to lmp-mr1-dev-plus-aosp

Change-Id: Id8286e5a4381315a6060251a8055b0f1d1a96019
ed6b9dff563c5e22f040ff37e12c0d771e0478ae 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Consistency in core/jni

Make consistent use of core_jni_helpers for registration.

Translate some #ifdefs into const bools.

Change-Id: I37639aa053dd50f003a552cbd8550dddecc811c5
/frameworks/base/core/jni/android/graphics/Paint.cpp
a30c08e390403e9f678ce2ca5fa491aae0fd85b6 08-Oct-2014 Chris Craik <ccraik@google.com> am f1f54818: am a7315a14: am 86fd9278: Merge "Enable fast jni for simple RenderNode/Matrix/Paint operations" into lmp-mr1-dev

* commit 'f1f5481817b0d306319e49a100fb3b5fb6534d0f':
Enable fast jni for simple RenderNode/Matrix/Paint operations
57c4fed236cbec0944824b534fb9c828ac0d1f81 08-Oct-2014 Derek Sollenberger <djsollen@google.com> remove references to SkPaint::TextBufferDirection

The enum is planned for removal from Skia and its usage here was
unecessary.

Change-Id: I3bd5b4de068ea9e8b0b81f408c987e4c9c4a1875
/frameworks/base/core/jni/android/graphics/Paint.cpp
4136a0aeac9bb95aa615d4fc1f12378829d26c80 08-Oct-2014 Chris Craik <ccraik@google.com> Enable fast jni for simple RenderNode/Matrix/Paint operations

bug:17895119

Change-Id: Id83bfd719ec873028f0d4e7e4e4c0702f3bb3dd9
/frameworks/base/core/jni/android/graphics/Paint.cpp
ab22c1c792bc5f422a029a4ab6a23861e44136d8 03-Sep-2014 Derek Sollenberger <djsollen@google.com> cleanup so that the Paint.h is only accessed via its nativePtr not a JNI lookup

bug: 17641888
Change-Id: I8fc2a01fdcf62dd33b443b0a2302df5e29dc3f49
/frameworks/base/core/jni/android/graphics/Paint.cpp
6f03023ece076d33d8b171d5398c8ed70abf3f54 07-Aug-2014 Derek Sollenberger <djsollen@google.com> Remove dependency on SkPaintOptionsAndroid

Change-Id: I579a3503697efe3b8fd9bc809a6c9bfbf735cb1b
/frameworks/base/core/jni/android/graphics/Paint.cpp
e9ad3931fae71c8a8cd000fd52d5df4be79b0895 31-Jul-2014 Behdad Esfahbod <behdad@google.com> Add fontFeatureSettings to TextView and attrs

New API is hidden.

Bug: 15246510
Change-Id: I8cdbbd3a36fc280e07569dbb130f8c237062fff5
/frameworks/base/core/jni/android/graphics/Paint.cpp
805f6ebf17e2791624bb1a30834b4c1cc65583bf 30-Jul-2014 Behdad Esfahbod <behdad@google.com> Support FontFeatureSettings in Paint

New API is hidden.

Bug: 15246510
Change-Id: Idefca06a366de0d87f53d123b5291788448de4d0
/frameworks/base/core/jni/android/graphics/Paint.cpp
c41d941f1b999502a2121597edeb3c23d26a2269 30-Jul-2014 Derek Sollenberger <djsollen@google.com> Disable fallback chaining in Skia.

Change-Id: I6e57b525bc4953a5b8969bb4c3e71b4a53de33d3
/frameworks/base/core/jni/android/graphics/Paint.cpp
e21e2a2d1d85d422230c1115abba824338763a88 29-Jul-2014 Behdad Esfahbod <behdad@google.com> Clean up Minikin includes

Include headers where they are used. Add header guards to MinikinSkia.h

Change-Id: If341231625348290d28a7d625561fffc171a8407
/frameworks/base/core/jni/android/graphics/Paint.cpp
63c5c78a72a21d57913e8601cc2a1ab72a424a02 25-Jul-2014 Behdad Esfahbod <behdad@google.com> Further centralize Minikin interaction

Part of the fix for bug 15246510 and others.

Change-Id: Ie99000989dfcd7a81aaa1233dec522344f852f31
/frameworks/base/core/jni/android/graphics/Paint.cpp
fa80f7491df82d71b7084500519a2195afbea706 18-Jul-2014 Behdad Esfahbod <behdad@google.com> Add letter-spacing to Paint and TextView

New API is hidden.

Bug: 15594400
Change-Id: I5cbe7aebef0b7280eb13924f2a706c0cb4a4688e
/frameworks/base/core/jni/android/graphics/Paint.cpp
6ba30b85ddfbe37c338ee8dde3dd33322eb38d47 15-Jul-2014 Behdad Esfahbod <behdad@google.com> Add android.Paint that inherits SkPaint

The idea is that extra paint parameters that only affect text layout
(not rendering) will go in android.Paint instead of going into
SkPaintOptionsAndroid. We will eventually move those out of SkPaint
too.

This is currently implemented in PaintImpl.cpp. Will be renamed when
current Paint.cpp that has JNI bits is moved to android_graphics_Paint.cpp.

Change-Id: Iba66c34dea5da503a13b9c864cb9f2211ac4ba7d
/frameworks/base/core/jni/android/graphics/Paint.cpp
3d528c403c8945cc326bb656ff0c2e11373401da 26-Jun-2014 Raph Levien <raph@google.com> Fix build breakage

Other files were including GraphicsJNI.h and didn't have Minikin in the
include path. This patch eliminates the offending include.

Change-Id: I05c9dbf80b93f1731fd0192015e2c9c68a9dd3c6
/frameworks/base/core/jni/android/graphics/Paint.cpp
3660789f06c5fbcb81e6c7c79612048bff8f0f66 26-Jun-2014 Raph Levien <raph@google.com> Switch all text layout to Minikin

This patch switches all text layout operations to use Minikin, removes
the USE_MINIKIN #ifdef, and deletes some of the code that was only used
in the old TextLayout path (although some more refactoring remains).

Change-Id: I51b5c4e2bb46cfd9d204c12b9f16f135c769f5b5
/frameworks/base/core/jni/android/graphics/Paint.cpp
d194262f53799ef7cd660729a8f1027263f73e27 26-Jun-2014 Raph Levien <raph@google.com> Delete Paint.getTextGlyphs()

The Paint.getTextGlyphs() method was used for testing the old Arabic
shaper and is entirely obsolete. Note that this is the very last
dependency (other than some enums in the header) for the old TextLayout
code path.

Change-Id: I7b596f0c0942ed50987fc8e0478cd93e667f1f9e
/frameworks/base/core/jni/android/graphics/Paint.cpp
e368b6bcfd499543a876b4cae02f1ca563ff1cb6 16-Jun-2014 Raph Levien <raph@google.com> Use Minikin grapheme cluster breaking

This patch uses the Minikin implementation of grapheme cluster breaking,
which improves the behavior of left and right arrow keys for moving the
cursor. Among other things, it fixes the behavior of jumping over the
"fi" ligature in Roboto.

Part of a fix for b/15653110 Improve behavior of arrow keys in EditText

Change-Id: I80ca54c973d85c49f23b81d51a0fe07a7a853d81
/frameworks/base/core/jni/android/graphics/Paint.cpp
a7aa1b0aa566b2ff310cb89fbc9437de4819f583 12-Jun-2014 Anish Athalye <aathalye@google.com> Implement Paint.breakText() using Minikin

Change-Id: I36cee2d840ce1bd24a9a06f0c680880396b7398a
/frameworks/base/core/jni/android/graphics/Paint.cpp
051910b9f998030dacb8a0722588cc715813fde1 16-Jun-2014 Raph Levien <raph@google.com> Clean up dirFlags / bidiFlags confusion

The dirFlags and bidiFlags enums are distinct, and have different
meanings. The former is a determined direction for a run of text, while
the latter is a request for the bidi algorithm. They have been used
interchangeably, and this has caused some problems, notably running the
bidi algorithm needlessly when the direction for a run is already
determined.

This patch cleans up the confusion, by always naming each occurrence
explicitly "boolean isRtl" or "int bidiFlags" (the previous code often
just used "int flags", which added to the confusion), and converts
between the meanings when a function takes an isRtl argument but passes
it to another function expecting bidiFlags.

Fixes b/15089607 Clean up bidi flag mess

Change-Id: I410b6604376e853dd12c255e7f5a9d2b9a310dd9
/frameworks/base/core/jni/android/graphics/Paint.cpp
0627ec08dcc2e87c17e9b85f045dfb27dc4884b3 07-Jun-2014 Raph Levien <raph@google.com> Support fake italics

This patch adds fake italics, using essentially the same mechanism as
the fake bold implementation. Also combines fake bold/italic settings
with ones explicitly set in the paint.

Change-Id: Ia7eb3ddc8a6192d191711ba723ffd0d1d9d93f2e
/frameworks/base/core/jni/android/graphics/Paint.cpp
1fc0fa87d42ce9268ece76b85b9edc834593e53a 07-Jun-2014 Raph Levien <raph@google.com> Support for fake bold in Minikin builds

Part of the fix for bug 15436379 Fake bold doesn't fully work (Minikin)

This patch queries the Minikin layout for when fake bold is needed,
and applies that to both shaping and drawing paint.

Also simplifies refcounting (the lifetime of all MinikinFont objects
is subsumed by the enclosing FontCollection).

Note: the fake bold flag set by the user is ignored in this patch.

Fake italics would be possible using the same mechanism, but it's
slightly more complicated (fake and user-set textSkewX values would need
to be combined, and the latter restored after drawing).

Change-Id: Ica2c4604846cbb37e5a783778b18d8993c9d4563
/frameworks/base/core/jni/android/graphics/Paint.cpp
817ef4ae79bd39b5e55fc6ca4e3b8e47e114579f 06-Jun-2014 Raph Levien <raph@google.com> Fix getFontMetrics problems

Fixes a number of individual problems. In Minikin builds, gets base font
from TypefaceImpl rather than using whatever random font was in the
paint. Respects elegant metrics in ascent and descent methods as well as
getFontMetrics. Sets fixed ascent and descent values to 1900, -500,
which matches the Roboto font.

Part of the fix for bug 15467288 "Inconsistent line heights on
Minikin builds"

Change-Id: I12915f4a62de28932469c7279241eecf7320c47b
/frameworks/base/core/jni/android/graphics/Paint.cpp
6bfd7e7df3a9f9ea2f9e57a3552eed7f518be711 04-Jun-2014 Raph Levien <raph@google.com> Support for context in Minikin shaping

This patch uses the Minikin's new doLayout API that supports context,
and has some simple refactoring (pass css as string rather than setting
on the Layout object) to use this api.

Change-Id: I899474f81d377f3106e95ee3eb8d0fcc44c23ac2
/frameworks/base/core/jni/android/graphics/Paint.cpp
854363e3d2fb2a9e41d8719f4a2f0f8b89440a46 04-Jun-2014 Raph Levien <raph@google.com> Fix incorrect getStringBounds (Minikin)

This patch wires up getStringBounds to do the layout with Minikin to get
accurate bounds, and with the correct typeface. It fixes bug 15416575
"getStringBounds gives wrong result in Minikin".

Change-Id: I5c020bc372acb1d785a33c3c296239c151bd8c87
/frameworks/base/core/jni/android/graphics/Paint.cpp
f2114d5646194100242206b267ddd6e7194b7da9 02-Jun-2014 Raph Levien <raph@google.com> Better Minikin integration

This patch improves the Minikin integration in a number of ways,
including:

Software rendering does text decorations and handles alignment
correctly. This fixes bug 15139067 "Centered text isn't working".

Paint implements getTextPath. This fixes bug 15143354 "Text rendering in
Maps Navigation wrong typeface?"

Also a bit of refactoring, since there was duplicated code for iterating
font runs that's now a static method in MinikinUtils.

Change-Id: I4cfdb2c0559982376348325a757d95235fab1768
/frameworks/base/core/jni/android/graphics/Paint.cpp
49f0db34811bc374eb6af0a6ba233325ff6f14cc 20-May-2014 Victoria Lease <violets@google.com> fix argument order in call to SkBlurDrawLooper constructor

This fixes all sorts of badness.

Bug: 15074512
Change-Id: I5e96983c58d19e0dc2d8fa61d1efa9dcff076ca1
/frameworks/base/core/jni/android/graphics/Paint.cpp
4c9355c35a0f62805739823a62ad41ca1cbc6502 07-May-2014 Mike Reed <reed@google.com> Frameworks changes to support latest Skia (r14729)

Required for a merge in external/skia
(I88b4d5cc81c357a8e223bd7860b1029590265200).

Includes two cherry-picks:

I456df543e1925b280f785c7b3bb81370157f9b09:
replace SkRasterizer* with NativeRasterizer* in JNI

I98adb200e023369d3ee75f21927fa98f23095a77:
Fix Paint.getFlags,setFlags wrt FILTER_BITMAP_FLAG

In Paint.setFlags(), turn FILTER_BITMAP_FLAG into a call to
SkPaint::setFilterLevel().

In Paint.getFlags(), read SkPaint::getFilterLevel() to determine
whether to include FILTER_BITMAP_FLAG in the result.

Fixes CTS tests with ToT Skia.

Change-Id: I2736f3f68683651574d79a169ff0ab563e0a469e
/frameworks/base/core/jni/android/graphics/Paint.cpp
1044a8211d86d4306ee7b075eb2bca9a43f3a492 15-May-2014 Raph Levien <raph@google.com> Merge "BiDi support for Minikin"
2836c4722a156ec78d7f4101b394885a354f5dd6 15-May-2014 Raph Levien <raph@google.com> Merge "Start of Minikin integration"
9d9ee3d666c63938311839002ec974673998c6d0 13-May-2014 Raph Levien <raph@google.com> BiDi support for Minikin

This patch plumbs the bidiFlags for the various text drawing and
measurement functions down to Minikin, so that the latter can do layout
in a BiDi-aware manner. With the corresponding changes to Minikin, it
is sufficient to correctly display RTL text in TextViews.

Change-Id: Ie904f297373b9ad418050a474506605c7c127b0f
/frameworks/base/core/jni/android/graphics/Paint.cpp
1a73f732f91e97c9c66b808c245ddda36a10e987 31-Jan-2014 Raph Levien <raph@google.com> Start of Minikin integration

This is the current state of the Minikin integration. All changes are
hidden behind USE_MINIKIN #ifdef, so it should be safe to apply. To
play with the Minikin branch, set this in your BoardConfig.mk .

This change also merges in 64-bit changes that were happenening in
parallel.

Change-Id: Idd94553bcbe324c5875d0ff06495c966c3e95b7f
/frameworks/base/core/jni/android/graphics/Paint.cpp
c29a0a4664a4b9871fadd668b632469a0db240b9 31-Mar-2014 Derek Sollenberger <djsollen@google.com> Avoid caching shadow properties in Java & HWUI.

bug: 10650594
Change-Id: I6f57df002710bb0567ed7e53fc0bfe96cfd504b8
/frameworks/base/core/jni/android/graphics/Paint.cpp
53c0077256afebb0312f01ef4f60a7445da1f5d9 14-Apr-2014 Raph Levien <raph@google.com> Add elegantTextHeight text appearance attribute

This patch adds an elegantTextHeight text appearance attribute and
plumbs it through to the paint. This attribute selects the elegant
variant of fonts (when appropriate, which is typically Arabic and indic
scripts), and also specifies larger vertical metrics, to avoid clipping.

The intent is for this to be the default for quantum themes, but this
patch doesn't change any default behavior, just adds the attribute.

The larger vertical metrics are applied to top and bottom, but should
not affect line spacing in the common case. Also, with the setting,
metrics are no longer dependent on the font, so setting a custom font
will preserve layout and spacing.

Change-Id: If3b7d41f141deff50ca078f479ca90c2aa07829a
/frameworks/base/core/jni/android/graphics/Paint.cpp
2e0103eb340822f9d580c1aa8492bae8394b8243 04-Apr-2014 Leon Scroggins III <scroggo@google.com> Remove SkFloatToScalar.

Now that SkScalar is always float (it may someday be double, but
float to double is trivial), remove callers of SkFloatToScalar,
which is deprecated in Skia.

BUG:13694396

Change-Id: I524a9bb6f7702bc810bac55fb9d2cd5361a01cf7
/frameworks/base/core/jni/android/graphics/Paint.cpp
46cb9bdbf56b27cbf2ab878b41d21e30896a4fea 06-Mar-2014 Leon Scroggins <scroggo@google.com> Update framework to use M34 version of Skia.

These changes are needed due to changes in the Skia API.

Depends on https://googleplex-android-review.git.corp.google.com/#/c/439626/1
(Ic3cf846b74d6f10ec30c477b50fd774cc30ad52c)

BitmapFactory.cpp:
Use SkColorType instead of SkBitmap::Config, where possible.
Call SkBitmap::info() instead of deprecated SkBitmap::asImageInfo().
Remove calls to deprecated SkBitmap::getSize64().

Canvas.cpp:
ColorFilter.cpp:
Matrix.cpp
Remove the deprecated SK_SCALAR_IS_FIXED path. Leave in an else case for
SK_SCALAR_IS_FLOAT, to allow for eventual SK_SCALAR_IS_DOUBLE path.

Graphics.cpp:
Like in BitmapFactory.cpp, use new methods for determining the size of
pixels.

Paint.cpp:
Use more precise SkScalar_ToInt versions of macros.

TextLayoutCache.cpp:
Fix bug in macro definition for HB_SurrogateToUcs4.
Use the new name for SkCreateTypefaceForScriptNG.

android_view_SurfaceControl.cpp:
Replace ScreenshotPixelRef with a Skia pixel ref.

This is a merge from master-skia branch:
https://googleplex-android-review.git.corp.google.com/#/c/430554/
(Ie11503bcefd3883c466279fde5ce147c8a72b452)

Change-Id: Idf15746f93dabeb7862ac02cc6bd925f0dcc68ba
/frameworks/base/core/jni/android/graphics/Paint.cpp
3af2a37e057b31617b8f4eeb22ac3ef85c3fd5aa 18-Mar-2014 Victoria Lease <violets@google.com> malloc some advances

Bug: 13506939
Change-Id: I87ad616960c4f16bc55d8b906049dbd4f001d6a5
/frameworks/base/core/jni/android/graphics/Paint.cpp
b644a3b84521e2155a5af985a4d4ed305474e567 17-Jan-2014 Derek Sollenberger <djsollen@google.com> Updates to the Skia API needed to merge the WebView m33 version of Skia.

This is a cherry-pick of 2 CLs:

21969a2b26945da3fd86aef7c93479e4fb359a65
c7a581cf7691db5c61e6694aa51daaa994004bd9

Change-Id: I6fd9366fbba0a336de1df794be9497983bfd13ae
/frameworks/base/core/jni/android/graphics/Paint.cpp
36bef0bf30d6bae48cf3837df351075ca4fce654 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71
/frameworks/base/core/jni/android/graphics/Paint.cpp
7023df08f14ec5dee76ac54c03e870f84e297636 27-Jan-2014 Narayan Kamath <narayan@google.com> Revert "AArch64: Make graphics classes 64-bit compatible"

This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976.

Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
/frameworks/base/core/jni/android/graphics/Paint.cpp
18b4cbeedef21c1fa666a110a157bab66edff976 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0
/frameworks/base/core/jni/android/graphics/Paint.cpp
a033630e805c407080221e20b236b6054f324670 23-May-2013 Raph Levien <raph@google.com> Initial integration of Minikin to framework

With this patch, framework does at least some of its text rendering
using Minikin instead of TextLayoutCache. There's a lot of stuff broken
and not yet implemented, but the phone will boot.

Changes are hidden behind USE_MINIKIN, which should be set in
BoardConfig.mk for the brave. Without that, there are changes to
signatures in JNI methods and so on, but shouldn't be any visible
changes.

This commit also introduces a new abstraction for Typeface:

The new TypefaceImpl abstraction represents the functionality that
corresponds to a Java Typeface object. Currently it is backed by
SkTypeface, but in the migration to Minikin it is a FontCollection
combined with a FontStyle. This patch introduces a USE_MINIKIN
preprocessor switch, so there is no substantial change to existing
Skia-based code, but which lets us start replacing the implementation
with the Minikin version.

Change-Id: I532c4c2d32d4f4c1f349dc1db37caa112af587ea
/frameworks/base/core/jni/android/graphics/Paint.cpp
2696797939fdf3b236635998b2739aba87e68ebb 04-Sep-2013 Derek Sollenberger <djsollen@google.com> Revert workaround for Skia bug now that Skia has been fixed.

bug: 7170836
Change-Id: If357767a5f66d539f775bce766e963b3d0df38bf
/frameworks/base/core/jni/android/graphics/Paint.cpp
8870538f7c8d32187255707bc3217bd3625d397e 15-Jun-2013 Victoria Lease <violets@google.com> make setHinting(HINTING_ON) kNormal_Hinting

Previously, the default hinting mode for a freshly-constructed Paint
object is equivalent to Skia's kNormal_Hinting mode, in which font
hints are respected if available. Calling
Paint.setHinting(HINTING_ON), however, is equivalent to setting
Skia's kSlight_Hinting mode, in which font hints are ignored in
favour of freetype-generated autohints.

This discrepancy is bad for a variety of reasons:
- Once Paint.setHinting() has been called, it is impossible to return
to the default hinting level.
- Calling paint.setHinting(otherPaint.getHinting()) can result in
paint having a different hinting level than otherPaint.
- Paint.setHinting(HINTING_ON) actually results in font hints being
ignored, which is perhaps the opposite of the intended behaviour.

This commit resolves these discrepancies by making HINTING_ON
correspond to Skia's kNormal_Hinting setting.

Change-Id: Iefb8e051ef53bea783e6f3be37748985ec397bc5
Bug: 9466164
/frameworks/base/core/jni/android/graphics/Paint.cpp
d7a80774f0a2175f9ee81a7741f9a171c78e0b8b 28-May-2013 Derek Sollenberger <djsollen@google.com> Modifications needed for updating Skia to r9286.

bug: 8719528
Change-Id: I260fefb93c5a8c5dec86acdec66cbe55a2ee8a92
/frameworks/base/core/jni/android/graphics/Paint.cpp
626d3c228116103e95d4429b06dad70f9812561a 27-Mar-2013 Victoria Lease <violets@google.com> bidiFlags != SkPaint::Flags

We've a number of native functions in the text layout path that take
a bidiFlags argument. We've a number of callers of those functions
passing in SkPaint::Flags in that slot. This completely breaks text
directionality for the affected functions, as
SkPaint::kAntiAlias_Flag happens to share values with kBidi_RTL,
resulting in anti-aliased SkPaints measuring text as if it were RTL,
and non-anti-aliased SkPaints measuring text as if it were LTR,
regardless of the actual text directionality. Oops!

To address the issue, this commit replaces erroneous calls to
SkPaint.getFlags() with the value of Paint.mBidiFlags, and includes
the necessary plumbing to get that value where it needs to be.

Bug: 8471481
Change-Id: I2d04b70defed3130fc1ad13f4c9098f5fce4ffde
/frameworks/base/core/jni/android/graphics/Paint.cpp
665f02c66702b77db25e950ff433230186bc3243 20-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #8437358 Clean any ICU related code from TextLayout / Paint and their dependencies

- remove the ICU related methods and update the methods using the "reserved" argument
- update to CTS in another CL too

Change-Id: I5509736568c342d9d17bfeafc17951117ab5d3cc
/frameworks/base/core/jni/android/graphics/Paint.cpp
da12f389eb4be0c08ca3fa9ca7663f4977858df5 15-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Revert "Clean Paint.mBidiFlags as it is no longer used"

This reverts commit 6d9fe5bd22b531bfce69b146254a4791c76acddc.
/frameworks/base/core/jni/android/graphics/Paint.cpp
a4bf8114a73371b51a0eba9d5d61dfeb597a1abb 15-Mar-2013 Fabrice Di Meglio <fdimeglio@google.com> Revert "fix argument mismatches in Paint JNI"

This reverts commit b61fb10fe435b74a761e82f517abd0320f22193e.
/frameworks/base/core/jni/android/graphics/Paint.cpp
b61fb10fe435b74a761e82f517abd0320f22193e 15-Feb-2013 Victoria Lease <violets@google.com> fix argument mismatches in Paint JNI

Paint.getTextRunCursor() no longer has a "flags" argument on the Java
side. The native side, however, still had the argument, and was being
called with misaligned arguments, causing all manner of madcap fun.

Also, the version of Paint.getTextRunCursor() that took String as an
argument needed to lose the "flags" argument, as well, to prevent an
infinite loop in the CharSequence version of the function, which was
supposed to be calling the String version but was actually calling
itself.

Bug: 8201224
Change-Id: Iad0dabaf81185f29a082566cc64590f2ba9bc31c
/frameworks/base/core/jni/android/graphics/Paint.cpp
6d9fe5bd22b531bfce69b146254a4791c76acddc 12-Feb-2013 Fabrice Di Meglio <fdimeglio@google.com> Clean Paint.mBidiFlags as it is no longer used

See bug #7623824

Change-Id: Ie2f9422821f6dcc73c99e8695f448e966b587b1d
/frameworks/base/core/jni/android/graphics/Paint.cpp
059e12ccd20f5c249724a8362d6bac325334ea76 29-Nov-2012 Romain Guy <romainguy@google.com> Use LruCache instead of GenerationCache in libhwui

Change-Id: Ic26ddc7151eb5462bcd243b21daf7187ed6d3bec
/frameworks/base/core/jni/android/graphics/Paint.cpp
577b07197b1bf1b3903e0bc0f3d48fabfd927b2a 05-Oct-2012 Raph Levien <raph@google.com> Fix for 7281523 android.text.cts.SelectionTest#testMoveRight failures

The failures were caused by the implementation of doTextRunCursor
passing a too-small value for contextCount into the underlying
getTextRunAdvances call (it wasn't accounting for the start offset).
Thus, when getTextRunAdvances made a copy of the text for its cache key,
it was getting a partial copy.

This patch fixes the size so the cache key always has a full copy of the
text.

Change-Id: I57e3ac6de7aef0e1f1c7000dc3d653f9b0d623d2
/frameworks/base/core/jni/android/graphics/Paint.cpp
c1eff0857ebc6abce48ba8c267ab32109dd45ef0 14-Sep-2012 Raph Levien <raph@google.com> am e5905684: am eceb3171: am f4afc401: Merge "framework: fix bug for uninitialized variable"

* commit 'e590568417aa824e7b0e76ae727556d329cb57cf':
framework: fix bug for uninitialized variable
46e942d500d5ce67a58269cbac3307deca6a5c9f 27-Jul-2012 Zhou Chang <chang.zhou@intel.com> framework: fix bug for uninitialized variable

Some application display error due to uninitialized varibale.
This patch fix the bug

Change-Id: I660169e325ffae60d95c7774aaaeaebf693adf3d
Author: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chong Xing <chong.xing@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 45356
/frameworks/base/core/jni/android/graphics/Paint.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/Paint.cpp
517825f1a9f14f92908bd7859b91b927c2eec6d9 07-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Add Paint.setTextLocale()

- will be used for better shaping CJK and other goodies

Change-Id: If64945a337edd915f5ebb88f04b6fd18e92ca587
/frameworks/base/core/jni/android/graphics/Paint.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/Paint.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/Paint.cpp
c511bee87cda99a252d1a62487f47c8f05aee78c 05-Jan-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5753006 Garbled Labels in Maps

- it was a regression introduced into this CL: https://android-git.corp.google.com/g/#/c/154240/5
- basically needed to set the GlyphID encoding to the Skia Paint as we are now using glyphID resulting
from the Harfbuzz shaping
- also define GlyphID encoding as the default on the Paint class

Change-Id: Idb7c2c57ac67595425ce3be9421258962690fcdd
/frameworks/base/core/jni/android/graphics/Paint.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/Paint.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/Paint.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/Paint.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/Paint.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/Paint.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/Paint.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/Paint.cpp
f43fa5746ee5b81a6e386d36594094d079ac8160 13-Aug-2011 Dianne Hackborn <hackbod@google.com> Turn off hinting by default for higher density displays.

Also adds an API for apps to control whether hinting is used.

Change-Id: I1a06b06255fbb8d0f02a8ce48c2cd60019088ed3
/frameworks/base/core/jni/android/graphics/Paint.cpp
6ab90ed017fb52aac4493a2fac897299d345874f 09-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Solidify and optimize Paint text related APIs

- better check parameters consistency
- return calls as soon as possible (when null or empty text)

Change-Id: I46744e517b04e3fba0ec37132d7de400177f214b
/frameworks/base/core/jni/android/graphics/Paint.cpp
8fb507171f68d4170cfeb1187ee7d1f70f98917d 14-May-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #4415576 Gmail text looks broken

- pass correct "contextCount" when needed

Change-Id: I56ebd9486e99e6ca5a3973ec403cf1ced874b4c3
/frameworks/base/core/jni/android/graphics/Paint.cpp
0a1413e4bf9dcda2a8abb2287e43f612a7fb2453 22-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Clean getTextRunAdvances() APIs

- remove ICU reference in API names
- use a "reserved" int parameter to pass either "0" for Harfbuzz or "1" for "ICU"

Change-Id: I88b4f76feafd203a6999cd7349402fa36a9a4b2a
/frameworks/base/core/jni/android/graphics/Paint.cpp
4f810c8535055bd9a8d89a7d1ba0a7c712a8843d 19-Apr-2011 Fabrice Di Meglio <fdimeglio@google.com> Use Harfbuzz for Paint drawText / measureText / breakText APIs

Change-Id: I35aa02bfd45629bf5c560f98a28399ff3d0fc900
/frameworks/base/core/jni/android/graphics/Paint.cpp
8451b25a4422656bbd6657a5855e69c0f4d53c74 08-Apr-2011 Elliott Hughes <enh@google.com> Use jniThrowException for exception throwing from native code.

I'll do media and the generated gl stuff separately. Otherwise, this
cleans up all direct calls of ThrowNew/Throw except the one in the
binder that needs to remain.

Change-Id: I8f95a5f020f53b25926ad31ac0c9477ddf85d04b
/frameworks/base/core/jni/android/graphics/Paint.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/Paint.cpp
eee49c699c035ffba188417489f40d34f587d65c 25-Mar-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix text redering issue where the text was sometimes truncated

- mostly was visible in Settings apps / Wi-Fi networks summary info for each network
- correctly setup the local SkPaint for advances computation
- improve test app for adding live resizing

Change-Id: Ia031fe1b115b521ba55c7e68f2a26300f02e48ca
/frameworks/base/core/jni/android/graphics/Paint.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/Paint.cpp
d98aa2de9ab18e09c2be1997f41212740f51f6e6 26-Oct-2010 Chet Haase <chet@google.com> DisplayList optimizations and fixes.

We now use a copy of SkPaint objects to avoid having it changed from under us.
We reuse copies that have not changed. We also copy the SkMatrix every time to
avoid the same problem.

Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
/frameworks/base/core/jni/android/graphics/Paint.cpp
27f0b17d853d8bef918c3d869044e50cf3904ee3 22-Oct-2010 Chet Haase <chet@google.com> Fix native resource leak when OpenGL renderer is not being used.

Native resources (bitmaps, matrices, paints, shaders) are shared when display lists
are used, and a refcounting system is in place to take care of disposing when all
clients are finished with them. But the cache where these refcounts are tracked is
not enabled when the Open GL renderer is not being used. This results in the native
destructors not being called, and the resources are leaked.

Change-Id: Ic7aeb55e4636dcad229846601407e596160346e6
/frameworks/base/core/jni/android/graphics/Paint.cpp
5c13d89c1332fcc499379b9064b891187b75ca32 08-Oct-2010 Chet Haase <chet@google.com> Optimizing display lists by referencing pointers to resources instead of copying them

Change-Id: I81ad3551d74aa1e5bb64d69e33d2eb29a6c1eb6a
/frameworks/base/core/jni/android/graphics/Paint.cpp
1e45aae5de003657e5d18f74d34998f5de5db5b7 14-Aug-2010 Romain Guy <romainguy@google.com> Add drop shadows.

Change-Id: Ic6a72409d4785968d1fbdff229f17ee5c00b240b
/frameworks/base/core/jni/android/graphics/Paint.cpp
f7cb1f75fdaedf996cab7c4690b080adc7bc5b97 02-Jul-2010 Doug Felt <dougfelt@google.com> Support bidi/shaping for getTextPath

Move layout-related code into separate class since it's needed by both
canvas and paint.

Change-Id: Iba89a1d94d7cca650255ffa3cbc952b988a51b54
/frameworks/base/core/jni/android/graphics/Paint.cpp
0c702b88c5d0d4380930b920f5be6e66dd95a0d8 14-May-2010 Doug Felt <dougfelt@google.com> Move shaping to native.

Add internal API (getTextRunAdvances) to Paint, use when measuring.
Add internal API (getTextRunCursor) to Paint, use when determining
valid cursor positions.

Remove java-level shaping code. Remove 'prep' code in TextLine
(except for replacement text) since shaping now is done on the fly as
needed in native.

Provide explicit shaping context bounds to internal text measuring,
cursor movement, and rendering APIs.

Update for to changes in external API in ushape.h.

Change-Id: I146958b624802ce8553125e5c3c6c03031bc9608
/frameworks/base/core/jni/android/graphics/Paint.cpp
afa78967b8553443aa32579d78970a076d7581f6 29-Sep-2009 Dianne Hackborn <hackbod@google.com> Hack to fix issue #2125365: Sports Trivia compatability with Eclair

Adds a mechanism to tell Paint the scaling factor its target
canvas will have, for it to compute font metrics based on the
correct font size. Only TextView uses this, but that is enough
for the large majority of apps.

Change-Id: I6cacaa0dd26d40ee3ad959bed0028678d6e9016e
/frameworks/base/core/jni/android/graphics/Paint.cpp
3d63e0119dc763ed0a06fd7498375746fd391d80 27-Jul-2009 Mike Reed <reed@google.com> explicitly set the hinting level for android apps (to match the old default)
/frameworks/base/core/jni/android/graphics/Paint.cpp
290f5baf9192752287723a29ede4399ae3e4c826 19-Jun-2009 Mike Reed <reed@google.com> when we reset a paint, it should return to the state it was in when it was first created.
for java, this means setting its text-encoding to UTF16...
/frameworks/base/core/jni/android/graphics/Paint.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android/graphics/Paint.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android/graphics/Paint.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/jni/android/graphics/Paint.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android/graphics/Paint.cpp