• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright 2017 Google Inc.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 #ifndef WindowContextFactory_ios_DEFINED
10 #define WindowContextFactory_ios_DEFINED
11 
12 #include "tools/sk_app/ios/Window_ios.h"
13 
14 #import <UIKit/UIKit.h>
15 
16 #include "tools/window/WindowContext.h"
17 
18 #include <memory>
19 
20 namespace skwindow {
21 
22 struct DisplayParams;
23 
24 struct IOSWindowInfo {
25     sk_app::Window_ios* fWindow;
26     UIViewController*   fViewController;
27 };
28 
29 #ifdef SK_VULKAN
MakeVulkanForIOS(const IOSWindowInfo &,const DisplayParams &)30 inline std::unique_ptr<WindowContext> MakeVulkanForIOS(const IOSWindowInfo&, const DisplayParams&) {
31     // No Vulkan support on iOS yet.
32     return nullptr;
33 }
34 #endif
35 
36 #ifdef SK_METAL
37 std::unique_ptr<WindowContext> MakeMetalForIOS(const IOSWindowInfo&, const DisplayParams&);
38 #if defined(SK_GRAPHITE)
39 std::unique_ptr<WindowContext> MakeGraphiteMetalForIOS(const IOSWindowInfo&, const DisplayParams&);
40 #endif
41 #endif
42 
43 #ifdef SK_GL
44 std::unique_ptr<WindowContext> MakeGLForIOS(const IOSWindowInfo&, const DisplayParams&);
45 std::unique_ptr<WindowContext> MakeRasterForIOS(const IOSWindowInfo&, const DisplayParams&);
46 #endif
47 
48 }  // namespace skwindow
49 
50 #endif
51