summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/eglApi.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-11-19 18:04:43 -0800
committerJamie Gennis <jgennis@google.com>2011-11-21 14:37:29 -0800
commit87f3265bb082160efdfdfb87a79698c67ebad447 (patch)
treea9eb05cf1cb1a6d59d1dafe806c843aee10daa76 /opengl/libs/EGL/eglApi.cpp
parentc10a94c4b8b42ef75168ad140fdb97d6cca3d2eb (diff)
downloadframeworks_base-87f3265bb082160efdfdfb87a79698c67ebad447.zip
frameworks_base-87f3265bb082160efdfdfb87a79698c67ebad447.tar.gz
frameworks_base-87f3265bb082160efdfdfb87a79698c67ebad447.tar.bz2
EGL: default to swap interval 1
This change explicitly sets swap interval 1 on the window when an EGLSurface is created to render to it. Change-Id: I91eb29dbee3ae4a55076b921f084d503fbe94e03
Diffstat (limited to 'opengl/libs/EGL/eglApi.cpp')
-rw-r--r--opengl/libs/EGL/eglApi.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 2237eb6..a63d5b0 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -370,6 +370,11 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
}
}
+ // the EGL spec requires that a new EGLSurface default to swap interval
+ // 1, so explicitly set that on the window here.
+ ANativeWindow* anw = reinterpret_cast<ANativeWindow*>(window);
+ anw->setSwapInterval(anw, 1);
+
EGLSurface surface = cnx->egl.eglCreateWindowSurface(
iDpy, iConfig, window, attrib_list);
if (surface != EGL_NO_SURFACE) {