20 ~GraphiteDawnD3D12WindowContext_win()
override;
30GraphiteDawnD3D12WindowContext_win::GraphiteDawnD3D12WindowContext_win(HWND hwnd,
34 GetClientRect(hwnd, &
rect);
38GraphiteDawnD3D12WindowContext_win::~GraphiteDawnD3D12WindowContext_win() {
39 this->destroyContext();
42bool GraphiteDawnD3D12WindowContext_win::onInitializeContext() {
45 auto device = this->createDevice(wgpu::BackendType::D3D12);
51 wgpu::SurfaceDescriptorFromWindowsHWND surfaceChainedDesc;
52 surfaceChainedDesc.hwnd = fWindow;
53 surfaceChainedDesc.hinstance = GetModuleHandle(
nullptr);
54 wgpu::SurfaceDescriptor surfaceDesc;
55 surfaceDesc.nextInChain = &surfaceChainedDesc;
57 auto surface = wgpu::Instance(fInstance->Get()).CreateSurface(&surfaceDesc);
63 fDevice = std::move(
device);
65 fSwapChain = this->createSwapChain();
70void GraphiteDawnD3D12WindowContext_win::onDestroyContext() {}
72void GraphiteDawnD3D12WindowContext_win::resize(
int w,
int h) {
73 fSwapChain = this->createSwapChain();
81 std::unique_ptr<WindowContext> ctx(
new GraphiteDawnD3D12WindowContext_win(hwnd,
params));
82 if (!ctx->isValid()) {
virtual void resize(int w, int h)=0
virtual void onDestroyContext()=0
virtual bool onInitializeContext()=0
const EmbeddedViewParams * params
sk_sp< SkBlender > blender SkRect rect
std::unique_ptr< WindowContext > MakeGraphiteDawnD3D12ForWin(HWND hwnd, const DisplayParams ¶ms)