401 Commits

Author SHA1 Message Date
Jean-Baptiste Queru
38f197863a am 14c0c989: am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"
* commit '14c0c989d21531056a5d0a0739c3ffdd1b04b295':
  Fix SkBitmap::fPixels not being locked correctly
2012-08-29 12:00:10 -07:00
Jean-Baptiste Queru
14c0c989d2 am 4ba4caed: Merge "Fix SkBitmap::fPixels not being locked correctly"
* commit '4ba4caede125ff602b0d93f577f9054a07791ff7':
  Fix SkBitmap::fPixels not being locked correctly
2012-08-29 11:55:20 -07:00
Michal Stawinski
35ef567140 Fix SkBitmap::fPixels not being locked correctly
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
2012-08-29 15:54:01 +02:00
Billy Hewlett
ac1cbaf2e5 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
2012-08-20 08:51:23 -07:00
Romain Guy
42e1e0d482 Improve gradients
Avoid using textures for common gradients (two stops from 0.0 to 1.0)

Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
2012-07-31 18:55:16 -07:00
Romain Guy
a0aa479c0e am 97e27072: am dfac68ea: Merge "Corrected typo when checking InputStream methods"
* commit '97e270721bf29d25b513c1f2be71a8543d048f5d':
  Corrected typo when checking InputStream methods
2012-07-27 15:54:30 -07:00
Romain Guy
97e270721b am dfac68ea: Merge "Corrected typo when checking InputStream methods"
* commit 'dfac68eacc60c130e54345d98bd45c99573cb627':
  Corrected typo when checking InputStream methods
2012-07-27 15:49:23 -07:00
Edward Savage-Jones
8ac41bb79e Corrected typo when checking InputStream methods
Corrected a small typo where Java InputStream methods are
incorrectly checked when creating a JNI InputStream adaptor.

Change-Id: I5f14897e0d5ddceb4b2af6be46769713f0487624
2012-07-27 15:14:24 +02:00
Raph Levien
161ebab85d Increase text layout cache size in bytes
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
2012-07-18 16:16:41 -07:00
Raph Levien
4f3c8f7026 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
2012-07-18 15:40:44 -07:00
Raph Levien
2301d32f7e 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
2012-07-17 18:11:28 -07:00
Victoria Lease
cae28fa051 Merge "Remove hardcoded typeface pointers" 2012-07-11 12:49:12 -07:00
Billy Hewlett
d6deccb346 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
2012-07-11 08:55:59 -07:00
Romain Guy
907524851a Properly resize paletted bitmaps when adjusting for density
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
2012-07-10 13:16:46 -07:00
Romain Guy
053a82cc18 Properly resize paletted bitmaps when adjusting for density
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
2012-07-10 12:02:33 -07:00
Raph Levien
f62034d896 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
2012-06-26 08:59:17 -07:00
Raph Levien
6212a4f2ed 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
2012-06-25 14:29:52 -07:00
Billy Hewlett
960511848a Revert "Revert "Use Elegant fonts for Webkit, Compact fonts for Textview""
This reverts commit 6fadccd2484233ed570218b3f97c085ef1a1ec28
2012-06-21 09:58:42 -07:00
Billy Hewlett
6fadccd248 Revert "Use Elegant fonts for Webkit, Compact fonts for Textview"
This reverts commit ecf80965d05e44b3701b3392aeb02028daacf1b0
2012-06-21 09:45:30 -07:00
Billy Hewlett
ecf80965d0 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
2012-06-20 09:07:09 -07:00
Victoria Lease
29b9885c25 Merge "Fix hardcoded font path. Allow adding new font path thru Skia changes. Bug: 6609231" 2012-06-07 08:33:15 -07:00
Billy Hewlett
517f67fe4b Fix hardcoded font path. Allow adding new font path thru Skia changes.
Bug: 6609231

Change-Id: I7b28c6f7ac1c227c7059b486635cadb39a6eacc3
2012-06-04 17:15:46 -07:00
Raph Levien
75394d6d1b 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
2012-06-02 15:47:29 -07:00
Owen Lin
f970c2e6de Nvidia's patch for reusing bitmap in image region decoding.
bug: 5884845
Change-Id: I43d4d86ee94591b0b53393dfba13c7cc5c4e428d
2012-05-17 12:48:02 -07:00
Fabrice Di Meglio
15cc68ced0 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
2012-05-15 14:55:49 -07:00
Jeff Brown
8bd8d89693 Merge "Fix possible leak in bitmap decoding." into jb-dev 2012-05-09 17:42:40 -07:00
Jeff Brown
27d8383414 Fix possible leak in bitmap decoding.
In one particular error case, we might exit the function without
destroying the bitmap.

