History log of /frameworks/base/libs/hwui/font/Font.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2c0f93798b2c435307bfb1dfe194a6203e6e6ee5 28-Mar-2016 John Reck <jreck@google.com> Add a font microbench

Also remove a low-signal high-frequency trace mark

Fixes: 27894187

Change-Id: I090122a0db8e455eaa9dbce2b0f5b6778a218188
/frameworks/base/libs/hwui/font/Font.cpp
e8c3c813b0e3ac98304b17a751ce6e436e252bd9 06-Feb-2016 Chris Craik <ccraik@google.com> Fix TextDropShadowCacheTests and glyph_t everywhere

Change-Id: I943eae4e9408c77bdfba6304ba7ee3e862351a41
/frameworks/base/libs/hwui/font/Font.cpp
a1717271caac5e8ea3808c331d4141ac01a42134 19-Nov-2015 Chris Craik <ccraik@google.com> Initial text support in new reorderer/renderer

Removes obsolete drawPosText codepath, and unifies text decoration behavior.

Change-Id: I9c563249ab688a3394445a0e7fe1b9d0661f6f7c
/frameworks/base/libs/hwui/font/Font.cpp
0fe8ea20962249c257762c81896758a9f7ecf659 03-Oct-2015 Stephen Hines <srhines@google.com> am 697e3dd6: am ee144b1e: resolved conflicts for bd57dac5 to stage-aosp-master

* commit '697e3dd6b9a8be4451e19ab7c03ced310602b92a':
Don't unregister Fonts from renderer at destruction
ee144b1e60a88e8f097113e046813f0b61c38b9b 03-Oct-2015 Stephen Hines <srhines@google.com> resolved conflicts for bd57dac5 to stage-aosp-master

Change-Id: I5107af13712d7cc908d8699e5c15a002f0a3ec85
148c78f825496b75a812d61e7d9222d897870a6c 02-Oct-2015 Chris Craik <ccraik@google.com> Don't unregister Fonts from renderer at destruction

bug:24584749

Fonts are only destroyed when the renderer is destroyed, this prevents
modifying the FontRenderer's LruCache while it's being iterated through
in FontRenderer::~FontRenderer.

Change-Id: I0e2c9f87981bfa50454ec8689df05851839e288e
/frameworks/base/libs/hwui/font/Font.cpp
0e9059b4549b6ada1fa6d4db50217b26d104da95 19-Jun-2015 Leon Scroggins III <scroggo@google.com> Change from SkDeviceProperties to SkSurfaceProps.

Fixes build.

Change-Id: Id6b0f96830761f8b6896169327de90f3b390e3c9
(cherry picked from commit 8ebf97a668e7a53bb9810aa5049a8b28435143d2)
/frameworks/base/libs/hwui/font/Font.cpp
5a4690bf26932c0d6940e4af8516d920e09ae81a 14-Jul-2015 Chris Craik <ccraik@google.com> Clean up unncessary defines

LOG_TAG and TRACE_TAG are already defined in the makefile

Change-Id: I9e53e3dacbe018441edd74cb7c8c90846defee74
/frameworks/base/libs/hwui/font/Font.cpp
de25a672b18171a3d14315b34dc7c8fcf46ae91e 30-Jun-2015 Chris Craik <ccraik@google.com> Saturate alpha values when overlaying glyphs

bug:19062769

Glyphs were stored to the output buffer with the assumption of
non-overlap, which is incorrect for certain fonts/strings. Instead,
blend src into dst, so new glyphs don't clobber existing content.

Change-Id: I6e22037500e67d5348ee2a43d939416c23c4d1ea
/frameworks/base/libs/hwui/font/Font.cpp
d41c4d8c732095ae99c955b6b82f7306633004b1 06-Jan-2015 Chris Craik <ccraik@google.com> Add overrides and switch to nullptr keyword for all files

Adds remaining missing overrides and nullptr usages, missed due to
an extreme failure in tool usage.

Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
/frameworks/base/libs/hwui/font/Font.cpp
f088c349dfea985e561d7e838ecd41be5168cd4a 12-Dec-2014 John Reck <jreck@google.com> Fix style

