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>
This commit is contained in:
Jim Van Verth 2016-10-28 13:35:50 -04:00 committed by Skia Commit-Bot
parent 3effb79fc5
commit 57a98fc4d5
5 changed files with 11 additions and 19 deletions

View File

@ -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",

View 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

View 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];

View 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

View File

@ -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