gpu_tonemapper: Fix compilation issue with GraphicBuffer

Handle different version of GraphicBuffer with a compile time
flag.

CRs-Fixed: 1111917
Change-Id: I11aa6d64a8e61a4d7658cb5f924ee4dc38c40bc9
This commit is contained in:
Naseer Ahmed
2017-01-17 15:34:02 -05:00
parent 6c44d14e18
commit feaed06078
3 changed files with 15 additions and 3 deletions

View File

@@ -9,6 +9,14 @@ ifeq ($(TARGET_USES_COLOR_METADATA), true)
common_flags += -DUSE_COLOR_METADATA
endif
CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
PLATFORM_SDK_NOUGAT = 25
ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
version_flag := -D__NOUGAT__
endif
endif
use_hwc2 := false
ifeq ($(TARGET_USES_HWC2), true)
use_hwc2 := true

View File

@@ -11,7 +11,7 @@ LOCAL_MODULE := libgpu_tonemapper
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(TARGET_OUT_HEADERS)/qcom/display/
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wall \
LOCAL_CFLAGS := $(version_flag) -Wno-missing-field-initializers -Wall \
-Wno-unused-parameter -std=c++11 -DLOG_TAG=\"GPU_TONEMAPPER\"
LOCAL_SRC_FILES := TonemapFactory.cpp \

View File

@@ -41,8 +41,12 @@ EGLImageBuffer *EGLImageWrapper::wrap(const void *pvt_handle)
}
android::sp<android::GraphicBuffer> graphicBuffer =
new android::GraphicBuffer(src->width, src->height, src->format, flags,
src->width /*src->stride*/, native_handle, false);
new android::GraphicBuffer(src->width, src->height, src->format,
#ifndef __NOUGAT__
1, // Layer count
#endif
flags, src->width /*src->stride*/,
native_handle, false);
result = new EGLImageBuffer(graphicBuffer);