4625 Commits

Author SHA1 Message Date
Romain Guy
6c8c6d9d44 Merge "Correctly check the height of a glyph prior to caching it" into jb-mr1-dev 2012-09-04 19:01:48 -07:00
Romain Guy
e43f785b7f Correctly check the height of a glyph prior to caching it
Change-Id: Iaf3977afc20fcde65bfda7b9e092b3e723241684
2012-09-04 18:58:46 -07:00
Chris Craik
d84aaa23a5 Merge "Fix line drawing path to use proportional distance from center" into jb-mr1-dev 2012-09-04 16:56:16 -07:00
Romain Guy
c83f982804 Merge "Code cleanup in FontRenderer" into jb-mr1-dev 2012-09-04 16:46:20 -07:00
Romain Guy
8087246d99 Code cleanup in FontRenderer
Change-Id: Ic788721c224a77f0a76f4cd6d9817b62e390a5a7
2012-09-04 16:44:17 -07:00
Romain Guy
2ecaedd96c Merge "Small code cleanup in FontRenderer" into jb-mr1-dev 2012-09-04 15:26:14 -07:00
Romain Guy
9b1204baf4 Small code cleanup in FontRenderer
Change-Id: I09c00debe9b0b4f45b232cae402ed19bdaeabfe4
2012-09-04 15:25:30 -07:00
Romain Guy
85399cc606 Merge "Refactor FontRenderer.cpp" into jb-mr1-dev 2012-09-04 15:05:28 -07:00
Fabrice Di Meglio
035ce2ca92 Merge "Add support for "-rtl" in resources" into jb-mr1-dev 2012-09-04 15:01:03 -07:00
Chris Craik
8f5ad7657b Fix line drawing path to use proportional distance from center
boundaryWidth and boundaryLength are now distance from center, instead of
distance from edge, in order to avoid unnecessary calculation in the shader. New
calculation of these matches drawAARect.

Change-Id: I1c7f576a97a6f0ce00d521661fd56fb62e05e6f2
2012-09-04 14:35:19 -07:00
Romain Guy
9f5dab3fc2 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
2012-09-04 12:55:44 -07:00
Romain Guy
0baaac5e9a Revert "Revert "Add more support for transformed clip rects and paths""
This reverts commit a8557d2169e14997637f57bc897640c8882d4a46.

Change-Id: I36d4883d548fc47ba6c0b4a42012107d0d2f85a6
2012-08-31 20:31:32 -07:00
Mathias Agopian
a8557d2169 Revert "Add more support for transformed clip rects and paths"
this introduced a dead lock in GradientCache's ctor.

This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036.

Bug: 7096001
Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
2012-08-31 20:04:18 -07:00
Romain Guy
703bd32647 Merge "Add more support for transformed clip rects and paths" into jb-mr1-dev 2012-08-31 17:18:04 -07:00
Romain Guy
dfe082f63e Add more support for transformed clip rects and paths
Change-Id: I41791b1e1bffef77d503dc9e52428395d2309688
2012-08-31 17:17:40 -07:00
Chet Haase
eb32a49919 Paramaterize and adjust the glyph cache sizes
Add new parameters for the texture size used for the larger, fallback caches.
Bump up the defaults in some situations.

Issue #7045164 Adjust cache sizes for manta

Change-Id: I562118ce785d7f8b6e445178878672e9709d25f2
2012-08-31 14:18:46 -07:00
Chet Haase
c0c1c94e2d Merge "Avoid thrashing the glyph cache during the precache phase" into jb-mr1-dev 2012-08-30 09:29:37 -07:00
Chet Haase
f942cf10e0 Avoid thrashing the glyph cache during the precache phase
It is unlikely, but possible, to draw so many glyphs in a frame
(especially of the glyphs are quite large) that the cache starts flushing
itself to fit the later glyphs in. This causes unnecessary thrashing, because
when we actually draw the frame, we will again need to flush to fit the
earlier glyphs in, and then flush again to fit the later ones in.

It is better to avoid thrashing the cache at the precache phase, and wait
until we actually draw the glyphs that do not fit to do any eviction of
the earlier glyphs.

This change simply notes when we are in the preaching phase, and avoids flushing
the cache when a glyph does not fit.

Issue #7081725 avoid thrashing cache during DisplayList recording

Change-Id: I230410ab5b478091b1032fa99dc1752acf868bbe
2012-08-30 09:14:44 -07:00
Chet Haase
63f2fcae3e Merge "Fix bug with Fbo layer clipping" into jb-mr1-dev 2012-08-30 07:22:37 -07:00
Romain Guy
7808581ca3 Merge "Pre-multiply color components for 2-stop gradients Bug #7033344" into jb-mr1-dev 2012-08-29 21:56:44 -07:00
Romain Guy
d679b57ef2 Pre-multiply color components for 2-stop gradients
Bug #7033344