Bug: 6467873 (tangentially related)
Change-Id: I3a213cc0a53023d9d0d2a080aed15774f4c4c10c
2012-05-09 17:30:31 -07:00
Fabrice Di Meglio
92d7f9ff1c Merge "Fix bug #6408393 Character corruption is caused when locale is changed" into jb-dev 2012-05-08 10:54:41 -07:00
Fabrice Di Meglio
30ca5cd11a 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
2012-05-07 20:17:38 -07:00
Fabrice Di Meglio
6162876067 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
2012-05-07 14:42:56 -07:00
Marco Nelissen
b3482ffbee Merge "Fix crash when decoding bitmap" into jb-dev 2012-05-07 12:09:02 -07:00
Marco Nelissen
b2fe3be4ff Fix crash when decoding bitmap
Externally reported crash when decoding corrupted .wmf file.
b/5048623

Change-Id: I1df0861cd36983cb4d1460caa221c54d3fc240af
2012-05-07 11:24:13 -07:00
Fabrice Di Meglio
cf4284bce1 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
2012-05-04 15:14:58 -07:00
Raph Levien
1637dcd16c Use paint typeface for shaping when it supports the requested script.
This is a hackish but workable fix for bug 6415796.

Change-Id: Iaba91e1e53e688a3ee05a1fdb68fd05102e369f2
2012-05-02 12:00:12 -07:00
Raph Levien
b294435b5c 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
2012-05-01 13:49:18 -07:00
Dianne Hackborn
7634424171 Fix scaling of layout bounds.
Change-Id: I9d8c8924900fed69030ee3e8d6decee89ca67820
2012-04-30 14:51:48 -07:00
Romain Guy
8f8d9fb52c Keep opaque bitmaps opaque after scaling
Bug #6293845

Change-Id: If9e82993f4c9702244ddedb5667421a6fcc7a0c5
2012-04-26 13:35:36 -07:00
Raph Levien
66556c730d Merge "Improve char mirroring in TextLayoutCache" 2012-04-24 22:38:15 -07:00
Fabrice Di Meglio
3632b7f3ef 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
2012-04-24 19:57:23 -07:00
Raph Levien
57e9723134 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
2012-04-24 16:04:34 -07:00
Jamie Gennis
721bfaa63d SurfaceTexture: fix updateTexImage JNI
Sigh...

Change-Id: I0271bed44c58e0c9a03eda4886eb2c1ee76e041f
2012-04-13 19:14:37 -07:00
Jamie Gennis
2b4bfa5efe SurfaceTexture: update API docs
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
2012-04-13 16:04:15 -07:00
Fabrice Di Meglio
62901af52a Merge "Add Paint.setTextLocale()" 2012-04-12 17:37:44 -07:00
Fabrice Di Meglio
517825f1a9 Add Paint.setTextLocale()
- will be used for better shaping CJK and other goodies

Change-Id: If64945a337edd915f5ebb88f04b6fd18e92ca587
2012-04-12 17:31:17 -07:00
Fabrice Di Meglio
276de3e1eb Add new Arabic font for SystemUI
- still work in progress
- bug #5987379

Change-Id: I0a7f7437c9061eab0abc9d5979c947eb5511992a
2012-04-12 16:40:56 -07:00
Jamie Gennis
c6d9930777 SurfaceTexture: add GL context attach & detach
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
2012-04-05 16:11:43 -07:00
Amith Yamasani
ec4a50428d Embed layout padding in nine patch images
- 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
2012-04-04 12:05:59 -07:00
Fabrice Di Meglio
43e4985abf Fix bug #6248364 Tamil and Denavagari text crash in Google+
- fix initialization of variables

Change-Id: Ibda4e1e6f55f867385eaf9a4c7a754c16815bbf0
2012-03-28 16:05:36 -07:00
Romain Guy
7b2f8b8fb7 Pre-scale bitmaps on the native heap
Change-Id: I9819b532b89a997ab775b31ffee46445f1d16e20
2012-03-19 18:47:06 -07:00
Romain Guy
caf813fe1e Remove unused private API
Change-Id: Iec9c2bc275fc7376f4e0b0b9c44059c56a9dd173
2012-03-15 18:57:48 -07:00