Add GN config for Mac SampleApp
authorJim Van Verth <jvanverth@google.com>
Fri, 28 Oct 2016 17:35:50 +0000 (13:35 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 28 Oct 2016 18:00:51 +0000 (18:00 +0000)
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>
BUILD.gn
src/views/mac/SkNSView.h
src/views/mac/SkNSView.mm
src/views/mac/SkOSWindow_Mac.mm
src/views/mac/skia_mac.mm

index 7f0d16e..e57cd0e 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -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",
index 779c51b..1718b2a 100644 (file)
@@ -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
index ce29382..7f4aacd 100644 (file)
@@ -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];
index faf1bba..4efa753 100644 (file)
@@ -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
index 98d4c4b..b2c5951 100644 (file)
 }
 
 - (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