Commit ba887d90 by Geoff Lang

Store mShareHandle in SurfaceD3D.

The type of the share handle depends on the implementation. BUG=angle:658 Change-Id: Id801f3d0c1e3def7cae5cbd88e7a7032b2f6d8fa Reviewed-on: https://chromium-review.googlesource.com/242050Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 45b4e74a
......@@ -15,14 +15,13 @@ namespace rx
SurfaceImpl::SurfaceImpl(egl::Display *display, const egl::Config *config,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle)
EGLenum textureType)
: mDisplay(display),
mConfig(config),
mFixedSize(fixedSize),
mPostSubBufferSupported(postSubBufferSupported),
mTextureFormat(textureFormat),
mTextureTarget(textureType),
mShareHandle(shareHandle)
mTextureTarget(textureType)
{
}
......
......@@ -26,7 +26,7 @@ class SurfaceImpl
public:
SurfaceImpl(egl::Display *display, const egl::Config *config,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle);
EGLenum textureType);
virtual ~SurfaceImpl();
virtual egl::Error initialize() = 0;
......@@ -59,8 +59,7 @@ class SurfaceImpl
mFixedSize(0),
mPostSubBufferSupported(0),
mTextureFormat(EGL_NONE),
mTextureTarget(EGL_NONE),
mShareHandle(static_cast<EGLClientBuffer>(0))
mTextureTarget(EGL_NONE)
{}
egl::Display *const mDisplay;
......@@ -78,7 +77,6 @@ class SurfaceImpl
EGLenum mTextureTarget; // Type of texture: 2D or no texture
// EGLenum vgAlphaFormat; // Alpha format for OpenVG
// EGLenum vgColorSpace; // Color space for OpenVG
EGLClientBuffer mShareHandle;
private:
DISALLOW_COPY_AND_ASSIGN(SurfaceImpl);
......
......@@ -37,7 +37,7 @@ SurfaceD3D *SurfaceD3D::createFromWindow(RendererD3D *renderer, egl::Display *di
SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle, EGLNativeWindowType window)
: SurfaceImpl(display, config, fixedSize, postSubBufferSupported, textureFormat, textureType, shareHandle),
: SurfaceImpl(display, config, fixedSize, postSubBufferSupported, textureFormat, textureType),
mRenderer(renderer),
mSwapChain(NULL),
mSwapIntervalDirty(true),
......@@ -45,7 +45,8 @@ SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::
mNativeWindow(window),
mWidth(width),
mHeight(height),
mSwapInterval(1)
mSwapInterval(1),
mShareHandle(reinterpret_cast<HANDLE*>(shareHandle))
{
subclassWindow();
}
......@@ -117,7 +118,7 @@ egl::Error SurfaceD3D::resetSwapChain()
height = mHeight;
}
mSwapChain = mRenderer->createSwapChain(mNativeWindow, static_cast<HANDLE>(mShareHandle),
mSwapChain = mRenderer->createSwapChain(mNativeWindow, mShareHandle,
mConfig->renderTargetFormat,
mConfig->depthStencilFormat);
if (!mSwapChain)
......
......@@ -80,6 +80,8 @@ class SurfaceD3D : public SurfaceImpl
EGLint mHeight;
EGLint mSwapInterval;
HANDLE mShareHandle;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment