68cb8b0239
This replaces the SDL-based system and should allow Metal to work on iOS. OpenGL and raster will render but there's no touch input yet. Bug: skia:8737 Change-Id: I863accc47f0e1781192d567dbe54d1e321c3cd2e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231561 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
62 lines
1.2 KiB
Objective-C
62 lines
1.2 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 Window_ios_DEFINED
|
|
#define Window_ios_DEFINED
|
|
|
|
#include "include/private/SkChecksum.h"
|
|
#include "src/core/SkTDynamicHash.h"
|
|
#include "tools/sk_app/Window.h"
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
namespace sk_app {
|
|
|
|
class Window_ios : public Window {
|
|
public:
|
|
Window_ios()
|
|
: INHERITED()
|
|
, fWindow(nil) {}
|
|
~Window_ios() override { this->closeWindow(); }
|
|
|
|
bool initWindow();
|
|
|
|
void setTitle(const char*) override {}
|
|
void show() override {}
|
|
|
|
bool attach(BackendType) override;
|
|
|
|
void onInval() override;
|
|
|
|
static void PaintWindow();
|
|
|
|
UIWindow* uiWindow() { return fWindow; }
|
|
|
|
static Window_ios* MainWindow() { return gWindow; }
|
|
|
|
private:
|
|
void closeWindow();
|
|
|
|
UIWindow* fWindow;
|
|
|
|
static Window_ios* gWindow; // there should be only one
|
|
|
|
typedef Window INHERITED;
|
|
};
|
|
|
|
} // namespace sk_app
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
@interface MainView : UIView
|
|
|
|
- (MainView*)initWithWindow:(sk_app::Window_ios*)initWindow;
|
|
|
|
@end
|
|
|
|
#endif
|