| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds refcounting of Res_png_9patch instances, the native
data structure used to represent 9-patches. The Dalvik NinePatch class
now holds a native pointer instead of a Dalvik byte[]. This pointer
is used whenever we need to draw the 9-patch (software or hardware.)
Since we are now tracking garbage collection of NinePatch objects
libhwui's PatchCache must keep a list of free blocks in the VBO
used to store the meshes.
This change also removes unnecessary instances tracking from
GLES20DisplayList. Bitmaps and 9-patches are refcounted at the
native level and do not need to be tracked by the Dalvik layer.
Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
|
|
|
|
|
|
|
| |
This optimization saves up to 0.3ms per frame on the Play Store's
front page, on a Nexus 4 device.
Change-Id: Iaa4ef33c6e3b37e175efd5b9eea9ef59b43f14f3
|
|
|
|
|
|
|
|
| |
The 9aptch cache was reinitialized after destroying/recreating
the EGL context but not after clearing it during a normal
memory trim.
Change-Id: If6155bfc8a62439e9878bc742a4766b3bd6c6aec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the Android runtime starts, the system preloads a series of assets
in the Zygote process. These assets are shared across all processes.
Unfortunately, each one of these assets is later uploaded in its own
OpenGL texture, once per process. This wastes memory and generates
unnecessary OpenGL state changes.
This CL introduces an asset server that provides an atlas to all processes.
Note: bitmaps used by skia shaders are *not* sampled from the atlas.
It's an uncommon use case and would require extra texture transforms
in the GL shaders.
WHAT IS THE ASSETS ATLAS
The "assets atlas" is a single, shareable graphic buffer that contains
all the system's preloaded bitmap drawables (this includes 9-patches.)
The atlas is made of two distinct objects: the graphic buffer that
contains the actual pixels and the map which indicates where each
preloaded bitmap can be found in the atlas (essentially a pair of
x and y coordinates.)
HOW IS THE ASSETS ATLAS GENERATED
Because we need to support a wide variety of devices and because it
is easy to change the list of preloaded drawables, the atlas is
generated at runtime, during the startup phase of the system process.
There are several steps that lead to the atlas generation:
1. If the device is booting for the first time, or if the device was
updated, we need to find the best atlas configuration. To do so,
the atlas service tries a number of width, height and algorithm
variations that allows us to pack as many assets as possible while
using as little memory as possible. Once a best configuration is found,
it gets written to disk in /data/system/framework_atlas
2. Given a best configuration (algorithm variant, dimensions and
number of bitmaps that can be packed in the atlas), the atlas service
packs all the preloaded bitmaps into a single graphic buffer object.
3. The packing is done using Skia in a temporary native bitmap. The
Skia bitmap is then copied into the graphic buffer using OpenGL ES
to benefit from texture swizzling.
HOW PROCESSES USE THE ATLAS
Whenever a process' hardware renderer initializes its EGL context,
it queries the atlas service for the graphic buffer and the map.
It is important to remember that both the context and the map will
be valid for the lifetime of the hardware renderer (if the system
process goes down, all apps get killed as well.)
Every time the hardware renderer needs to render a bitmap, it first
checks whether the bitmap can be found in the assets atlas. When
the bitmap is part of the atlas, texture coordinates are remapped
appropriately before rendering.
Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
|
|
|
|
|
|
| |
We now use the same mechanism to compare keys everywhere in libhwui.
Change-Id: I8b3cb25b13f4f38eb6f12aed0356f796a773617c
|
|
|
|
|
|
|
| |
See https://android-git.corp.google.com/g/156016
Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
|
|
|
|
|
|
| |
Bug #5136067
Change-Id: I366e840bef44415436dc7b13d89cfb610feed663
|
|
|
|
|
|
| |
Bug #3272858
Change-Id: Idacd5d7c2c052b4834a8ddb5906ab32b3f548f73
|
|
|
|
|
|
| |
Bug #3221488
Change-Id: Ifc9e42a991d630feadc9e8032322f37504d09d6d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Ibcb11d704653d8875e22629ea39e4ee2ebce3c22
|
|
|
|
|
|
|
| |
This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.
Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
|
|
|
|
| |
Change-Id: I7ffb2365f83e0453e7d0a0cdcb3fc9308b305238
|
|
|
|
| |
Change-Id: Iaa49757600a53b39369dbb23f8c3feab282518e6
|
|
|
|
| |
Change-Id: Ib05b398ae03e734da2dab0496df416fed4570b1c
|
|
|
|
| |
Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11
|
|
Currently only tested with title bars and buttons.
Change-Id: I8263a9281898dc0e943b1b8412827fe55639b9d6
|