Add support for eglCreatePbufferFromClientBuffer, taking as input a D3D share handle corresponding to the enum EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE. No spec as of yet, but it does the obvious thing.
BUG=129
TEST=
Review URL: http://codereview.appspot.com/4325048
git-svn-id: https://angleproject.googlecode.com/svn/trunk@650 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index 6cbb068..338eefa 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -451,12 +451,19 @@
}
Surface *surface = new Surface(this, configuration, window);
+
+ if (!surface->initialize())
+ {
+ delete surface;
+ return EGL_NO_SURFACE;
+ }
+
mSurfaceSet.insert(surface);
return success(surface);
}
-EGLSurface Display::createOffscreenSurface(EGLConfig config, const EGLint *attribList)
+EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle, const EGLint *attribList)
{
EGLint width = 0, height = 0;
EGLenum textureFormat = EGL_NO_TEXTURE;
@@ -550,7 +557,14 @@
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
}
- Surface *surface = new Surface(this, configuration, width, height, textureFormat, textureTarget);
+ Surface *surface = new Surface(this, configuration, shareHandle, width, height, textureFormat, textureTarget);
+
+ if (!surface->initialize())
+ {
+ delete surface;
+ return EGL_NO_SURFACE;
+ }
+
mSurfaceSet.insert(surface);
return success(surface);