diff options
Diffstat (limited to 'src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h')
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h | 97 |
1 files changed, 60 insertions, 37 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h index 67d408ddd9..01d2573244 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h @@ -10,7 +10,7 @@ #define LIBANGLE_RENDERER_D3D_SURFACED3D_H_ #include "libANGLE/renderer/SurfaceImpl.h" -#include "libANGLE/renderer/d3d/d3d11/NativeWindow.h" +#include "libANGLE/renderer/d3d/NativeWindowD3D.h" namespace egl { @@ -25,28 +25,22 @@ class RendererD3D; class SurfaceD3D : public SurfaceImpl { public: - static SurfaceD3D *createFromWindow(RendererD3D *renderer, - egl::Display *display, - const egl::Config *config, - EGLNativeWindowType window, - EGLint fixedSize, - EGLint directComposition, - EGLint width, - EGLint height, - EGLint orientation); - static SurfaceD3D *createOffscreen(RendererD3D *renderer, egl::Display *display, const egl::Config *config, - EGLClientBuffer shareHandle, EGLint width, EGLint height); ~SurfaceD3D() override; void releaseSwapChain(); - egl::Error initialize() override; - FramebufferImpl *createDefaultFramebuffer(const gl::Framebuffer::Data &data) override; + egl::Error initialize(const egl::Display *display) override; + FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; - egl::Error swap() override; - egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; + egl::Error swap(const gl::Context *context) override; + egl::Error postSubBuffer(const gl::Context *context, + EGLint x, + EGLint y, + EGLint width, + EGLint height) override; egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; egl::Error releaseTexImage(EGLint buffer) override; + egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override; void setSwapInterval(EGLint interval) override; EGLint getWidth() const override; @@ -58,29 +52,35 @@ class SurfaceD3D : public SurfaceImpl // D3D implementations SwapChainD3D *getSwapChain() const; - egl::Error resetSwapChain(); + egl::Error resetSwapChain(const egl::Display *display); - // Returns true if swapchain changed due to resize or interval update - bool checkForOutOfDateSwapChain(); + egl::Error checkForOutOfDateSwapChain(const gl::Context *context); - gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + gl::Error getAttachmentRenderTarget(const gl::Context *context, + GLenum binding, + const gl::ImageIndex &imageIndex, FramebufferAttachmentRenderTarget **rtOut) override; - private: - SurfaceD3D(RendererD3D *renderer, + protected: + SurfaceD3D(const egl::SurfaceState &state, + RendererD3D *renderer, egl::Display *display, - const egl::Config *config, - EGLint width, - EGLint height, - EGLint fixedSize, - EGLint orientation, - EGLint directComposition, - EGLClientBuffer shareHandle, - EGLNativeWindowType window); - - egl::Error swapRect(EGLint x, EGLint y, EGLint width, EGLint height); - egl::Error resetSwapChain(int backbufferWidth, int backbufferHeight); - egl::Error resizeSwapChain(int backbufferWidth, int backbufferHeight); + EGLNativeWindowType window, + EGLenum buftype, + EGLClientBuffer clientBuffer, + const egl::AttributeMap &attribs); + + egl::Error swapRect(const gl::Context *context, + EGLint x, + EGLint y, + EGLint width, + EGLint height); + egl::Error resetSwapChain(const gl::Context *context, + int backbufferWidth, + int backbufferHeight); + egl::Error resizeSwapChain(const gl::Context *context, + int backbufferWidth, + int backbufferHeight); void subclassWindow(); void unsubclassWindow(); @@ -96,18 +96,41 @@ class SurfaceD3D : public SurfaceImpl SwapChainD3D *mSwapChain; bool mSwapIntervalDirty; - bool mWindowSubclassed; // Indicates whether we successfully subclassed mWindow for WM_RESIZE hooking + bool mWindowSubclassed; // Indicates whether we successfully subclassed mWindow for WM_RESIZE hooking - NativeWindow mNativeWindow; // Handler for the Window that the surface is created for. + NativeWindowD3D *mNativeWindow; // Handler for the Window that the surface is created for. EGLint mWidth; EGLint mHeight; EGLint mSwapInterval; HANDLE mShareHandle; + IUnknown *mD3DTexture; }; +class WindowSurfaceD3D : public SurfaceD3D +{ + public: + WindowSurfaceD3D(const egl::SurfaceState &state, + RendererD3D *renderer, + egl::Display *display, + EGLNativeWindowType window, + const egl::AttributeMap &attribs); + ~WindowSurfaceD3D() override; +}; -} +class PbufferSurfaceD3D : public SurfaceD3D +{ + public: + PbufferSurfaceD3D(const egl::SurfaceState &state, + RendererD3D *renderer, + egl::Display *display, + EGLenum buftype, + EGLClientBuffer clientBuffer, + const egl::AttributeMap &attribs); + ~PbufferSurfaceD3D() override; +}; + +} // namespace rx #endif // LIBANGLE_RENDERER_D3D_SURFACED3D_H_ |