Change-Id: Ia168501f1dc56ba7a1bb0c55078320432309a66a
2012-08-29 21:56:18 -07:00
Chet Haase
d48885a6c8 Fix bug with Fbo layer clipping
Rendering views with alpha causes the creation of Fbo layers. These layers
are created at the size of the view, clipped by the current clip rect.
However, if the view lies completely outside the current clip rect, the
Fbo layer is created at the full size of the view and copied into place
outside of its container, causing artifacts like notification items showing
up outside the notification panel.

Fix is to note when the intersect() operation fails and to set an empty bounds
on the layer.

Issue #7069881 Bottom notification sometimes shows below bottom of notification panel shade

Change-Id: Ib52f7c4e503bbe9204cb808755ab269195aa94c1
2012-08-29 17:41:49 -07:00
Chris Craik
a798b95a9e Use smoothstep to eliminate branches in AA shader
Change-Id: If4ecb1a9446f29b2f8444f5cee551f863c1993e8
2012-08-29 11:14:52 -07:00
Fabrice Di Meglio
5f79799939 Add support for "-rtl" in resources
- fix bug #7035019 Need to have "-rtl" support for Resource

Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
2012-08-23 14:55:33 -07:00
Chet Haase
5a3ec7113c Fix glyph cropping bug
Glyphs were being stored in the glyph cache incorrectly.
The second row of glyphs in any column were being positioned exactly
one pixel too high, causing the preceding glyph in that column to be
cropped, resulting in the reported truncation in some glyphs.

Issue #7003215 Minor UI truncation while reading the mails

Change-Id: I47ce376f78a04d4e07e8b7ed1b3f0b58864c5498
2012-08-17 16:03:27 -07:00
Chet Haase
378e919ccb Remove CacheTextureLine structure from FontRenderer
CacheTextureLine was useful before we were packing the glyph
textures; it allowed simple packing of any particular texture according to
how many lines there were in a texture, and how tall those lines were.
Now that we are packing more efficiently (both horizontally and vertically
in any given texture line), it is more efficient to have
open space in every texture, removing the need for CacheTextureLine (which
now gets in the way since it limits how much can be stored in each line).

This change removes CacheTextureLine and just uses CacheTexture directly,
allowing caching of glyphs anywhere in the open space of each texture. As before,
the packing of these glyphs is determined by the CacheBlock structure, which
is a linked list of open spaces in each CacheTexture.

Change-Id: Id6f628170df0f676f8743ac7de76f2377fc6a012
2012-08-16 09:11:49 -07:00
Chet Haase
6b7d46b78c Merge "Restore scissor state correctly" into jb-mr1-dev 2012-08-15 14:40:36 -07:00
Chet Haase
2efd5c5886 Glyph cache optimization
Precaching at startup was not working. One-liner fix to init the caches
so that precaching would kick in earlier, saving time at startup by avoiding
the multiple-upload issue of caching at render time.

Issue #6893691 long app launch time on manta for some apps comparing to nakasi/stingray

Change-Id: Ie5c7f0536ec8ea371c7892e5e09c1db14795531c
2012-08-15 14:19:20 -07:00
Chet Haase
8025061c59 Restore scissor state correctly
Chrome is disabling the scissor, which doesn't play well with our
code that assumes that we know the state of the scissor. This fix
sets up our internal state based on the actual state of the scissor
in the resume() function (which is called after any calls out to the
Chrome or Browser GL functor). This fixes intermittent rendering
artifacts, including a gray address bar (where the gray background
gets painted without the clip that is being applied to the text foreground).

Issue #6886339 Address bar in Chrome turns gray after swiping the tabs / favicons drift outside of tab

Change-Id: I3d8a23f4438b41a367336507845baaea90cccc7e
2012-08-15 13:49:42 -07:00
Chet Haase
e816baea65 Optimize interactions with glyph cache
There are two fixes here:
- precaching: instead of caching-then-drawing whenever there is a new
glyph, we cache at DisplayList record time. Then when we finally draw that
DisplayList, we just upload the affected texture(s) once, instead of once
per change. This is a huge savings in upload time, especially when there are
larger glyphs being used by the app.
- packing: Previously, glyphs would line up horizontally on each cache line, leaving
potentially tons of space vertically, especially when smaller glyphs got put into cache
lines intended for large glyphs (which can happen when an app uses lots of unique
glyphs, a common case with, for example, chinese/japanese/korean languages). The new
approach packs glyphs vertically as well as horizontally to use the space more efficiently
and provide space for more glyphs in these situations.

Change-Id: I84338aa25db208c7bf13f3f92b4d05ed40c33527
2012-08-14 10:33:30 -07:00
Romain Guy
320d46bf84 Reduce gradients textures size whenever possible
Change-Id: Ifd58625ee62edac3b5d20b77553cb98b6fa2b46e
2012-08-08 16:05:42 -07:00
Romain Guy
c89b14bba0 It seems that apparently useless public APIs are actually useful
Bug #6953651

