diff options
author | Jamie Gennis <jgennis@google.com> | 2011-07-01 13:12:07 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-07-11 12:31:45 -0700 |
commit | 97eae025ad857e33dce5b3d1d4fd5fe5813d2a80 (patch) | |
tree | e383a743c76a50a1d201ba9d8b34606c661b6787 /opengl | |
parent | d44e1b6033eed29718f2e7e3540e4884929941a5 (diff) | |
download | frameworks_base-97eae025ad857e33dce5b3d1d4fd5fe5813d2a80.zip frameworks_base-97eae025ad857e33dce5b3d1d4fd5fe5813d2a80.tar.gz frameworks_base-97eae025ad857e33dce5b3d1d4fd5fe5813d2a80.tar.bz2 |
EGL: fix the ANativeWindow size/fmt override
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface. The new behavior
is to leave the size untouched when overriding the format. The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.
It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.
Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.
Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 7d5d010..ba5d29a 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -367,7 +367,12 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, if (cnx->egl.eglGetConfigAttrib(iDpy, iConfig, EGL_NATIVE_VISUAL_ID, &format)) { if (format != 0) { - native_window_set_buffers_geometry(window, 0, 0, format); + int err = native_window_set_buffers_format(window, format); + if (err != 0) { + LOGE("error setting native window pixel format: %s (%d)", + strerror(-err), err); + return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE); + } } } |