Change-Id: I7227b0eac126bf470ed50249a7809b845872983b
/frameworks/base/libs/hwui/font/Font.cpp
64bb413a664001c95c8439cf097dc3033f4ed733 22-Nov-2014 Andreas Gampe <agampe@google.com> Revert "resolved conflicts for merge of 220c3f4f to master"

Reverted as hwui doesn't agree.

This reverts commit 8a902d9f24e83c87b054adb5836b4a5b8a257be9.

Change-Id: I109e7b02bee2921e2155ded6df36f52e6f574b5a
/frameworks/base/libs/hwui/font/Font.cpp
8a902d9f24e83c87b054adb5836b4a5b8a257be9 22-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 220c3f4f to master

Change-Id: I37ecce8fddecdff82b0eace16f1ee75152f7171e
2ab8298dc37851aab4623ba3f98d71055d653a73 21-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 99377df1 to lmp-mr1-dev-plus-aosp

Change-Id: I3a98f55832ac447b1ed0dd129c7a93d088025943
42ddc18d108f789705ad4eb697ce9599ad322507 21-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Unused parameters in hwui

Remove Clang cutout for unused parameters. Fix warnings.

Remove Clang cutout for deprecated Skia function usage. Has been
fixed in the L push.

Change-Id: I7ea073ff67127cc1e14e798b655e2c50615fe8e7
/frameworks/base/libs/hwui/font/Font.cpp
06e7fe5a70409d2050b2b3e1286500f5223099da 21-Nov-2014 Chris Craik <ccraik@google.com> resolve merge conflicts of f2235b6 to master.

Change-Id: Ibcef3a37ca0749931d509b53bd52e53a7d30ddbb
f2235b6a48db2e16b52711570bf2a0d0cb0b0d90 21-Nov-2014 Chris Craik <ccraik@google.com> resolve merge conflicts of 57b641a to lmp-mr1-dev-plus-aosp.

Change-Id: I1be708f5a0cd4d64021a57f1063d54330f1d2d7e
70850ea258cbf91477efa57a1f1a23cc0044cc93 18-Nov-2014 Chris Craik <ccraik@google.com> Improve logging around performance critical events

bug:17702227

Add details useful to developers (such as layer size/View name), and
switch away from logging implementation names/details, since they
are generally not relevant to developers.

Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
/frameworks/base/libs/hwui/font/Font.cpp
edaecc1db0584fa017822dfc2da0c968b53967e6 11-Nov-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aosp

(cherry picked from commit 1272887050a269d6d506b42099c2857847ad100b)

Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
/frameworks/base/libs/hwui/font/Font.cpp
1e19674107e1aa2224c2b8c7d12bfa057efe80ea 11-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Wall Werror in libs/hwui

Turn on -Wall -Werror in libs/hwui. Fix errors.

Change-Id: I74962d08c889712dacbd0d86d6760fc10802b6bd
/frameworks/base/libs/hwui/font/Font.cpp
413995e0be970a39cc03580e3efb302e17425b4b 13-Oct-2014 Derek Sollenberger <djsollen@google.com> Change in Skia APIs require update to HWUI font implementation

Change-Id: Ib89a27381f740499e26706716f39ad62fa10778c
/frameworks/base/libs/hwui/font/Font.cpp
39c5e7cbdfdc0c74eb5746467d9975dbaba3da61 16-Aug-2014 Chris Craik <ccraik@google.com> Fix glyph positions underflow issue

bug:16450675

Avoid using unsigned ints in math with negative numbers

Change-Id: Icdfb72451f03380dbf78b3703793869b2cd4e751
/frameworks/base/libs/hwui/font/Font.cpp
59744b79ec302000802cd56d30a1bf70f0183c80 02-Jul-2014 Chris Craik <ccraik@google.com> Add hack for custom re-rasterization buckets

bug:14083128

Moves all of the font transform management into
OpenGLRenderer::findBestFontTransform(), and now simply passes down
final rasterization transforms into the FontRenderer.

Change-Id: Ie02752e6af863347b142367c7d628db5f9fc2998
/frameworks/base/libs/hwui/font/Font.cpp
50b843883d6906b74ba14ddde285ee8716a23782 19-May-2014 Chris Craik <ccraik@android.com> am 3c769ec0: am 00fabcbe: am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"

