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 // DisplayVkXcb.h: 7 // Defines the class interface for DisplayVkXcb, implementing DisplayVk for X via XCB. 8 // 9 10 #ifndef LIBANGLE_RENDERER_VULKAN_XCB_DISPLAYVKXCB_H_ 11 #define LIBANGLE_RENDERER_VULKAN_XCB_DISPLAYVKXCB_H_ 12 13 #include "libANGLE/renderer/vulkan/linux/DisplayVkLinux.h" 14 15 struct xcb_connection_t; 16 17 namespace rx 18 { 19 20 class DisplayVkXcb : public DisplayVkLinux 21 { 22 public: 23 DisplayVkXcb(const egl::DisplayState &state); 24 25 egl::Error initialize(egl::Display *display) override; 26 void terminate() override; 27 28 bool isValidNativeWindow(EGLNativeWindowType window) const override; 29 30 SurfaceImpl *createWindowSurfaceVk(const egl::SurfaceState &state, 31 EGLNativeWindowType window) override; 32 33 egl::ConfigSet generateConfigs() override; 34 void checkConfigSupport(egl::Config *config) override; 35 36 const char *getWSIExtension() const override; 37 angle::Result waitNativeImpl() override; 38 isX11()39 bool isX11() const override { return true; } 40 41 private: 42 xcb_connection_t *mXcbConnection; 43 // If there is no X Display, obviously it's impossible to connect to it with Xcb, 44 // so rendering to windows is not supported, but rendering to pbuffers is still supported. 45 // This mode is used in headless ozone testing. 46 bool mHasXDisplay; 47 }; 48 49 } // namespace rx 50 51 #endif // LIBANGLE_RENDERER_VULKAN_XCB_DISPLAYVKXCB_H_ 52