skia2/tools/sk_app/ios/WindowContextFactory_ios.h
Ben Wagner f6cc85844f Reland "Fix sk_app macOS raster window build conditions."
The "raster" window on macOS and iOS is actually backed by GL. Fix the
build rules and code conditions to reflect this. This allows for some
sk_app applications to run on macOS and iOS with skia_use_gl=false.

> Revert:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397737
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

> Land:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397256
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ia8a421f4818856dd90cb4847095eee0d1836d1e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398056
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-04-19 18:25:44 +00:00

52 lines
1.1 KiB
Objective-C

/*
* 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
#include "tools/sk_app/ios/Window_ios.h"
#import <UIKit/UIKit.h>
#include "tools/sk_app/WindowContext.h"
#include <memory>
namespace sk_app {
struct DisplayParams;
namespace window_context_factory {
struct IOSWindowInfo {
sk_app::Window_ios* fWindow;
UIViewController* fViewController;
};
#ifdef SK_VULKAN
inline std::unique_ptr<WindowContext> MakeVulkanForIOS(const IOSWindowInfo&, const DisplayParams&) {
// No Vulkan support on iOS yet.
return nullptr;
}
#endif
#ifdef SK_METAL
std::unique_ptr<WindowContext> MakeMetalForIOS(const IOSWindowInfo&, const DisplayParams&);
#endif
#ifdef SK_GL
std::unique_ptr<WindowContext> MakeGLForIOS(const IOSWindowInfo&, const DisplayParams&);
std::unique_ptr<WindowContext> MakeRasterForIOS(const IOSWindowInfo&, const DisplayParams&);
#endif
} // namespace window_context_factory
} // namespace sk_app
#endif