Implemented D3D11 offscreen texture share handle support.

Chrome uses this to for composited rendering. Currently Chrome uses a BGRA texture format
for surface sharing, so we must create our offscreen textures this way.
See EGL_ANGLE_query_surface_pointer, EGL_ANGLE_surface_d3d_texture_2d_share_handle,
EGL_ANGLE_d3d_share_handle_client_buffer.

TRAC #22410

Signed-off-by: Geoff Lang
Signed-off-by: Daniel Koch
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1772 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 95a3fc4..de1ea82 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -41,6 +41,7 @@
 {
 static const DXGI_FORMAT RenderTargetFormats[] =
     {
+        DXGI_FORMAT_B8G8R8A8_UNORM,
         DXGI_FORMAT_R8G8B8A8_UNORM
     };
 
@@ -1892,11 +1893,10 @@
 
 bool Renderer11::getShareHandleSupport() const
 {
-    // TODO
-    // UNIMPLEMENTED();
-
+    // We only currently support share handles with BGRA surfaces, because
+    // chrome needs BGRA. Once chrome fixes this, we should always support them.
     // PIX doesn't seem to support using share handles, so disable them.
-    return false && !gl::perfActive();
+    return getBGRATextureSupport() && !gl::perfActive();
 }
 
 bool Renderer11::getDerivativeInstructionSupport() const