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
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
this introduced a dead lock in GradientCache's ctor.
This reverts commit dfe082f63e94cde9aee271c94d13de5e7217e036.
Bug: 7096001
Change-Id: I57b8bbab11fb7cb502fa58e3bbf5d19864db874f
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
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
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
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
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
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
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
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
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
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
We recently changed the drawText implementation to accept more parameters
which were not taken into account during a dump operation.
Change-Id: Ia1dc682dc7bb2bb02a1f4a514ed5af5556f92a97
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
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