diff options
author | Christopher R. Palmer <crpalmer@gmail.com> | 2015-12-22 09:56:25 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-12-22 12:51:08 -0800 |
commit | 0f7990648453e2290a9cbedd1b17373a62776228 (patch) | |
tree | be54d1237e8a2209096489667e496dc10d99044b /libs | |
parent | 76323e41a390afd6adec0578c287cb11eee5a3ea (diff) | |
download | frameworks_base-0f7990648453e2290a9cbedd1b17373a62776228.zip frameworks_base-0f7990648453e2290a9cbedd1b17373a62776228.tar.gz frameworks_base-0f7990648453e2290a9cbedd1b17373a62776228.tar.bz2 |
hwui: Allow devices to opt-out of asynchronouse setSurface initialization
Not all devices seem to be able to deal with this so let them opt
out of it, even though it does provide a UI slow-down.
Change-Id: I402193c2c930e815ba69071142b9093a0630b590
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Android.mk | 4 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk index 91e289c..fb9ac1e 100644 --- a/libs/hwui/Android.mk +++ b/libs/hwui/Android.mk @@ -2,6 +2,10 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +ifeq ($(TARGET_REQUIRES_SYNCHRONOUS_SETSURFACE),true) + LOCAL_CFLAGS += -DREQUIRES_SYNCHRONOUS_SETSURFACE +endif + LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_MODULE := libhwui diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 30f0073..939c0c7 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -148,7 +148,11 @@ void RenderProxy::initialize(const sp<ANativeWindow>& window) { SETUP_TASK(initialize); args->context = mContext; args->window = window.get(); +#ifdef REQUIRES_SYNCHRONOUS_SETSURFACE + postAndWait(task); +#else post(task); +#endif } CREATE_BRIDGE2(updateSurface, CanvasContext* context, ANativeWindow* window) { |