skia2/tools/sk_app/unix/WindowContextFactory_unix.h
Stephen White a800ec96f7 Dawn: implement sk_app window contexts for all backends.
Implement Window contexts for D3D12, Metal and Vulkan, as well as
a base class for all of them (DawnWindowContext).
Implement WSI, swap chains and external textures for all backends.
Add Dawn support to Viewer app.

Change-Id: I9368eae8d43594821aa1edd9fd559c8a9ba30066
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228060
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-08-02 19:51:02 +00:00

54 lines
1.2 KiB
C++

/*
* 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
// dawncpp.h and X.h don't get along. Include this first, before X11 defines None, Success etc.
#ifdef SK_DAWN
#include "dawn/dawncpp.h"
#endif
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <memory>
typedef Window XWindow;
namespace sk_app {
class WindowContext;
struct DisplayParams;
namespace window_context_factory {
struct XlibWindowInfo {
Display* fDisplay;
XWindow fWindow;
GLXFBConfig* fFBConfig;
XVisualInfo* fVisualInfo;
int fWidth;
int fHeight;
};
std::unique_ptr<WindowContext> MakeVulkanForXlib(const XlibWindowInfo&, const DisplayParams&);
std::unique_ptr<WindowContext> MakeGLForXlib(const XlibWindowInfo&, const DisplayParams&);
#ifdef SK_DAWN
std::unique_ptr<WindowContext> MakeDawnVulkanForXlib(const XlibWindowInfo&, const DisplayParams&);
#endif
std::unique_ptr<WindowContext> MakeRasterForXlib(const XlibWindowInfo&, const DisplayParams&);
} // namespace window_context_factory
} // namespace sk_app
#endif