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 ...@@ -15,14 +15,13 @@ namespace rx
SurfaceImpl::SurfaceImpl(egl::Display *display, const egl::Config *config, SurfaceImpl::SurfaceImpl(egl::Display *display, const egl::Config *config,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat, EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle) EGLenum textureType)
: mDisplay(display), : mDisplay(display),
mConfig(config), mConfig(config),
mFixedSize(fixedSize), mFixedSize(fixedSize),
mPostSubBufferSupported(postSubBufferSupported), mPostSubBufferSupported(postSubBufferSupported),
mTextureFormat(textureFormat), mTextureFormat(textureFormat),
mTextureTarget(textureType), mTextureTarget(textureType)
mShareHandle(shareHandle)
{ {
} }
......
...@@ -26,7 +26,7 @@ class SurfaceImpl ...@@ -26,7 +26,7 @@ class SurfaceImpl
public: public:
SurfaceImpl(egl::Display *display, const egl::Config *config, SurfaceImpl(egl::Display *display, const egl::Config *config,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat, EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle); EGLenum textureType);
virtual ~SurfaceImpl(); virtual ~SurfaceImpl();
virtual egl::Error initialize() = 0; virtual egl::Error initialize() = 0;
...@@ -59,8 +59,7 @@ class SurfaceImpl ...@@ -59,8 +59,7 @@ class SurfaceImpl
mFixedSize(0), mFixedSize(0),
mPostSubBufferSupported(0), mPostSubBufferSupported(0),
mTextureFormat(EGL_NONE), mTextureFormat(EGL_NONE),
mTextureTarget(EGL_NONE), mTextureTarget(EGL_NONE)
mShareHandle(static_cast<EGLClientBuffer>(0))
{} {}
egl::Display *const mDisplay; egl::Display *const mDisplay;
...@@ -78,7 +77,6 @@ class SurfaceImpl ...@@ -78,7 +77,6 @@ class SurfaceImpl
EGLenum mTextureTarget; // Type of texture: 2D or no texture EGLenum mTextureTarget; // Type of texture: 2D or no texture
// EGLenum vgAlphaFormat; // Alpha format for OpenVG // EGLenum vgAlphaFormat; // Alpha format for OpenVG
// EGLenum vgColorSpace; // Color space for OpenVG // EGLenum vgColorSpace; // Color space for OpenVG
EGLClientBuffer mShareHandle;
private: private:
DISALLOW_COPY_AND_ASSIGN(SurfaceImpl); DISALLOW_COPY_AND_ASSIGN(SurfaceImpl);
......
...@@ -37,7 +37,7 @@ SurfaceD3D *SurfaceD3D::createFromWindow(RendererD3D *renderer, egl::Display *di ...@@ -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, SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat, EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
EGLenum textureType, EGLClientBuffer shareHandle, EGLNativeWindowType window) EGLenum textureType, EGLClientBuffer shareHandle, EGLNativeWindowType window)
: SurfaceImpl(display, config, fixedSize, postSubBufferSupported, textureFormat, textureType, shareHandle), : SurfaceImpl(display, config, fixedSize, postSubBufferSupported, textureFormat, textureType),
mRenderer(renderer), mRenderer(renderer),
mSwapChain(NULL), mSwapChain(NULL),
mSwapIntervalDirty(true), mSwapIntervalDirty(true),
...@@ -45,7 +45,8 @@ SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl:: ...@@ -45,7 +45,8 @@ SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::
mNativeWindow(window), mNativeWindow(window),
mWidth(width), mWidth(width),
mHeight(height), mHeight(height),
mSwapInterval(1) mSwapInterval(1),
mShareHandle(reinterpret_cast<HANDLE*>(shareHandle))
{ {
subclassWindow(); subclassWindow();
} }
...@@ -117,7 +118,7 @@ egl::Error SurfaceD3D::resetSwapChain() ...@@ -117,7 +118,7 @@ egl::Error SurfaceD3D::resetSwapChain()
height = mHeight; height = mHeight;
} }
mSwapChain = mRenderer->createSwapChain(mNativeWindow, static_cast<HANDLE>(mShareHandle), mSwapChain = mRenderer->createSwapChain(mNativeWindow, mShareHandle,
mConfig->renderTargetFormat, mConfig->renderTargetFormat,
mConfig->depthStencilFormat); mConfig->depthStencilFormat);
if (!mSwapChain) if (!mSwapChain)
......
...@@ -80,6 +80,8 @@ class SurfaceD3D : public SurfaceImpl ...@@ -80,6 +80,8 @@ class SurfaceD3D : public SurfaceImpl
EGLint mHeight; EGLint mHeight;
EGLint mSwapInterval; 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