1 //
2 // Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // NativeWindow11Win32.h: Implementation of NativeWindow11 using win32 window APIs.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_
10 #define LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_
11 
12 #include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h"
13 
14 typedef interface IDCompositionDevice IDCompositionDevice;
15 typedef interface IDCompositionTarget IDCompositionTarget;
16 typedef interface IDCompositionVisual IDCompositionVisual;
17 
18 namespace rx
19 {
20 
21 class NativeWindow11Win32 : public NativeWindow11
22 {
23   public:
24     NativeWindow11Win32(EGLNativeWindowType window, bool hasAlpha, bool directComposition);
25     ~NativeWindow11Win32() override;
26 
27     bool initialize() override;
28     bool getClientRect(LPRECT rect) const override;
29     bool isIconic() const override;
30 
31     HRESULT createSwapChain(ID3D11Device *device,
32                             IDXGIFactory *factory,
33                             DXGI_FORMAT format,
34                             UINT width,
35                             UINT height,
36                             UINT samples,
37                             IDXGISwapChain **swapChain) override;
38 
39     void commitChange() override;
40 
41     static bool IsValidNativeWindow(EGLNativeWindowType window);
42 
43   private:
44     bool mDirectComposition;
45     bool mHasAlpha;
46     IDCompositionDevice *mDevice;
47     IDCompositionTarget *mCompositionTarget;
48     IDCompositionVisual *mVisual;
49 };
50 
51 }  // namespace rx
52 
53 #endif  // LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_
54