From 0f7990648453e2290a9cbedd1b17373a62776228 Mon Sep 17 00:00:00 2001 From: "Christopher R. Palmer" Date: Tue, 22 Dec 2015 09:56:25 -0500 Subject: 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 --- libs/hwui/Android.mk | 4 ++++ libs/hwui/renderthread/RenderProxy.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'libs') 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& 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) { -- cgit v1.1