a800ec96f7
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>
53 lines
1.2 KiB
C++
53 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_mac_DEFINED
|
|
#define WindowContextFactory_mac_DEFINED
|
|
|
|
#include "tools/sk_app/WindowContext.h"
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace sk_app {
|
|
|
|
struct DisplayParams;
|
|
|
|
namespace window_context_factory {
|
|
|
|
struct MacWindowInfo {
|
|
NSView* fMainView;
|
|
};
|
|
|
|
#ifdef SK_VULKAN
|
|
std::unique_ptr<WindowContext> MakeVulkanForMac(const MacWindowInfo&, const DisplayParams&);
|
|
#else
|
|
inline std::unique_ptr<WindowContext> MakeVulkanForMac(const MacWindowInfo&, const DisplayParams&) {
|
|
// No Vulkan support on Mac.
|
|
return nullptr;
|
|
}
|
|
#endif
|
|
|
|
std::unique_ptr<WindowContext> MakeGLForMac(const MacWindowInfo&, const DisplayParams&);
|
|
|
|
#ifdef SK_DAWN
|
|
std::unique_ptr<WindowContext> MakeDawnMTLForMac(const MacWindowInfo&, const DisplayParams&);
|
|
#endif
|
|
|
|
std::unique_ptr<WindowContext> MakeRasterForMac(const MacWindowInfo&, const DisplayParams&);
|
|
#ifdef SK_METAL
|
|
std::unique_ptr<WindowContext> MakeMetalForMac(const MacWindowInfo&, const DisplayParams&);
|
|
#endif
|
|
|
|
} // namespace window_context_factory
|
|
|
|
} // namespace sk_app
|
|
|
|
#endif
|