summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip
Roll back to ANGLE/2845
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)
{
}