summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp')
-rwxr-xr-xgfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp44
1 files changed, 7 insertions, 37 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
index 8696ab0d7..3c02c4a68 100755
--- a/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
@@ -26,8 +26,7 @@ SurfaceD3D::SurfaceD3D(const egl::SurfaceState &state,
egl::Display *display,
const egl::Config *config,
EGLNativeWindowType window,
- EGLenum buftype,
- EGLClientBuffer clientBuffer,
+ EGLClientBuffer shareHandle,
const egl::AttributeMap &attribs)
: SurfaceImpl(state),
mRenderer(renderer),
@@ -42,39 +41,19 @@ SurfaceD3D::SurfaceD3D(const egl::SurfaceState &state,
mWidth(static_cast<EGLint>(attribs.get(EGL_WIDTH, 0))),
mHeight(static_cast<EGLint>(attribs.get(EGL_HEIGHT, 0))),
mSwapInterval(1),
- mShareHandle(0),
- mD3DTexture(nullptr)
+ mShareHandle(reinterpret_cast<HANDLE *>(shareHandle))
{
if (window != nullptr && !mFixedSize)
{
mWidth = -1;
mHeight = -1;
}
-
- switch (buftype)
- {
- case EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE:
- mShareHandle = static_cast<HANDLE>(clientBuffer);
- break;
-
- case EGL_D3D_TEXTURE_ANGLE:
- mD3DTexture = static_cast<IUnknown *>(clientBuffer);
- ASSERT(mD3DTexture != nullptr);
- mD3DTexture->AddRef();
- mRenderer->getD3DTextureInfo(mD3DTexture, &mWidth, &mHeight, &mRenderTargetFormat);
- mDepthStencilFormat = GL_NONE;
- break;
-
- default:
- break;
- }
}
SurfaceD3D::~SurfaceD3D()
{
releaseSwapChain();
SafeDelete(mNativeWindow);
- SafeRelease(mD3DTexture);
}
void SurfaceD3D::releaseSwapChain()
@@ -143,8 +122,8 @@ egl::Error SurfaceD3D::resetSwapChain()
height = mHeight;
}
- mSwapChain = mRenderer->createSwapChain(mNativeWindow, mShareHandle, mD3DTexture,
- mRenderTargetFormat, mDepthStencilFormat, mOrientation);
+ mSwapChain = mRenderer->createSwapChain(mNativeWindow, mShareHandle, mRenderTargetFormat,
+ mDepthStencilFormat, mOrientation);
if (!mSwapChain)
{
return egl::Error(EGL_BAD_ALLOC);
@@ -362,14 +341,7 @@ WindowSurfaceD3D::WindowSurfaceD3D(const egl::SurfaceState &state,
const egl::Config *config,
EGLNativeWindowType window,
const egl::AttributeMap &attribs)
- : SurfaceD3D(state,
- renderer,
- display,
- config,
- window,
- 0,
- static_cast<EGLClientBuffer>(0),
- attribs)
+ : SurfaceD3D(state, renderer, display, config, window, static_cast<EGLClientBuffer>(0), attribs)
{
}
@@ -381,16 +353,14 @@ PbufferSurfaceD3D::PbufferSurfaceD3D(const egl::SurfaceState &state,
RendererD3D *renderer,
egl::Display *display,
const egl::Config *config,
- EGLenum buftype,
- EGLClientBuffer clientBuffer,
+ EGLClientBuffer shareHandle,
const egl::AttributeMap &attribs)
: SurfaceD3D(state,
renderer,
display,
config,
static_cast<EGLNativeWindowType>(0),
- buftype,
- clientBuffer,
+ shareHandle,
attribs)
{
}