* commit '3c769ec02b8b82bec4dec2169bf76af58be94a9a':
Use alpha channel instead of red in drawCachedGlyphBitmap
3c769ec02b8b82bec4dec2169bf76af58be94a9a 19-May-2014 Chris Craik <ccraik@android.com> am 00fabcbe: am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"

* commit '00fabcbeb035fb513293ea01d245002f40b3234f':
Use alpha channel instead of red in drawCachedGlyphBitmap
00fabcbeb035fb513293ea01d245002f40b3234f 19-May-2014 Chris Craik <ccraik@android.com> am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"

* commit 'b1708e9b764268a06d91219a5c39ee9efd32ab00':
Use alpha channel instead of red in drawCachedGlyphBitmap
c62c1cc17ded117433d23ba5dd6c364b05fbcdbd 12-May-2014 Digish Pandya <digishp@codeaurora.org> Use alpha channel instead of red in drawCachedGlyphBitmap

the correct value to copy in bitmap is alpha component from
the cachebuffer. currently it is offset to red channel if format is
RGBA which is wrong.

this is followup fix for https://android-review.googlesource.com/#/c/93943/

Change-Id: I96b5ba35df5ccaef44caf2542d35d6585ba1df80
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
/frameworks/base/libs/hwui/font/Font.cpp
f9075798d7de2c23f67987d55ac1e4412de8265f 10-May-2014 Chris Craik <ccraik@android.com> am 90eaf92e: am 7e13d1d4: am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"

* commit '90eaf92e325457ccb30286879a2f92b7ba517c7d':
Correct stride for drawing to cached glyph bitmap
90eaf92e325457ccb30286879a2f92b7ba517c7d 09-May-2014 Chris Craik <ccraik@android.com> am 7e13d1d4: am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"

* commit '7e13d1d4a46a01ebaa412d622ef76d90bd39d12a':
Correct stride for drawing to cached glyph bitmap
7e13d1d4a46a01ebaa412d622ef76d90bd39d12a 09-May-2014 Chris Craik <ccraik@android.com> am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"

* commit 'f6c9c4204c2f8f86277d081112c9dd863ddaa778':
Correct stride for drawing to cached glyph bitmap
b9312a54e49f2f0e35bf65f91d796eeb3a6084bc 09-May-2014 Digish Pandya <digishp@codeaurora.org> Correct stride for drawing to cached glyph bitmap

fixes the glyph cachebuffer index to account for pixelbuffer
format size.

issue: in launcher home screen create icon group and rename the
group to some text string with emo-icons (smilies). without this
change the drop shadows for emo-icons will look bad.

Change-Id: I525a9219d35f4541363fd64e7fc5fd1053269725
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
/frameworks/base/libs/hwui/font/Font.cpp
2c423b22b42269c0652dff4155707cec823fbfc1 23-Apr-2014 Victoria Lease <violets@google.com> am df64ac68: ask skia to use flat gamma when rendering fonts from hwui

* commit 'df64ac688d400c74438db091952d236fffd5f778':
ask skia to use flat gamma when rendering fonts from hwui
df64ac688d400c74438db091952d236fffd5f778 23-Apr-2014 Victoria Lease <violets@google.com> ask skia to use flat gamma when rendering fonts from hwui

Bug: 13748392
Change-Id: I6930629b8e900628f15354f663b86dfb29a4db78
(cherry picked from commit b66270eac288de53207e55d10879b070a0ec8b6b)
/frameworks/base/libs/hwui/font/Font.cpp
b66270eac288de53207e55d10879b070a0ec8b6b 23-Apr-2014 Victoria Lease <violets@google.com> ask skia to use flat gamma when rendering fonts from hwui

Bug: 13748392
Change-Id: I6930629b8e900628f15354f663b86dfb29a4db78
/frameworks/base/libs/hwui/font/Font.cpp
96978ee290ea0ef666c49ffa8733a8c74304c9f1 17-Mar-2014 Leon Scroggins III <scroggo@google.com> am f8d8777d: Update framework to use M33 Skia. DO NOT MERGE

* commit 'f8d8777dddf91c741981b4f795f2fb2b1d81c1b6':
Update framework to use M33 Skia. DO NOT MERGE
f8d8777dddf91c741981b4f795f2fb2b1d81c1b6 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33

