Implemented EGL_NV_post_sub_buffer.
The change to the sample is just to demonstrate how I tested it. I won't check in the stuff under samples/.
It's not clear to me what eglPostSubBufferNV should do if EGL_POST_SUB_BUFFER_SUPPORTED_NV is false. At the moment it fails silently as though it was called on the wrong surface type:
"If <surface> is a back-buffered surface, then the requested portion
of the color buffer is copied to the native window associated with
that surface. If <surface> is a single-buffered window, pixmap, or
pbuffer surface, eglSwapBuffers and eglPostSubBufferNV have no
effect."
Review URL: http://codereview.appspot.com/5345050
git-svn-id: https://angleproject.googlecode.com/svn/trunk@902 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index c7d38b8..4f1e7c2 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -503,6 +503,7 @@
EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGLint *attribList)
{
const Config *configuration = mConfigSet.get(config);
+ EGLint postSubBufferSupported = EGL_FALSE;
if (attribList)
{
@@ -521,6 +522,9 @@
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
}
break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ postSubBufferSupported = attribList[1];
+ break;
case EGL_VG_COLORSPACE:
return error(EGL_BAD_MATCH, EGL_NO_SURFACE);
case EGL_VG_ALPHA_FORMAT:
@@ -544,7 +548,7 @@
return EGL_NO_SURFACE;
}
- Surface *surface = new Surface(this, configuration, window);
+ Surface *surface = new Surface(this, configuration, window, postSubBufferSupported);
if (!surface->initialize())
{
@@ -1039,7 +1043,8 @@
mExtensionString += "EGL_EXT_create_context_robustness ";
// ANGLE-specific extensions
- if (isd3d9ex) {
+ if (isd3d9ex)
+ {
mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer ";
}
@@ -1047,13 +1052,16 @@
if (swiftShader)
{
- mExtensionString += "EGL_ANGLE_software_display ";
+ mExtensionString += "EGL_ANGLE_software_display ";
}
- if (isd3d9ex) {
+ if (isd3d9ex)
+ {
mExtensionString += "EGL_ANGLE_surface_d3d_texture_2d_share_handle ";
}
+ mExtensionString += "EGL_NV_post_sub_buffer";
+
std::string::size_type end = mExtensionString.find_last_not_of(' ');
if (end != std::string::npos)
{