diff options
Diffstat (limited to 'src/views/mac/SkOSWindow_Mac.mm')
-rw-r--r-- | src/views/mac/SkOSWindow_Mac.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/views/mac/SkOSWindow_Mac.mm b/src/views/mac/SkOSWindow_Mac.mm index a256b39fa3..bb00bbcf77 100644 --- a/src/views/mac/SkOSWindow_Mac.mm +++ b/src/views/mac/SkOSWindow_Mac.mm @@ -14,13 +14,26 @@ #import "SkEventNotifier.h" #define kINVAL_NSVIEW_EventType "inval-nsview" +static constexpr int DEFAULT_W = 1024; +static constexpr int DEFAULT_H = 768; + static_assert(SK_SUPPORT_GPU, "not_implemented_for_non_gpu_build"); +SkOSWindow::SkOSWindow(void* hwnd, int w, int h): fHWND(hwnd) { + this->init(hwnd, w, h); +} + SkOSWindow::SkOSWindow(void* hWnd) : fHWND(hWnd) { + this->init(hWnd, DEFAULT_W, DEFAULT_H); +} + +void SkOSWindow::init(void* hwnd, int w, int h) { fInvalEventIsPending = false; fGLContext = NULL; fNotifier = [[SkEventNotifier alloc] init]; + [(SkNSView*)hwnd setNSViewSize:NSMakeSize(w, h)]; } + SkOSWindow::~SkOSWindow() { [(SkEventNotifier*)fNotifier release]; } |