Conflicts:
core/jni/android/graphics/Bitmap.cpp
core/jni/android/graphics/Graphics.cpp
core/jni/android/graphics/Typeface.cpp
graphics/java/android/graphics/Bitmap.java
/frameworks/base/libs/hwui/font/Font.cpp
42ae4cf2ce5ba02c2211813452badc07eab33735 07-Mar-2014 Leon Scroggins III <scroggo@google.com> Merge "resolved conflicts for merge of 8d3281f5 to klp-dev-plus-aosp" into klp-dev-plus-aosp
5e49b497ae2019586937aae0e8159292363728b5 03-Dec-2013 Leon Scroggins III <scroggo@google.com> Update framework to use M33 Skia. DO NOT MERGE

(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
the length (read(NULL, 0)) is no longer implemented, since it is
no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Ie2b731a9f0795802418cfecddb4b684c92c64d33
/frameworks/base/libs/hwui/font/Font.cpp
ba9a21561e09bddf4ba25fd41474fda6cb941bfb 05-Feb-2014 Chris Craik <ccraik@android.com> am 2c764b20: am 0ec3ca6e: am 449273e2: Merge "Fix for positioning of glyphs within a bitmap"

* commit '2c764b20e4a35c509f49e3d9430e135b4f3a0984':
Fix for positioning of glyphs within a bitmap
3ed192760314dc976cd02f62ac49798daa89b4b1 28-Aug-2013 Alexander Toresson <alexander.toresson@sonymobile.com> Fix for positioning of glyphs within a bitmap

For positioning of glyphs within a bitmap, roundf(int + float) is used,
where the float is the glyph position and the int is the text position.
When the text position is varied, this may lead to the sum being rounded
in different directions, due to floating point rounding, caused by that
floating point numbers have different precision in different ranges.

This may therefore lead to slightly different positioning for glyphs and
therefore slightly different widths and heights for text strings,
depending on the position they are rendered at.

The solution in this patch is to use int + (int) roundf(float), which
has consistent rounding, and also enables us to use the full range of
ints.

Change-Id: Id1143cdfcbdfa9915ced878ae04df589a3e03cee
/frameworks/base/libs/hwui/font/Font.cpp
d218a92c0afb8c0d98135b20b52ac87236e1c935 03-Jan-2014 Chris Craik <ccraik@google.com> Use const where possible for drawing parameters

They should never be modified by a Renderer, only read and copied.

Change-Id: I9d8d55dca19115ee9dfeb2bb3f092ba2fb327cd4
/frameworks/base/libs/hwui/font/Font.cpp
2ee2d59b7d10733e7e11e398d2316035d3b36c73 17-Dec-2013 Victoria Lease <violets@google.com> pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
Change-Id: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89
/frameworks/base/libs/hwui/font/Font.cpp
43b692d9a18224e89fc09a0e68d097322e0ef6bb 04-Dec-2013 Victoria Lease <violets@google.com> Deprecate Android-specific SkPaint functions.

The following functions were problematic:
const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
Change-Id: Id746315d41aec5b211b78b172a883c2061130f08
/frameworks/base/libs/hwui/font/Font.cpp
2d5945e88731787babce1061f44cd54f02eeefc5 18-Jun-2013 Romain Guy <romainguy@google.com> Take hinting into account when caching fonts
Bug #9464403

Change-Id: I26a5f0c17eb27d096717b444d3e18ad1d2b5a43c
/frameworks/base/libs/hwui/font/Font.cpp
cf51a4199835e9604aa4c8b3854306f8fbabbf33 09-Apr-2013 Romain Guy <romainguy@google.com> Introduce PixelBuffer API to enable PBOs

PBOs (Pixel Buffer Objects) can be used on OpenGL ES 3.0 to perform
asynchronous texture uploads to free up the CPU. This change does not
enable the use of PBOs unless a specific property is set (Adreno drivers
have issues with PBOs at the moment, Mali drivers work just fine.)

This change also cleans up Font/FontRenderer a little bit and improves
performance of drop shadows generations by using memcpy() instead of
a manual byte-by-byte copy.

On GL ES 2.0 devices, or when PBOs are disabled, a PixelBuffer instance
behaves like a simple byte array. The extra APIs introduced for PBOs
(map/unmap and bind/unbind) are pretty much no-ops for CPU pixel
buffers and won't introduce any significant overhead.

This change also fixes a bug with text drop shadows: if the drop
shadow is larger than the max texture size, the renderer would leave
the GL context in a bad state and generate 0x501 errors. This change
simply skips drop shadows if they are too large.

Change-Id: I2700aadb0c6093431dc5dee3d587d689190c4e23
/frameworks/base/libs/hwui/font/Font.cpp
bd3055f95e67a55648fd84a125e939293115171b 14-Mar-2013 Romain Guy <romainguy@google.com> Less aggressive glyphs precaching

The renderer used to pre-cache glyphs at record time. This then changed
to pre-caching at the beginning of every frame. This unfortunately entails
a lot of duplicate work on every frame, which amounts to 0.5 to 1ms in
some stock applications.

This change is somewhere in the middle: pre-caching happens the first
time a DrawTextOp is deferred or every time the screen-space transform
is different from the last pre-caching operation.

Change-Id: Id6d9e2599d90a5b75010b0f0a28746befbf3c205
/frameworks/base/libs/hwui/font/Font.cpp
8afce816df7e8f668761f7ed443f54238958c49f 07-Mar-2013 Romain Guy <romainguy@google.com> Round scale factors to rasterize text

Harder, better, faster, stronger.

Change-Id: Iee4125de98c4e61603f56bb7f06002cc86458214
/frameworks/base/libs/hwui/font/Font.cpp
624234f69b2a4781d24f3e4c6ae6450729e38397 06-Mar-2013 Romain Guy <romainguy@google.com> Take only the scale params into account to rasterize text

This change extracts the scale parameters of the current transform
to pass then to the font renderer. Rotation and perspective are
applied to the generated mesh inside the vertex shader. This limits
the number of glyphs we have to create in the font cache and thus
reduces memory churn.

Change-Id: Ic5b3bae2b2b0e0250a8ee723b071a1709725c749
/frameworks/base/libs/hwui/font/Font.cpp
874f5c6e4ac655b4f118074c90d51e6a44abe50c 02-Mar-2013 Romain Guy <romainguy@google.com> Fix math issue when transforming text in perspective

Change-Id: Iad6b4e477c11bd1ef5f0ceab2fabcd440030154d
/frameworks/base/libs/hwui/font/Font.cpp
0f6675332c04c74909425d1d328f02b32c0ff40e 01-Mar-2013 Romain Guy <romainguy@google.com> Precache glyphs at final raster size

The deferred display lists model now allows us to precache glyphs
at their exact size on screen.

This change also removes debug markers when the renderer defers
and reorders display lists. It also adds a flush event marker.

Change-Id: I66ec5216dc12b93ecfdad52a7146b1cfb31fbeb4
/frameworks/base/libs/hwui/font/Font.cpp
a4adcf0239039eb8f005be252409901c41b28839 28-Feb-2013 Romain Guy <romainguy@google.com> Support 3D rotations when drawing text

If a perspective transform is set on the Canvas, drawText() should
not attempt to rasterize glyphs in screen space. This change uses
the old behavior instead (i.e. rasterize the glyphs at the native
font size and apply the transform on the resulting mesh.)

This change also adds an optimization: empty glyphs (spaces) do
not generate vertices anymore. This saves a lot of vertices in text
heavy applications such as Gmail.

Change-Id: Ib531384163f5165b5785501612a7b1474f3ff599
/frameworks/base/libs/hwui/font/Font.cpp
c74f45a334f0e3725c23cdd270cbcb0efac4ea75 27-Feb-2013 Romain Guy <romainguy@google.com> Properly scale text

This change does not apply to drawPosText() and drawTextOnPath() yet.

Prior to this change, glyphs were always rasterized based on the
font size specified in the paint. All transforms were then applied
on the resulting texture. This creates rather ugly results when
text is scaled and/or rotated.

With this change, the font renderer will apply the current transform
matrix to the glyph before they are rasterized. This generates much
better looking results.

Change-Id: I0141b6ff18db35e1213e7a3ab9db1ecaf03d7a9c
/frameworks/base/libs/hwui/font/Font.cpp
e67307c816f3fdae2bfba8e9a4410dc015645e91 12-Feb-2013 Romain Guy <romainguy@google.com> Prevent crash when setting up a stencil-based clip
Bug #8177690

Clear the layers before we setup the stencil to avoid dereferencing
the recently deleted rects.

Change-Id: I5dce5f965672f276f9490636d85b6018d3ab9422
/frameworks/base/libs/hwui/font/Font.cpp
23e500d168e8d649305445f6c1d2b49d8d2c00fd 06-Feb-2013 Derek Sollenberger <djsollen@google.com> Merge "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'"
b969a0de65730b071d846f8302e751e2637e6dbe 05-Feb-2013 Romain Guy <romainguy@google.com> Add support for non-antialiased text

Change-Id: I17c073955ab94abc9b409e5fcfbc675faa07c5ba
/frameworks/base/libs/hwui/font/Font.cpp
14c40b47565778b7185de7655836485f3065877a 09-Jan-2013 Romain Guy <romainguy@google.com> Fix build

Change-Id: Ia465bd844b592fc05e59ad392ecc5ca4d34d24d7
/frameworks/base/libs/hwui/font/Font.cpp
e3a9b24b5e3f9b2058486814a6d27729e51ad466 08-Jan-2013 Romain Guy <romainguy@google.com> Add plumbing for better text scaling

Fonts are now described by a transform matrix. This lead to switching
from a vector to a hashmap. This change therefore adds new comparators
and hash computations to Font.

Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
/frameworks/base/libs/hwui/font/Font.cpp
a3dc55f83ab583e0a66b893c71b849afa046770a 28-Sep-2012 Romain Guy <romainguy@google.com> Fix a couple of rendering issues
Bug #7253839

1. Make sure we don't make GL calls while recording display lists

2. Disable an early and trivial clip optimization in font renderer
when a perspective transformation is used on the Canvas

Change-Id: I3f1052164239329346854f72d0a0d401fbfecf06
/frameworks/base/libs/hwui/font/Font.cpp
521dc51fd411285f900c083a4fe560d2ed7c3f8a 05-Sep-2012 Romain Guy <romainguy@google.com> Don't invalidate all the glyphs when flushing large textures

FontRenderer::flushLargeCaches identifies the large textures used to
cache glyphs and visits all the known fonts to mark their glyphs
invalid if they belong to one of these large textures.

Unfortunately, Font::invalidateTextureCache had a logic error
which would make it mark *all glyphs* as invalid, not matter
what texture they belong to. This means that any large cache
flush would cause all glyphs to be invalidate, thus forcing
the rendering system to recreate them on the next draw.

Font::invalidateTextureCache is supposed to behave this way:
- If the specified cacheTexture is NULL (default value), mark
all glyphs as invalid (see FontRenderer::flushAllAndInvalidate())
- If cacheTexture is *not* NULL, invalidate only the glyphs for
which glyph.cacheTexture == cacheTexture.

The previous condition read:

if (cacheTexture || glyph.cacheTexture == cacheTexture)

This test *always* passes.

Change-Id: I418886cb594c81c6178d0f9e9953d975e991cf22
/frameworks/base/libs/hwui/font/Font.cpp
8087246d9964b11de8ce116bc63b156faa4197e0 05-Sep-2012 Romain Guy <romainguy@google.com> Code cleanup in FontRenderer

Change-Id: Ic788721c224a77f0a76f4cd6d9817b62e390a5a7
/frameworks/base/libs/hwui/font/Font.cpp
9b1204baf4740b4d443e72157dea98571cf84e1f 05-Sep-2012 Romain Guy <romainguy@google.com> Small code cleanup in FontRenderer

Change-Id: I09c00debe9b0b4f45b232cae402ed19bdaeabfe4
/frameworks/base/libs/hwui/font/Font.cpp
9f5dab3fc228fa11c32b483e6101ec086895a32b 04-Sep-2012 Romain Guy <romainguy@google.com> Refactor FontRenderer.cpp

FontRenderer.h defined several classes and structures that now live
in the font/ folder. This will make the code easier to read and
maintain.

Change-Id: I3dc044e9bde1d6515f8704f5c72462877d279fe2
/frameworks/base/libs/hwui/font/Font.cpp