From efb4b06493fe7b1604c762a448b13c7af2845a8d Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 27 Feb 2017 11:00:04 -0800 Subject: Add ColorSpace information on Bitmap This is the first step toward interpreting color spaces at render time. Bug: 32984164 Test: BitmapColorSpaceTest in CtsGraphicsTestCases Change-Id: I0164a18f1ed74a745874fe5229168042afe27a04 --- libs/hwui/Extensions.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'libs/hwui/Extensions.cpp') diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp index 00238a25ebde..1e71cb081b39 100644 --- a/libs/hwui/Extensions.cpp +++ b/libs/hwui/Extensions.cpp @@ -20,6 +20,8 @@ #include "Properties.h" #include "utils/StringUtils.h" +#include + #include #include @@ -28,14 +30,6 @@ namespace android { namespace uirenderer { -// Debug -#if DEBUG_EXTENSIONS - #define EXT_LOGD(...) ALOGD(__VA_ARGS__) -#else - #define EXT_LOGD(...) -#endif - - Extensions::Extensions() { const char* version = (const char*) glGetString(GL_VERSION); @@ -66,17 +60,18 @@ Extensions::Extensions() { mHas4BitStencil = extensions.has("GL_OES_stencil4"); mHasUnpackSubImage = extensions.has("GL_EXT_unpack_subimage"); -#ifdef ANDROID_ENABLE_LINEAR_BLENDING mHasSRGB = mVersionMajor >= 3 || extensions.has("GL_EXT_sRGB"); mHasSRGBWriteControl = extensions.has("GL_EXT_sRGB_write_control"); +#ifdef ANDROID_ENABLE_LINEAR_BLENDING // If linear blending is enabled, the device must have (ES3.0 or EXT_sRGB) // and EXT_sRGB_write_control LOG_ALWAYS_FATAL_IF(!mHasSRGB, "Linear blending requires ES 3.0 or EXT_sRGB"); LOG_ALWAYS_FATAL_IF(!mHasSRGBWriteControl, "Linear blending requires EXT_sRGB_write_control"); + + mHasLinearBlending = true; #else - mHasSRGB = false; - mHasSRGBWriteControl = false; + mHasLinearBlending = false; #endif } -- cgit v1.2.3-59-g8ed1b