summaryrefslogtreecommitdiff
path: root/libs/hwui/Extensions.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2016-10-12 15:52:12 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-10-12 15:52:14 +0000
commit21986f2ae73e9ae3395a37dd3976af55e75d4f9d (patch)
tree77c0a34a98f1dab8b3c5c604e36c738bf60dc430 /libs/hwui/Extensions.cpp
parent02319a61927041cc4d3632e94c501b7277f0bda5 (diff)
parent253f2c213f6ecda63b6872aee77bd30d5ec07c82 (diff)
Merge "Linear blending, step 1"
Diffstat (limited to 'libs/hwui/Extensions.cpp')
-rw-r--r--libs/hwui/Extensions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
index 02caaa49e99c..4dc7536d60bc 100644
--- a/libs/hwui/Extensions.cpp
+++ b/libs/hwui/Extensions.cpp
@@ -22,6 +22,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+
#include <utils/Log.h>
namespace android {
@@ -44,6 +45,14 @@ Extensions::Extensions() {
mHas1BitStencil = extensions.has("GL_OES_stencil1");
mHas4BitStencil = extensions.has("GL_OES_stencil4");
mHasUnpackSubImage = extensions.has("GL_EXT_unpack_subimage");
+ mHasSRGB = extensions.has("GL_EXT_sRGB");
+ mHasSRGBWriteControl = extensions.has("GL_EXT_sRGB_write_control");
+
+ // If linear blending is enabled, the device must have ES3.0 and GL_EXT_sRGB_write_control
+#ifdef ANDROID_ENABLE_LINEAR_BLENDING
+ assert(mVersionMajor >= 3 || mHasSRGB);
+ assert(mHasSRGBWriteControl);
+#endif
const char* version = (const char*) glGetString(GL_VERSION);