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_mac_DEFINED
|
|
|
|
#define WindowContextFactory_mac_DEFINED
|
|
|
|
|
2019-01-28 19:46:04 +00:00
|
|
|
#include <Cocoa/Cocoa.h>
|
2016-08-04 19:30:31 +00:00
|
|
|
|
2016-07-26 19:02:50 +00:00
|
|
|
namespace sk_app {
|
|
|
|
|
|
|
|
class WindowContext;
|
|
|
|
struct DisplayParams;
|
|
|
|
|
|
|
|
namespace window_context_factory {
|
|
|
|
|
|
|
|
struct MacWindowInfo {
|
2019-01-28 19:46:04 +00:00
|
|
|
NSView* fMainView;
|
2016-07-26 19:02:50 +00:00
|
|
|
};
|
|
|
|
|
2019-02-14 19:07:46 +00:00
|
|
|
#ifdef SK_VULKAN
|
|
|
|
WindowContext* NewVulkanForMac(const MacWindowInfo&, const DisplayParams&);
|
|
|
|
#else
|
2016-07-26 19:02:50 +00:00
|
|
|
inline WindowContext* NewVulkanForMac(const MacWindowInfo&, const DisplayParams&) {
|
|
|
|
// No Vulkan support on Mac.
|
|
|
|
return nullptr;
|
|
|
|
}
|
2019-02-14 19:07:46 +00:00
|
|
|
#endif
|
2016-07-26 19:02:50 +00:00
|
|
|
|
|
|
|
WindowContext* NewGLForMac(const MacWindowInfo&, const DisplayParams&);
|
|
|
|
|
2016-08-09 17:53:11 +00:00
|
|
|
WindowContext* NewRasterForMac(const MacWindowInfo&, const DisplayParams&);
|
2019-02-08 20:36:14 +00:00
|
|
|
#ifdef SK_METAL
|
|
|
|
WindowContext* NewMetalForMac(const MacWindowInfo&, const DisplayParams&);
|
|
|
|
#endif
|
2016-08-09 17:53:11 +00:00
|
|
|
|
2016-07-26 19:02:50 +00:00
|
|
|
} // namespace window_context_factory
|
|
|
|
|
|
|
|
} // namespace sk_app
|
|
|
|
|
|
|
|
#endif
|