| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I73127fc7369643b94d4a49f31a516b50c74b54ac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite a few things going on in this commit:
- Enable bitmap strikes by default in Paint objects.
The SkPaint parameter that enables bitmap strikes was not previously
included in DEFAULT_PAINT_FLAGS. This effectively disabled bitmap
fonts. Oops! It's for the best, though, as additional work was needed
in Skia to make bitmap fonts work anyway.
- Complain if TEXTURE_BORDER_SIZE is not 1.
Our glyph cache code does not currently handle any value other than 1
here, including zero. I've added a little C preprocessor check to
prevent future engineers (including especially future-me) from
thinking that they can change this value without updating the related
code.
- Add GL_RGBA support to hwui's FontRenderer and friends
This also happened to involve some refactoring for convenience and
cleanliness.
Bug: 9577689
Change-Id: I0abd1e5a0d6623106247fb6421787e2c2f2ea19c
|
|
|
|
|
|
|
|
|
| |
This reduces state changes when we draw 9patches and text together,
which happens *a lot*. Also disable the NV profiling extension by
default since it doesn't play nice with display lists deferrals.
To enable it set debug.hwui.nv_profiling to true.
Change-Id: I518b44b7d294e5def10c78911ceb9f01ae401609
|
|
|
|
| |
Change-Id: I11ee943da23a66828455a9770fc3c5ceb4bbcaa9
|
|\
| |
| |
| |
| | |
* commit '55b883b0a960b37aa453253f3ccb614dd95c221c':
Draw Operation merging
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Merge simple bitmap draw operations and text operations to avoid
issuing individual gl draws for each operation. Merging other ops to
be done eventually.
The methods are different - the bitmap merging generates a single
mesh for reused, unclipped images (esp. repeated images in a listview)
The text approach queries just defers the normal font rendering until
the last drawText in the sequence that can share the same shader.
Patches are sorted and merged, but don't yet have a multiDraw
implementation. For now, the pretending-to-merge gives better sorting
behavior by keeping similar patches together.
Change-Id: Ic300cdab0a53814cf7b09c58bf54b1bf0f58ccd6
|
|\ \
| |/
| |
| | |
Change-Id: Id002d2ae799c6946672335f122ecbfa07d9c0bc1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
|
|
|
|
| |
SystemServer is currently a monolithic class that brings up key system
services. This change is the first phase of refactoring it to be more
configurable. Specifically, it adds a set of on/off switches used to control
startup of individual services. Future plans include finer grained controls
and a more explicit and consistent startup sequence for these services.
Change-Id: I7299f5ce7d7b74a34eb56dffb788366fbc058532
|
|
|
|
|
|
|
|
| |
Only performs the GL setup steps when at least one glyph is drawn.
This change also skips various draw operations when the specified
paint draws with alpha = 0.
Change-Id: I9eda148b0503acffc552ee19196f5d52e958a1a2
|
|
|
|
|
|
|
|
| |
This change moves the mesh buffer from FontRenderer to CacheTexture
to help reduce the number of texture binds and glDraw calls when
drawing text that spans across multiple textures.
Change-Id: I7de574d88313ca3672879ca878c253ff5f131fc1
|
|
|
|
|
|
|
|
|
|
|
| |
When several CacheTextures are used to draw text, sort the
draw batches by texture ID to minimize state changes in the
driver.
This change also tweaks the font cache size and renames
a property that was too long to be set using setprop.
Change-Id: I0a36dfffe58c9e75dd7384592d3343c192d042b1
|
|
|
|
|
|
| |
This reverts commit bf5703e52e3304246cbf0e73f6976f7d7312d238.
Change-Id: Ic6f991277dec9e80a6fed93db91499726b30ab2a
|
|
|
|
|
|
| |
This reverts commit 3f76e65d251ead65fe8ff98e3bd4c7623fbaac07
Change-Id: Ia81cd485e5ca696bb284c419dc8a1d2f3247100e
|
|
|
|
|
|
| |
Still fall back to simple path for small tasks
Change-Id: I492f1b3f7d6fec1738f3e45cbfb15864bd23a392
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, cache textures were updated whenever mCurrentCacheTexuture was changed.
Since updating cache textures needs glTexSubImage2D call, frequent changing
of mCurrentCacheTexture (which can easily happen when an app uses lots of unique glyphs
even with precaching) caused many glTexSubImage2D calls and bad framerates.
This patch optimized isssueDrawCommand function. Consequently, changing mCurrentCacheTexture doesn't
cause glTexSubImage2D call any more and it will improve font rendering performance.
Change-Id: Id19d959fa0e69eeb2a39f83a57e311d7394586b2
Signed-off-by: Sangkyu Lee <geteuid@gmail.com>
|
|
|
|
| |
Change-Id: Ic788721c224a77f0a76f4cd6d9817b62e390a5a7
|
|
|
|
| |
Change-Id: I09c00debe9b0b4f45b232cae402ed19bdaeabfe4
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds support for drop shadows (setShadowLayer) for
drawPosText in the hwui renderer. In and of itself, it's not very
important, but it's on the critical path for correct mark positioning,
tracked as bug 5443796.
The change itself is fairly straightforward - it basically just adds an
extra "positions" argument to all draw and measure methods on the code
path for drawing drop shadowed text, as well as to the cache key for
cached shadow textures.
Change-Id: Ic1cb63299ba61ccbef31779459ecb82aa4a5e672
|
|/
|
|
|
|
| |
Bug #6853934
Change-Id: I15e6ca73bfe00eff1a37c4b9d2f7f709ee018eb6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug #6408362
FontRenderer allocates large font textures when more room is needed
to store all the glyphs used by an application. Thse large textures
are the first to be freed when memory needs to be reclaimed by the
system. When freeing a texture, the renderer would however not set
the texture name to an invalid name, leading future allocations to
be performed on the same texture name. That name could have by then
be recycled by the driver and returned by a call to glGenTexture
and used to create an entirely different texture. This would cause
the font renderer to point to the wrong texture, thus leading to
the "corruptions."
Change-Id: I8a1e80e5b79e8f21d1baf5320c090df4f2066cd4
|
|
|
|
|
|
| |
Bug #6408362
Change-Id: I58543938e7b64d83504e11e97b0dd21ef8ebf3b6
|
|
|
|
|
|
| |
Bug #6408362
Change-Id: Ie11644c5a9e2d87d3b851b7e619e5f04b60a7e02
|
|
|
|
| |
Change-Id: I23223b89770a0cd2b4762365bead9bfddb094290
|
|
|
|
|
|
| |
This also introduces a small optimization when rendering text.
Change-Id: Iff620ac97bf878eaac406bccc6daa07052c93890
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, font renderers eliminate some texture caches when
memory is trimmed. This change makes it go further by eliminating the
large-glyph caches for all font renderers. These caches are
only allocated as needed, but continue to consume large amounts of
memory (CPU and GPU) after that allocation. De-allocating this memory
on a trim operation should prevent background apps from holding onto
this memory in the possible case that they have allocated it by drawing
large glyphs.
Change-Id: Id7a3ab49b244e036b442d87252fb40aeca8fdb26
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were 2 issues remaining after a recent change to support
glyph caching from multiple textures:
- memory in the GPU for all textures was being allocated automatically.
This is now lazy, being allocated only when those textures are first
needed.
- filtering (applied when a rendered object is transformed) was ignoring
the new multiple-texture structure. Filtering should be applied correctly
whenever we change textures.
Change-Id: I5c8eb8d46c73cd01782a353fc79b11cacc2146ab
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some GPU architectures could not handle the previous implementation
of our glyph cache. Frequent uploads would cause memory problems in the GPU
and eventually a crash due to these memory issues. The solution is to move to
a system of several, smaller caches instead of one monolythic cache for all
glyphs.
Change-Id: I0fc7a323360940d16d5a33eeb33abfab194c5920
|
|/
|
|
|
|
|
|
| |
This optimization along with the previous one lets us render an
application like Gmail using only 30% of the number of GL commands
previously required
Change-Id: Ifee63edaf495e04490b5abd5433bb9a07bc327a8
|
|
|
|
| |
Change-Id: Iae59bc8dfd6427d0967472462cc1994987092827
|
|
|
|
| |
Change-Id: I6313ac039291c9cd93aadafe3566ad9d60cab42d
|
|
|
|
|
|
| |
Bug #5112207
Change-Id: Ic34037ace21a5058ba23dd15e51aae58c998454d
|
|
|
|
|
|
| |
Bug #4350336
Change-Id: I1cf31693f7ca9653fa3a41b5b91c27ef288d680f
|
|
|
|
| |
Change-Id: I7b022100fb0762613f9cf7753dbb0217e1e75f8d
|
|
|
|
|
|
|
|
| |
Bug #4159731
For real this time!
Change-Id: I9cb6d70e68d2b57eb9a6d9a6bca8176967192421
|
|
|
|
|
|
|
|
|
|
| |
Glyphs drawn with paints that had different textScaleX values were not
being recognized as different, so the glyph cache was being used regardless
of different scaleX values. This change adds the scaleX attribute to the native
Font object to allow the cache to distinguish between this difference and cache
accordingly.
Change-Id: I5d8fc26d47460b27dc8e373a473d46b2f1b8dc30
|
|
|
|
| |
Change-Id: I6377bb641df7d8372d873c00790189f9a190afd6
|
|
|
|
|
|
| |
Bug #3360888
Change-Id: I42e81a1f10bf7b9ae1c63ca8add1878fd59a1e8a
|
|
|
|
| |
Change-Id: Ie4edc9ba46610edde831b55e769944e9a19bdcb5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change also adds a new memory usage flag. When turned on, the
following is printed after every frame:
D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes):
D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520
D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608
D/OpenGLRenderer( 3723): GradientCache 135168 / 524288
D/OpenGLRenderer( 3723): PathCache 41180 / 4194304
D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152
D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144
D/OpenGLRenderer( 3723): Other:
D/OpenGLRenderer( 3723): FboCache 2 / 12
D/OpenGLRenderer( 3723): PatchCache 31 / 512
D/OpenGLRenderer( 3723): Total memory usage:
D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB
This should help tracking possibe memory issues.
Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
|
|
|
|
|
|
|
|
|
| |
This optimization is currently disabled until Launcher is
modified to take advantage of it. The optimization can be
enabled by turning on RENDER_LAYERS_AS_REGIONS in the
OpenGLRenderer.h file.
Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
|
|
|
|
| |
Change-Id: Ic903f4b5d30e9c92528c6291941896efe4729ee3
|