Romain Guy cf51a41998 Introduce PixelBuffer API to enable PBOs
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
2013-04-11 14:07:34 -07:00

78 lines
1.8 KiB
Makefile

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# Only build libhwui when USE_OPENGL_RENDERER is
# defined in the current device/board configuration
ifeq ($(USE_OPENGL_RENDERER),true)
LOCAL_SRC_FILES:= \
utils/Blur.cpp \
utils/SortedListImpl.cpp \
thread/TaskManager.cpp \
font/CacheTexture.cpp \
font/Font.cpp \
FontRenderer.cpp \
GammaFontRenderer.cpp \
Caches.cpp \
DisplayList.cpp \
DeferredDisplayList.cpp \
DisplayListLogBuffer.cpp \
DisplayListRenderer.cpp \
Dither.cpp \
Extensions.cpp \
FboCache.cpp \
GradientCache.cpp \
Layer.cpp \
LayerCache.cpp \
LayerRenderer.cpp \
Matrix.cpp \
OpenGLRenderer.cpp \
Patch.cpp \
PatchCache.cpp \
PathCache.cpp \
PathTessellator.cpp \
PixelBuffer.cpp \
Program.cpp \
ProgramCache.cpp \
RenderBufferCache.cpp \
ResourceCache.cpp \
SkiaColorFilter.cpp \
SkiaShader.cpp \
Snapshot.cpp \
Stencil.cpp \
TextureCache.cpp \
TextDropShadowCache.cpp
intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE) \
$(LOCAL_PATH)/../../include/utils \
external/skia/include/core \
external/skia/include/effects \
external/skia/include/images \
external/skia/src/core \
external/skia/src/ports \
external/skia/include/utils \
$(intermediates) \
frameworks/rs/cpp \
frameworks/rs
LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DGL_GLEXT_PROTOTYPES
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libGLESv2 libskia libui libRS libRScpp
LOCAL_MODULE := libhwui
LOCAL_MODULE_TAGS := optional
ifndef HWUI_COMPILE_SYMBOLS
LOCAL_CFLAGS += -fvisibility=hidden
endif
ifdef HWUI_COMPILE_FOR_PERF
LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
endif
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif