In some cases bitmap's pixels where freed during encoding, which
caused a null pointer dereference.
This fix makes sure that underlaying buffer is locked for the whole
process of compression.
Change-Id: I0ac56821f5d333072271dc2670fa30f1562adfa3
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
Corrected a small typo where Java InputStream methods are
incorrectly checked when creating a JNI InputStream adaptor.
Change-Id: I5f14897e0d5ddceb4b2af6be46769713f0487624
The mark positioning changes increase the number of bytes needed per
glyph from 6 to 14. This patch compensates by allocating more total
memory for the text layout cache.
Change-Id: I3cf59547394a41779cf6e92e67688b0fdc85f1a3
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
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
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
If an app used a GIF file in the wrong density bucket, the auto-scaling
code would not properly resize the bitmap.
This issue affects third party applications, here is the external bug
report:
http://code.google.com/p/android/issues/detail?id=34619
DO NOT MERGE
Change-Id: I7f99b28ad6e6c28bdbcb29bbbadcb215268ff710
If an app used a GIF file in the wrong density bucket, the auto-scaling
code would not properly resize the bitmap.
Change-Id: I28f6506a94b20d11b3ba53ac442abec2b92e093e
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
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
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
TextLayoutCache was leaking HB_Face objects, not freeing them when
purging the mCachedHBFaces cache. More full analysis is in the bug.
Change-Id: Ie5cd8b00c36b9d31963183c601cde49cbb73fafb
- add missing cached data clearing. The Shaper was caching the HB_Face so
clear them too
- do minor code refactoring
Change-Id: Ifa86cc63815bdb4b51ce688cf16e986415b1e8c1
In one particular error case, we might exit the function without
destroying the bitmap.
Bug: 6467873 (tangentially related)
Change-Id: I3a213cc0a53023d9d0d2a080aed15774f4c4c10c
- bug #5987379 Need an Arabic font with metrics "compatible" with Roboto
- use the Alt version with GSUB optimizations
Change-Id: I4d8c62cab37a7b010abab602c39899084d347fdc
This change avoids selecting the incorrect font for drawing characters
when the first character in a run is a space.
Change-Id: Ibc672560d364b8de8c3e21de1c738c6dc5639395
- 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
Fixed getTextRunAdvances so that advances are correctly aligned with
UTF-16 code point offices, rather than runs being reversed in RTL.
Change-Id: Ife59c0c26f745654c16656c86072e9102d8f6bc7
This change updates the SurfaceTexture API docs and modifies the behavior of
the updateTexImage to produce an IllegalStateException when not attached to a
GLES context.
Change-Id: I5a0875927785108960985c567d571d5f7033256a
This change adds Java API support for detaching a SurfaceTexture from one GLES
context and then attaching it to a different one.
Change-Id: I8eed4b0d0e339c11598cb0408d9f4f2d99b3aa06
- Added a new custom PNG chunk that carries the layout padding ints.
- Extract the padding ticks from .9.png images and store in the chunk.
- Load the padding information at runtime into Bitmap and NinePatchDrawable.
- The new chunk is ordered first so that it doesn't cause a problem in older
versions of the platform.
Bug: 6087201
Change-Id: I5de46167a1d44b3ec21065b0c165e594b1dc8399