summaryrefslogtreecommitdiff
path: root/libs/hwui/Extensions.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2017-02-27 11:00:04 -0800
committer Romain Guy <romainguy@google.com> 2017-03-06 19:33:25 -0800
commitefb4b06493fe7b1604c762a448b13c7af2845a8d (patch)
tree310d40716decb7686065339226534dac0bb35faa /libs/hwui/Extensions.cpp
parent4f357c081260c5bb36498169eb698adf7089899c (diff)
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
Diffstat (limited to 'libs/hwui/Extensions.cpp')
-rw-r--r--libs/hwui/Extensions.cpp17
1 files changed, 6 insertions, 11 deletions
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 <cutils/compiler.h>
+
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
@@ -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
}