History log of /frameworks/base/libs/hwui/Patch.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b5c4e7fd3866bbe30d7ea4d7bc463da5a70970e2 10-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 92860a74 to master

Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
6381dd4ff212a95be30d2b445d40ff419ab076b4 03-Mar-2014 Narayan Kamath <narayan@google.com> LP64: Make 9 patches architecture agnostic.

The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
/frameworks/base/libs/hwui/Patch.h
564acf7c9bff822f608cda0d5df0a64a9f9aaefd 03-Jan-2014 Chris Craik <ccraik@google.com> Fix Clang warnings/errors

Fix several build warnings (struct != class, int != size_t) and errors
(variable leng non-POD arrays).

Change-Id: I70b4e784365514303d8954bfcb1f39d7c22c1321
/frameworks/base/libs/hwui/Patch.h
6cad75744ed3b81cf2c96f545368067b62c726ec 24-Jul-2013 Romain Guy <romainguy@google.com> Fix 9patches' limitation of 32 empty quads

The 9patch format allows to define more empty quads than this, remove
the use of a single int to index empty quads and replace it with a
lookup in the 9patch resource data structure.

Change-Id: I148ee5d9e0c96822b534a344e15c9d88078db7c2
/frameworks/base/libs/hwui/Patch.h
03c00b5a135e68d22ca5bb829b899ebda6ed7e9d 21-Jun-2013 Romain Guy <romainguy@google.com> Batch 9-patches in a single mesh whenever possible

This change also fixes the way batched bitmaps were handled
inside a layer. The layer is now correctly dirtied to minimize
the amount of pixels to blend.

Fix alpha, mode and opaque computations for DrawPatchOp.

Change-Id: I1b6cd581c0f0db66c1002bb4fb1a9811e55bfa78
/frameworks/base/libs/hwui/Patch.h
3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9 18-Apr-2013 Romain Guy <romainguy@google.com> Pack preloaded framework assets in a texture atlas

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
/frameworks/base/libs/hwui/Patch.h
13ba0054846ce630ca31e8f26169fd9388faee02 15-Feb-2013 Romain Guy <romainguy@google.com> Remove obsolete header file

We now use the same mechanism to compare keys everywhere in libhwui.

Change-Id: I8b3cb25b13f4f38eb6f12aed0356f796a773617c
/frameworks/base/libs/hwui/Patch.h
5341cead27070656458750a789ba211a505b57b5 09-Jan-2013 Romain Guy <romainguy@google.com> Cleanup 9patch mesh matching code
Bug #7970966

The bug described in #7970966 should normally never happen but just in
case, change the detection code to be more robust.

Change-Id: I7040a6087590e34abe8803cb8f83f051d77f3944
/frameworks/base/libs/hwui/Patch.h
41d35aef06c2a570a45474a01ca95a6cb9c29d9e 11-Oct-2012 Romain Guy <romainguy@google.com> Allow 9patches to shrink
Bug #7307304

Change-Id: I1fabf6df99c18c86ab1ec0e1e398a3d6d4098496
/frameworks/base/libs/hwui/Patch.h
f504a2fa144504ca1efd39a4ef9208e3d4d336c5 27-May-2011 Romain Guy <romainguy@google.com> Correctly implement the CLEAR xfermode.

The previous implementation was using glBlendFunc with the parameters
GL_ZERO/GL_ZERO which doesn't work for text, paths and other alpha
sources (anti-aliasing.) The correct implementation is GL_ZERO/
GL_ONE_MINUS_SRC_ALPHA.

Change-Id: I4cca65e57b6a37bbf5a41d382cb0648ee8e11e79
/frameworks/base/libs/hwui/Patch.h
eb6a4a17a07f1aa41bd58d418b2982cddb97685a 18-Jan-2011 Romain Guy <romainguy@google.com> Fix 9patches, again...
Bug #3365243

Change-Id: Id45a1f1fd5e099b1d691e6064401d3de1b0c5c20
/frameworks/base/libs/hwui/Patch.h
7444da512680df0c52af39ea521e35adbe0c167d 17-Jan-2011 Romain Guy <romainguy@google.com> Yet another fix for 9patch rendering.
Bug #3362133

