1 // 2 // Copyright 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 // NativeWindow11WinRT.h: NativeWindow base class for managing IInspectable native window types. 8 9 #ifndef LIBANGLE_RENDERER_D3D_D3D11_WINRT_NATIVEWINDOW11WINRT_H_ 10 #define LIBANGLE_RENDERER_D3D_D3D11_WINRT_NATIVEWINDOW11WINRT_H_ 11 12 #include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h" 13 14 #include <windows.applicationmodel.core.h> 15 #include <wrl.h> 16 #include <wrl/wrappers/corewrappers.h> 17 #include <memory> 18 19 namespace rx 20 { 21 class InspectableNativeWindow; 22 23 class NativeWindow11WinRT : public NativeWindow11 24 { 25 public: 26 NativeWindow11WinRT(EGLNativeWindowType window, bool hasAlpha); 27 28 bool initialize() override; 29 bool getClientRect(LPRECT rect) const override; 30 bool isIconic() const override; 31 32 HRESULT createSwapChain(ID3D11Device *device, 33 IDXGIFactory *factory, 34 DXGI_FORMAT format, 35 UINT width, 36 UINT height, 37 UINT samples, 38 IDXGISwapChain **swapChain) override; 39 40 void commitChange() override; 41 42 static bool IsValidNativeWindow(EGLNativeWindowType window); 43 44 private: 45 bool mHasAlpha; 46 std::shared_ptr<InspectableNativeWindow> mImpl; 47 }; 48 49 } // namespace rx 50 51 #endif // LIBANGLE_RENDERER_D3D_D3D11_WINRT_NATIVEWINDOW11WINRT_H_ 52