Skip to content

Commit e8ba2ab

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "add a way to access the version string of the h/w implementation of EGL" into ics-mr1
2 parents 865b980 + cadd325 commit e8ba2ab

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

opengl/libs/EGL/eglApi.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ using namespace android;
4949

5050
// ----------------------------------------------------------------------------
5151

52+
#define EGL_VERSION_HW_ANDROID 0x3143
53+
5254
struct extention_map_t {
5355
const char* name;
5456
__eglMustCastToProperFunctionPointerType address;
@@ -972,6 +974,12 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name)
972974
return dp->getExtensionString();
973975
case EGL_CLIENT_APIS:
974976
return dp->getClientApiString();
977+
case EGL_VERSION_HW_ANDROID: {
978+
if (gEGLImpl[IMPL_HARDWARE].dso) {
979+
return dp->disp[IMPL_HARDWARE].queryString.version;
980+
}
981+
return dp->disp[IMPL_SOFTWARE].queryString.version;
982+
}
975983
}
976984
return setError(EGL_BAD_PARAMETER, (const char *)0);
977985
}

opengl/specs/README

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ for use by Android extensions.
99
0x3140 EGL_ANDROID_image_native_buffer
1010
0x3141 (unused)
1111
0x3142 EGL_ANDROID_recordable
12-
0x3143 - 0x314F (unused)
12+
0x3143 EGL_VERSION_HW_ANDROID (internal use)
13+
0x3144 - 0x314F (unused)

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
#define AID_GRAPHICS 1003
6666
#endif
6767

68+
#define EGL_VERSION_HW_ANDROID 0x3143
69+
6870
#define DISPLAY_COUNT 1
6971

7072
namespace android {
@@ -1527,7 +1529,7 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
15271529
* Dump the layers in the purgatory
15281530
*/
15291531

1530-
const size_t purgatorySize = mLayerPurgatory.size();
1532+
const size_t purgatorySize = mLayerPurgatory.size();
15311533
snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
15321534
result.append(buffer);
15331535
for (size_t i=0 ; i<purgatorySize ; i++) {
@@ -1548,6 +1550,12 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
15481550
extensions.getRenderer(),
15491551
extensions.getVersion());
15501552
result.append(buffer);
1553+
1554+
snprintf(buffer, SIZE, "EGL : %s\n",
1555+
eglQueryString(graphicPlane(0).getEGLDisplay(),
1556+
EGL_VERSION_HW_ANDROID));
1557+
result.append(buffer);
1558+
15511559
snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
15521560
result.append(buffer);
15531561

0 commit comments

Comments
 (0)