21 ~GraphiteDawnVulkanWindowContext_unix()
override;
32GraphiteDawnVulkanWindowContext_unix::GraphiteDawnVulkanWindowContext_unix(
36 , fDisplay(
info.fDisplay)
37 , fWindow(
info.fWindow) {
40 unsigned int border_width, depth;
42 XGetGeometry(fDisplay, fWindow, &
root, &
x, &
y, &
width, &
height, &border_width, &depth);
46GraphiteDawnVulkanWindowContext_unix::~GraphiteDawnVulkanWindowContext_unix() {
47 this->destroyContext();
50bool GraphiteDawnVulkanWindowContext_unix::onInitializeContext() {
53 auto device = this->createDevice(wgpu::BackendType::Vulkan);
59 wgpu::SurfaceDescriptorFromXlibWindow surfaceChainedDesc;
60 surfaceChainedDesc.display = fDisplay;
61 surfaceChainedDesc.window = fWindow;
63 wgpu::SurfaceDescriptor surfaceDesc;
64 surfaceDesc.nextInChain = &surfaceChainedDesc;
66 auto surface = wgpu::Instance(fInstance->Get()).CreateSurface(&surfaceDesc);
72 fDevice = std::move(
device);
74 fSwapChain = this->createSwapChain();
79void GraphiteDawnVulkanWindowContext_unix::onDestroyContext() {}
81void GraphiteDawnVulkanWindowContext_unix::resize(
int w,
int h) {
82 fSwapChain = this->createSwapChain();
91 std::unique_ptr<WindowContext> ctx(
new GraphiteDawnVulkanWindowContext_unix(
info,
params));
92 if (!ctx->isValid()) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
virtual void resize(int w, int h)=0
virtual void onDestroyContext()=0
virtual bool onInitializeContext()=0
const EmbeddedViewParams * params
std::unique_ptr< WindowContext > MakeGraphiteDawnVulkanForXlib(const XlibWindowInfo &info, const DisplayParams ¶ms)