Change-Id: Ic47ce504e63262711f5d3edc76f7d2b9c12471ad
2012-08-08 14:58:54 -07:00
Jean-Baptiste Queru
b6039811fa am 05e97e81: am 0be33f2d: Merge "Add shortcut to avoid potential divide by zero in some case"
* commit '05e97e81a5fa2c9cab4cdda15aa2d036243a0c0e':
  Add shortcut to avoid potential divide by zero in some case
2012-08-08 14:08:35 -07:00
Jean-Baptiste Queru
05e97e81a5 am 0be33f2d: Merge "Add shortcut to avoid potential divide by zero in some case"
* commit '0be33f2d522f76f48062a59ddb520815a0851875':
  Add shortcut to avoid potential divide by zero in some case
2012-08-08 14:03:58 -07:00
Romain Guy
33fa1f774c Draw an empty border around glyphs to avoid sampling issues
Bug #6942209

The font renderer was preserving a 1 px border around each glyph to ensure
bilinear filtering would work nicely. Unfortunately, this border was not
set to 0 when glyphs were added in the cache to replace old evicted glyphs.

Change-Id: Ib85afca7ebad5cb63f960dc0e87ae162333dbfe8
2012-08-07 19:09:57 -07:00
Romain Guy
17112ad8a2 Cleanup of libhwui
Change-Id: Ib7f5771548462c00027a8ad57badfb68c50644f9
2012-08-07 11:25:15 -07:00
Romain Guy
8c654e0934 Merge "Add new debug tool to track hardware layers updates" into jb-mr1-dev 2012-08-06 14:52:41 -07:00
Romain Guy
4ff0cf4b83 Add new debug tool to track hardware layers updates
You can setprop debug.hwui.show_layers_updates true to flash
hw layers in green when they update. This is also a setting
in the Dev. section of the settings app.

Change-Id: Ibe1d63a4f81567dc1d590c9b088d2e7505df8abf
2012-08-06 14:51:10 -07:00
Mathias Agopian
4cb3384772 Merge "libutils cleanup" into jb-mr1-dev 2012-08-06 13:12:28 -07:00
Mathias Agopian
69a3ce1eb1 libutils cleanup
Change-Id: Ic069539338ba4097dba9399904f02bbd0296c20e
2012-08-05 12:38:51 -07:00
Romain Guy
8801b2fef3 Bowing my head in shame
Bug #6924514

Change-Id: Ifcc08fb5dbaf3f9c6ac3a3e618db2fd6349dc290
2012-08-03 17:43:31 -07:00
Romain Guy
18edb81172 Avoid crash when dumping display lists
We recently changed the drawText implementation to accept more parameters
which were not taken into account during a dump operation.

Change-Id: Ia1dc682dc7bb2bb02a1f4a514ed5af5556f92a97
2012-08-03 16:08:56 -07:00
Romain Guy
a70cd04985 Merge "Add dithering to gradients" into jb-mr1-dev 2012-08-03 11:09:49 -07:00
Romain Guy
211efea737 Add dithering to gradients
Change-Id: Ic1208855bde3a254eca2fd7cef43e0f1318ce419
2012-08-01 19:18:35 -07:00
Raph Levien
1ae49ab865 Merge "Fix bug 6892600 Font (character pairs) rendering issue" into jb-mr1-dev 2012-07-31 19:26:55 -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
Raph Levien
8b4072d3fb Fix bug 6892600 Font (character pairs) rendering issue
Alignment on paint for actual glyph drawing needs to always be left,
even when drawing centered or right aligned text. The x offset for
alignment is applied by OpenGLRenderer::drawText (and needs to be early
in the pipeline for quickReject to work). Similar change needed for
drawing drop shadow.

Also fixes bug with mispositioned underline (offset for alignment has
already been applied once, no need to do it again in
drawTextDecorations).

Change-Id: Id3dcd62de5536a26b158d768889273a1492b35d6
2012-07-30 15:53:16 -07:00
Romain Guy
c25259519f Rename drawGeneralText to drawText
Change-Id: I5062ea5b0605fc7af27f410fafc930d10f38e926
2012-07-27 16:41:22 -07:00
Chen YANG
0412cfcbcd Add shortcut to avoid potential divide by zero in some case
Change-Id: If4b34c95402daf8ebcc28736edfb2012553aa57c
2012-07-25 14:19:29 +08:00
Raph Levien
996e57c843 Hardware implementation of glyph positioning (bug 5443796)
This implementation adds a drawGeneralText() method to the OpenGL
Renderer, which supports both a global x, y position, an array of
individual glyph positions, and also a length parameter (which enables
drawing of underline and strikethrough. It also adds the method to the
display list (with marshalling and unmarshalling).

With this change, the existing drawText() method is removed entirely, as
it's subsumed by the new method. It's easy enough to revert to the old
functionality if needed by passing in a NULL positions array.

Change-Id: I8c9e6ce4309fd51cc5511db85df99f6de8f4f6f5
2012-07-23 16:52:20 -07:00