Revert "Float buffers are only support on GLES 3.2, not 3.0"
We shouldn't use GL extensions to to query for wide-gamut
support.
Bug: 80496655
Test: CtsHardwareTestCases
This reverts commit b3fab0974ff41311554ec357a34d9a4d6b037246.
Change-Id: I6669bb6733c4cca4bbe1379a818d5fd7a8ec003f
diff --git a/tests/tests/hardware/src/android/hardware/cts/GlUtils.java b/tests/tests/hardware/src/android/hardware/cts/GlUtils.java
index bd5cecb..81628d4 100644
--- a/tests/tests/hardware/src/android/hardware/cts/GlUtils.java
+++ b/tests/tests/hardware/src/android/hardware/cts/GlUtils.java
@@ -17,7 +17,6 @@
package android.hardware.cts;
import android.opengl.GLES20;
-import android.util.Pair;
import java.util.Arrays;
import java.util.regex.Matcher;
@@ -28,10 +27,6 @@
}
static int getMajorVersion() {
- return getVersion().first;
- }
-
- static Pair<Integer, Integer> getVersion() {
// Section 6.1.5 of the OpenGL ES specification indicates the GL version
// string strictly follows this format:
//
@@ -47,10 +42,9 @@
Pattern pattern = Pattern.compile("OpenGL ES ([0-9]+)\\.([0-9]+)");
Matcher matcher = pattern.matcher(version);
if (matcher.find()) {
- return new Pair<>(
- Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)));
+ return Integer.parseInt(matcher.group(1));
}
- return new Pair<>(2, 0);
+ return 2;
}
static String[] getExtensions() {
diff --git a/tests/tests/hardware/src/android/hardware/cts/HardwareBufferTest.java b/tests/tests/hardware/src/android/hardware/cts/HardwareBufferTest.java
index 6276959..5ea845a 100644
--- a/tests/tests/hardware/src/android/hardware/cts/HardwareBufferTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/HardwareBufferTest.java
@@ -24,7 +24,6 @@
import android.opengl.EGLSurface;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
-import android.util.Pair;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -71,10 +70,8 @@
}, 0);
EGL14.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext);
- Pair<Integer, Integer> version = GlUtils.getVersion();
- sHasFloatBuffers = (version.first >= 3 && version.second >= 2) ||
- GlUtils.hasExtensions(
- "GL_OES_texture_half_float",
+ sHasFloatBuffers = GlUtils.getMajorVersion() >= 3 ||
+ GlUtils.hasExtensions("GL_OES_texture_half_float",
"GL_OES_texture_half_float_linear");
EGL14.eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);