summaryrefslogtreecommitdiffstats
path: root/opengl/system/egl/egl.cpp
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2016-01-29 16:02:25 -0800
committerPrathmesh Prabhu <pprabhu@google.com>2016-02-11 17:10:57 -0800
commitb95d6e60ad4ef0b5f6d036ac6810c3fcb044ba37 (patch)
tree92b013f0c951ded6869d1325d5c9e9ea32db8311 /opengl/system/egl/egl.cpp
parent64cd133e6475b457778cc7596f0cfb90fa24cfc6 (diff)
downloaddevice_generic_goldfish-b95d6e60ad4ef0b5f6d036ac6810c3fcb044ba37.tar.gz
device_generic_goldfish-b95d6e60ad4ef0b5f6d036ac6810c3fcb044ba37.tar.bz2
device_generic_goldfish-b95d6e60ad4ef0b5f6d036ac6810c3fcb044ba37.zip
Clean up minor opengl errors/warnings.
There are always disconcerting messages printed to logcat whenever developing apps on the emulator. glUtilsParamSize and other functions often fail with "unknow param 0x00..." These are missing GLenums and types that for some reason are not in glUtils.cpp in OpenglCodecCommon. There also has been a long-standing warning that eglSurfaceAttrib is not implemented. It seems we don't need to implement that to get things done, so we will give a no-op implementation that suppresses the warning. Change-Id: Ie44fbdd10422dd824c9c3c3ea70c386023663969 (cherry picked from commit 215bb77438519bcf1b952e4d5b621abb0bf3ed82)
Diffstat (limited to 'opengl/system/egl/egl.cpp')
-rw-r--r--opengl/system/egl/egl.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/opengl/system/egl/egl.cpp b/opengl/system/egl/egl.cpp
index 52c39a20..22a42681 100644
--- a/opengl/system/egl/egl.cpp
+++ b/opengl/system/egl/egl.cpp
@@ -817,13 +817,29 @@ EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGL
EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
{
- //TODO
- (void)dpy;
- (void)surface;
- (void)attribute;
+ // Right now we don't do anything when using host GPU.
+ // This is purely just to pass the data through
+ // without issuing a warning. We may benefit from validating the
+ // display and surface for debug purposes.
+ // TODO: Find cases where we actually need to do something.
+ VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
+ VALIDATE_SURFACE_RETURN(surface, EGL_FALSE);
+ if (surface == EGL_NO_SURFACE) {
+ setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+ }
+
(void)value;
- ALOGW("%s not implemented", __FUNCTION__);
- return 0;
+
+ switch (attribute) {
+ case EGL_MIPMAP_LEVEL:
+ case EGL_MULTISAMPLE_RESOLVE:
+ case EGL_SWAP_BEHAVIOR:
+ return true;
+ break;
+ default:
+ ALOGW("%s: attr=0x%x not implemented", __FUNCTION__, attribute);
+ }
+ return false;
}
EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface eglSurface, EGLint buffer)