OLD | NEW |
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 "SkNSView.h" | 9 #import "SkNSView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkCGUtils.h" | 11 #include "SkCGUtils.h" |
12 #include "SkEvent.h" | 12 #include "SkEvent.h" |
13 SK_COMPILE_ASSERT(SK_SUPPORT_GPU, not_implemented_for_non_gpu_build); | 13 SK_COMPILE_ASSERT(SK_SUPPORT_GPU, not_implemented_for_non_gpu_build); |
| 14 #include <OpenGL/gl.h> |
14 | 15 |
15 //#define FORCE_REDRAW | 16 //#define FORCE_REDRAW |
16 // Can be dropped when we no longer support 10.6. | 17 // Can be dropped when we no longer support 10.6. |
17 #define RETINA_API_AVAILABLE (defined(MAC_OS_X_VERSION_10_7) && \ | 18 #define RETINA_API_AVAILABLE (defined(MAC_OS_X_VERSION_10_7) && \ |
18 MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_1
0_7) | 19 MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_1
0_7) |
19 @implementation SkNSView | 20 @implementation SkNSView |
20 @synthesize fWind, fTitle, fOptionsDelegate, fGLContext; | 21 @synthesize fWind, fTitle, fOptionsDelegate, fGLContext; |
21 | 22 |
22 - (id)initWithCoder:(NSCoder*)coder { | 23 - (id)initWithCoder:(NSCoder*)coder { |
23 if ((self = [super initWithCoder:coder])) { | 24 if ((self = [super initWithCoder:coder])) { |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 [fGLContext release]; | 411 [fGLContext release]; |
411 fGLContext = nil; | 412 fGLContext = nil; |
412 } | 413 } |
413 | 414 |
414 - (void)present { | 415 - (void)present { |
415 if (nil != fGLContext) { | 416 if (nil != fGLContext) { |
416 [fGLContext flushBuffer]; | 417 [fGLContext flushBuffer]; |
417 } | 418 } |
418 } | 419 } |
419 @end | 420 @end |
OLD | NEW |