Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: src/views/mac/SkSampleNSView.mm

Issue 16337012: Smallest possible desktop application that uses Skia to render stuff. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix speed hiccups in Windows Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #import "SkSampleNSView.h" 9 #import "SkSampleNSView.h"
10
11 #include "SkApplication.h"
10 #include "SampleApp.h" 12 #include "SampleApp.h"
13
11 #include <crt_externs.h> 14 #include <crt_externs.h>
12 @implementation SkSampleNSView 15 @implementation SkSampleNSView
13 16
14 - (id)initWithDefaults { 17 - (id)initWithDefaults {
15 if ((self = [super initWithDefaults])) { 18 if ((self = [super initWithDefaults])) {
16 fWind = new SampleWindow(self, *_NSGetArgc(), *_NSGetArgv(), NULL); 19 fWind = create_sk_window(self, *_NSGetArgc(), *_NSGetArgv());
17 } 20 }
18 return self; 21 return self;
19 } 22 }
20 23
21 - (void)dealloc { 24 - (void)dealloc {
22 delete fWind; 25 delete fWind;
23 [super dealloc]; 26 [super dealloc];
24 } 27 }
25 28
26 - (void)swipeWithEvent:(NSEvent *)event { 29 - (void)swipeWithEvent:(NSEvent *)event {
27 CGFloat x = [event deltaX]; 30 CGFloat x = [event deltaX];
28 if (x < 0) 31 if (x < 0)
29 ((SampleWindow*)fWind)->previousSample(); 32 ((SampleWindow*)fWind)->previousSample();
30 else if (x > 0) 33 else if (x > 0)
31 ((SampleWindow*)fWind)->nextSample(); 34 ((SampleWindow*)fWind)->nextSample();
32 else 35 else
33 ((SampleWindow*)fWind)->showOverview(); 36 ((SampleWindow*)fWind)->showOverview();
34 } 37 }
35 38
36 @end 39 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698