Change-Id: Ia6521d31a8c208a2ad2506a23b6a01e5e442ad86
/frameworks/base/libs/hwui/Patch.h
fb13abd800cd610c7f46815848545feff83e5748 17-Jan-2011 Romain Guy <romainguy@google.com> Fix 9patch rendering in ExpandableListView.

Change-Id: I60843d61a40b0cb7dd09923cb4489a5a76f20486
/frameworks/base/libs/hwui/Patch.h
8ab4079ca27e36e5c584495bcd71b573598ac021 07-Dec-2010 Romain Guy <romainguy@google.com> Fix 9patch rendering
Bug #3253396

Some quads were incorrectly assumed to be degenerate.

Change-Id: I9155699edc3424afe9d5a131886bb9966d46b109
/frameworks/base/libs/hwui/Patch.h
a5ef39a21683189e5906c9f252b997f0508e350d 04-Dec-2010 Romain Guy <romainguy@android.com> Don't render degenerate triangles in 9patches.
Bug #3251983

Change-Id: Ib0b38a7b8111542372f4c4c106b6321c26fe4ad4
/frameworks/base/libs/hwui/Patch.h
6f72bebe92a4db7b5dc83f4ac5b5fd02e3b4e2cd 30-Nov-2010 Romain Guy <romainguy@google.com> Update 9patch structure when rendering with different divs/colors.
Bug #3221488

Change-Id: Ifc9e42a991d630feadc9e8032322f37504d09d6d
/frameworks/base/libs/hwui/Patch.h
5b3b35296e8b2c8d3f07d32bb645d5414db41a1d 28-Oct-2010 Romain Guy <romainguy@google.com> Optimize FBO drawing with regions.
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
/frameworks/base/libs/hwui/Patch.h
2665b85b2bd08faabf7c520a622a0e4d3465245f 19-Oct-2010 Romain Guy <romainguy@google.com> Small cleanup.

Change-Id: I0e5b9154a2d93af793d62f462d68cb7c6c3f6d75
/frameworks/base/libs/hwui/Patch.h
03750a067e818ca7fbd0f590e2ff6a8fded21e6c 18-Oct-2010 Romain Guy <romainguy@google.com> Use VBOs to render most geometries.

Change-Id: I4360dc4fe5693ab425450c107282b2c22db4dca7
/frameworks/base/libs/hwui/Patch.h
4bb942083a0d4db746adf95349108dd8ef842e32 13-Oct-2010 Romain Guy <romainguy@google.com> Optimize 9patch rendering.

This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.

Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
/frameworks/base/libs/hwui/Patch.h
2728f961614a385df1f056fc24803a9f65c90fab 09-Oct-2010 Romain Guy <romainguy@google.com> Don't update 9patches on every frame.

Change-Id: I7ffb2365f83e0453e7d0a0cdcb3fc9308b305238
/frameworks/base/libs/hwui/Patch.h
759ea80dca64ad652110a129e0d8bf93fea79f61 17-Sep-2010 Romain Guy <romainguy@google.com> Add support for drawLines(), with anti-aliasing

Change-Id: I16c0593c5671490909dec13a85df601e1428a1a6
/frameworks/base/libs/hwui/Patch.h
6820ac8b14b4558f5d8b833dde80895306a3e137 16-Sep-2010 Romain Guy <romainguy@google.com> Fix 9patch rendering.

Change-Id: Ic4c18ff483cca95fbabcb10843f7714efe488adb
/frameworks/base/libs/hwui/Patch.h
fb5e23c327cd5f8f93d1eaa7c10f34d6fd3efb6c 09-Jul-2010 Romain Guy <romainguy@google.com> Refactoring to move vertex computing to the Patch class.

This change is mostly cleanup to keep less code in OpenGLRenderer.

Change-Id: I954375143b2943829457ab470423729b60b844f5
/frameworks/base/libs/hwui/Patch.h
f7f93556c8fcc640ab5adef79d021a80a72a645a 09-Jul-2010 Romain Guy <romainguy@google.com> Draw n-patches using OpenGL.

Currently only tested with title bars and buttons.

Change-Id: I8263a9281898dc0e943b1b8412827fe55639b9d6
/frameworks/base/libs/hwui/Patch.h