2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WindowContextFactory_ios_DEFINED
|
|
|
|
#define WindowContextFactory_ios_DEFINED
|
|
|
|
|
2019-08-29 18:59:17 +00:00
|
|
|
#include "tools/sk_app/ios/Window_ios.h"
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2019-08-01 20:21:49 +00:00
|
|
|
#include "tools/sk_app/WindowContext.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2017-09-01 15:01:51 +00:00
|
|
|
namespace sk_app {
|
|
|
|
|
|
|
|
struct DisplayParams;
|
|
|
|
|
|
|
|
namespace window_context_factory {
|
|
|
|
|
|
|
|
struct IOSWindowInfo {
|
2019-08-29 18:59:17 +00:00
|
|
|
sk_app::Window_ios* fWindow;
|
|
|
|
UIViewController* fViewController;
|
2017-09-01 15:01:51 +00:00
|
|
|
};
|
|
|
|
|
2021-04-19 14:12:12 +00:00
|
|
|
#ifdef SK_VULKAN
|
2019-08-01 20:21:49 +00:00
|
|
|
inline std::unique_ptr<WindowContext> MakeVulkanForIOS(const IOSWindowInfo&, const DisplayParams&) {
|
2019-08-29 18:59:17 +00:00
|
|
|
// No Vulkan support on iOS yet.
|
|
|
|
return nullptr;
|
|
|
|
}
|
2021-04-19 14:12:12 +00:00
|
|
|
#endif
|
2019-08-29 18:59:17 +00:00
|
|
|
|
2021-04-19 14:12:12 +00:00
|
|
|
#ifdef SK_METAL
|
2019-09-03 13:42:57 +00:00
|
|
|
std::unique_ptr<WindowContext> MakeMetalForIOS(const IOSWindowInfo&, const DisplayParams&);
|
2021-04-19 14:12:12 +00:00
|
|
|
#endif
|
2017-09-01 15:01:51 +00:00
|
|
|
|
2021-04-19 14:12:12 +00:00
|
|
|
#ifdef SK_GL
|
2019-08-01 20:21:49 +00:00
|
|
|
std::unique_ptr<WindowContext> MakeGLForIOS(const IOSWindowInfo&, const DisplayParams&);
|
|
|
|
std::unique_ptr<WindowContext> MakeRasterForIOS(const IOSWindowInfo&, const DisplayParams&);
|
2021-04-19 14:12:12 +00:00
|
|
|
#endif
|
2017-09-01 15:01:51 +00:00
|
|
|
|
|
|
|
} // namespace window_context_factory
|
|
|
|
|
|
|
|
} // namespace sk_app
|
|
|
|
|
|
|
|
#endif
|