2016-07-26 19:02:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WindowContextFactory_unix_DEFINED
|
|
|
|
#define WindowContextFactory_unix_DEFINED
|
|
|
|
|
2019-12-04 14:57:48 +00:00
|
|
|
// webgpu_cpp.h and X.h don't get along. Include this first, before X11 defines None, Success etc.
|
2019-07-18 15:43:45 +00:00
|
|
|
#ifdef SK_DAWN
|
2019-12-04 14:57:48 +00:00
|
|
|
#include "dawn/webgpu_cpp.h"
|
2019-07-18 15:43:45 +00:00
|
|
|
#endif
|
2016-07-26 19:02:50 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <GL/glx.h>
|
2019-08-01 20:21:49 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2016-07-26 19:02:50 +00:00
|
|
|
typedef Window XWindow;
|
|
|
|
|
|
|
|
namespace sk_app {
|
|
|
|
|
|
|
|
class WindowContext;
|
|
|
|
struct DisplayParams;
|
|
|
|
|
|
|
|
namespace window_context_factory {
|
|
|
|
|
|
|
|
struct XlibWindowInfo {
|
|
|
|
Display* fDisplay;
|
|
|
|
XWindow fWindow;
|
2017-03-08 15:50:21 +00:00
|
|
|
GLXFBConfig* fFBConfig;
|
2016-07-26 19:02:50 +00:00
|
|
|
XVisualInfo* fVisualInfo;
|
2017-02-24 20:22:53 +00:00
|
|
|
int fWidth;
|
|
|
|
int fHeight;
|
2016-07-26 19:02:50 +00:00
|
|
|
};
|
|
|
|
|
2019-08-01 20:21:49 +00:00
|
|
|
std::unique_ptr<WindowContext> MakeVulkanForXlib(const XlibWindowInfo&, const DisplayParams&);
|
2016-07-26 19:02:50 +00:00
|
|
|
|
2019-08-01 20:21:49 +00:00
|
|
|
std::unique_ptr<WindowContext> MakeGLForXlib(const XlibWindowInfo&, const DisplayParams&);
|
2016-07-26 19:02:50 +00:00
|
|
|
|
2019-08-02 19:04:52 +00:00
|
|
|
#ifdef SK_DAWN
|
|
|
|
std::unique_ptr<WindowContext> MakeDawnVulkanForXlib(const XlibWindowInfo&, const DisplayParams&);
|
|
|
|
#endif
|
|
|
|
|
2019-08-01 20:21:49 +00:00
|
|
|
std::unique_ptr<WindowContext> MakeRasterForXlib(const XlibWindowInfo&, const DisplayParams&);
|
2016-07-26 19:56:32 +00:00
|
|
|
|
2016-07-26 19:02:50 +00:00
|
|
|
} // namespace window_context_factory
|
|
|
|
|
|
|
|
} // namespace sk_app
|
|
|
|
|
|
|
|
#endif
|