diff options
author | Jim Van Verth <jvanverth@google.com> | 2016-10-28 13:35:50 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-28 18:00:51 +0000 |
commit | 57a98fc4d595875ca75f906acec8ba508dcb5248 (patch) | |
tree | 583cc6a16c50390eb54e58cd7e55ddc488ee552e | |
parent | 3effb79fc550fae5a55f1aba6b39cd97acd422c0 (diff) |
Add GN config for Mac SampleApp
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4077
Change-Id: I67e4456c8ccdb5413e86c442b759f6dff4de651b
Reviewed-on: https://skia-review.googlesource.com/4077
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | src/views/mac/SkNSView.h | 18 | ||||
-rw-r--r-- | src/views/mac/SkNSView.mm | 2 | ||||
-rw-r--r-- | src/views/mac/SkOSWindow_Mac.mm | 4 | ||||
-rw-r--r-- | src/views/mac/skia_mac.mm | 4 |
5 files changed, 11 insertions, 19 deletions
@@ -992,7 +992,7 @@ if (skia_enable_tools) { testonly = true } - if (is_linux || is_win) { + if (is_linux || is_win || is_mac) { executable("SampleApp") { sources = [ "samplecode/SampleApp.cpp", diff --git a/src/views/mac/SkNSView.h b/src/views/mac/SkNSView.h index 779c51b7e4..1718b2ac11 100644 --- a/src/views/mac/SkNSView.h +++ b/src/views/mac/SkNSView.h @@ -8,6 +8,7 @@ #import <QuartzCore/QuartzCore.h> #import <Cocoa/Cocoa.h> #import "SkWindow.h" + class SkEvent; @class SkNSView; @@ -18,18 +19,7 @@ class SkEvent; - (void) view:(SkNSView*)view didUpdateMenu:(const SkOSMenu*)menu; @end -@interface SkNSView : NSView { - BOOL fRedrawRequestPending; - - NSString* fTitle; - SkOSWindow* fWind; -#if SK_SUPPORT_GPU - NSOpenGLContext* fGLContext; -#endif - id<SkNSViewOptionsDelegate> fOptionsDelegate; -} - -@property (nonatomic, readonly) SkOSWindow *fWind; +@interface SkNSView : NSView @property (nonatomic, retain) NSString* fTitle; #if SK_SUPPORT_GPU @property (nonatomic, retain) NSOpenGLContext* fGLContext; @@ -54,3 +44,7 @@ class SkEvent; - (void)freeNativeWind; @end + +@interface SkNSView() + @property (nonatomic, readwrite) SkOSWindow *fWind; +@end diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm index ce29382371..7f4aacd4c9 100644 --- a/src/views/mac/SkNSView.mm +++ b/src/views/mac/SkNSView.mm @@ -20,6 +20,8 @@ static_assert(SK_SUPPORT_GPU, "not_implemented_for_non_gpu_build"); @implementation SkNSView @synthesize fWind, fTitle, fOptionsDelegate, fGLContext; +BOOL fRedrawRequestPending; + - (id)initWithCoder:(NSCoder*)coder { if ((self = [super initWithCoder:coder])) { self = [self initWithDefaults]; diff --git a/src/views/mac/SkOSWindow_Mac.mm b/src/views/mac/SkOSWindow_Mac.mm index faf1bbafd2..4efa7533b4 100644 --- a/src/views/mac/SkOSWindow_Mac.mm +++ b/src/views/mac/SkOSWindow_Mac.mm @@ -5,8 +5,6 @@ * found in the LICENSE file. */ -#if defined(SK_BUILD_FOR_MAC) - #import <Cocoa/Cocoa.h> #include "SkOSWindow_Mac.h" #include "SkOSMenu.h" @@ -91,5 +89,3 @@ bool SkOSWindow::makeFullscreen() { return true; } - -#endif diff --git a/src/views/mac/skia_mac.mm b/src/views/mac/skia_mac.mm index 98d4c4bd92..b2c59516e0 100644 --- a/src/views/mac/skia_mac.mm +++ b/src/views/mac/skia_mac.mm @@ -27,12 +27,12 @@ } - (void)dealloc { - delete fWind; + delete self.fWind; [super dealloc]; } - (void)begin { - fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv()); + self.fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv()); [self setUpWindow]; } @end |