Removes calls from Context to retrieve d3d9 surfaces

TRAC #22094

Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1450 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index af003f1..df35277 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -2145,18 +2145,14 @@
         mask &= ~GL_STENCIL_BUFFER_BIT;
         if (framebufferObject->getStencilbufferType() != GL_NONE)
         {
-            IDirect3DSurface9 *depthStencil = framebufferObject->getStencilbuffer()->getDepthStencil()->getSurface();
+            rx::RenderTarget *depthStencil = framebufferObject->getStencilbuffer()->getDepthStencil();
             if (!depthStencil)
             {
                 ERR("Depth stencil pointer unexpectedly null.");
                 return;
             }
-            
-            D3DSURFACE_DESC desc;
-            depthStencil->GetDesc(&desc);
-            depthStencil->Release();
 
-            unsigned int stencilSize = d3d9_gl::GetStencilSize(desc.Format);
+            unsigned int stencilSize = gl::GetStencilSize(depthStencil->getActualFormat());
             stencilUnmasked = (0x1 << stencilSize) - 1;
 
             if (stencilUnmasked != 0x0)