2009-03-03 19:31:44 -08:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
|
|
com_android_server_AlarmManagerService.cpp \
|
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
2013-04-17 18:54:38 -07:00
|
|
|
com_android_server_AssetAtlasService.cpp \
|
2009-03-03 19:31:44 -08:00
|
|
|
com_android_server_BatteryService.cpp \
|
2012-04-05 14:27:12 -07:00
|
|
|
com_android_server_input_InputApplicationHandle.cpp \
|
|
|
|
com_android_server_input_InputManagerService.cpp \
|
|
|
|
com_android_server_input_InputWindowHandle.cpp \
|
2009-11-24 00:30:52 -05:00
|
|
|
com_android_server_LightsService.cpp \
|
2012-06-18 18:29:13 -07:00
|
|
|
com_android_server_power_PowerManagerService.cpp \
|
2011-08-29 20:11:07 -04:00
|
|
|
com_android_server_SerialService.cpp \
|
2009-03-03 19:31:44 -08:00
|
|
|
com_android_server_SystemServer.cpp \
|
2011-05-26 10:27:39 -04:00
|
|
|
com_android_server_UsbDeviceManager.cpp \
|
|
|
|
com_android_server_UsbHostManager.cpp \
|
2009-11-24 00:30:52 -05:00
|
|
|
com_android_server_VibratorService.cpp \
|
2010-12-29 08:32:32 -05:00
|
|
|
com_android_server_location_GpsLocationProvider.cpp \
|
2011-05-23 17:26:46 -07:00
|
|
|
com_android_server_connectivity_Vpn.cpp \
|
2009-03-03 19:31:44 -08:00
|
|
|
onload.cpp
|
|
|
|
|
|
|
|
LOCAL_C_INCLUDES += \
|
2011-01-02 16:37:43 -08:00
|
|
|
$(JNI_H_INCLUDE) \
|
|
|
|
frameworks/base/services \
|
|
|
|
frameworks/base/core/jni \
|
2013-07-15 13:22:04 -07:00
|
|
|
frameworks/native/services \
|
2012-04-17 16:52:41 -07:00
|
|
|
external/skia/include/core \
|
2012-05-11 18:42:42 -07:00
|
|
|
libcore/include \
|
|
|
|
libcore/include/libsuspend \
|
|
|
|
$(call include-path-for, libhardware)/hardware \
|
|
|
|
$(call include-path-for, libhardware_legacy)/hardware_legacy \
|
2009-03-03 19:31:44 -08:00
|
|
|
|
|
|
|
LOCAL_SHARED_LIBRARIES := \
|
Native input dispatch rewrite work in progress.
The old dispatch mechanism has been left in place and continues to
be used by default for now. To enable native input dispatch,
edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy.
Includes part of the new input event NDK API. Some details TBD.
To wire up input dispatch, as the ViewRoot adds a window to the
window session it receives an InputChannel object as an output
argument. The InputChannel encapsulates the file descriptors for a
shared memory region and two pipe end-points. The ViewRoot then
provides the InputChannel to the InputQueue. Behind the
scenes, InputQueue simply attaches handlers to the native PollLoop object
that underlies the MessageQueue. This way MessageQueue doesn't need
to know anything about input dispatch per-se, it just exposes (in native
code) a PollLoop that other components can use to monitor file descriptor
state changes.
There can be zero or more targets for any given input event. Each
input target is specified by its input channel and some parameters
including flags, an X/Y coordinate offset, and the dispatch timeout.
An input target can request either synchronous dispatch (for foreground apps)
or asynchronous dispatch (fire-and-forget for wallpapers and "outside"
targets). Currently, finding the appropriate input targets for an event
requires a call back into the WindowManagerServer from native code.
In the future this will be refactored to avoid most of these callbacks
except as required to handle pending focus transitions.
End-to-end event dispatch mostly works!
To do: event injection, rate limiting, ANRs, testing, optimization, etc.
Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
2010-04-22 18:58:52 -07:00
|
|
|
libandroid_runtime \
|
2012-02-20 16:58:20 -08:00
|
|
|
libandroidfw \
|
2013-07-15 13:22:04 -07:00
|
|
|
libbinder \
|
2010-12-29 08:32:32 -05:00
|
|
|
libcutils \
|
2013-04-09 21:54:12 -07:00
|
|
|
liblog \
|
2010-12-29 08:32:32 -05:00
|
|
|
libhardware \
|
|
|
|
libhardware_legacy \
|
|
|
|
libnativehelper \
|
|
|
|
libutils \
|
|
|
|
libui \
|
2011-01-02 16:37:43 -08:00
|
|
|
libinput \
|
2013-07-01 19:07:15 -07:00
|
|
|
libinputservice \
|
2013-07-15 13:22:04 -07:00
|
|
|
libsensorservice \
|
2011-01-02 16:37:43 -08:00
|
|
|
libskia \
|
2011-03-25 18:42:40 -07:00
|
|
|
libgui \
|
2012-05-11 18:42:42 -07:00
|
|
|
libusbhost \
|
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
2013-04-17 18:54:38 -07:00
|
|
|
libsuspend \
|
|
|
|
libEGL \
|
|
|
|
libGLESv2
|
|
|
|
|
|
|
|
LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
|
2010-07-27 18:44:30 -04:00
|
|
|
|
2009-03-03 19:31:44 -08:00
|
|
|
ifeq ($(WITH_MALLOC_LEAK_CHECK),true)
|
2010-12-29 08:32:32 -05:00
|
|
|
LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
|
2009-03-03 19:31:44 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_MODULE:= libandroid_servers
|
|
|
|
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|