| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #import "SkNSView.h" | 8 #import "SkNSView.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkSurface.h" | 10 #include "SkSurface.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 static_assert(SK_SUPPORT_GPU, "not_implemented_for_non_gpu_build"); |
| 14 #include <OpenGL/gl.h> | 14 #include <OpenGL/gl.h> |
| 15 | 15 |
| 16 //#define FORCE_REDRAW | 16 //#define FORCE_REDRAW |
| 17 // Can be dropped when we no longer support 10.6. | 17 // Can be dropped when we no longer support 10.6. |
| 18 #define RETINA_API_AVAILABLE (defined(MAC_OS_X_VERSION_10_7) && \ | 18 #define RETINA_API_AVAILABLE (defined(MAC_OS_X_VERSION_10_7) && \ |
| 19 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) |
| 20 @implementation SkNSView | 20 @implementation SkNSView |
| 21 @synthesize fWind, fTitle, fOptionsDelegate, fGLContext; | 21 @synthesize fWind, fTitle, fOptionsDelegate, fGLContext; |
| 22 | 22 |
| 23 - (id)initWithCoder:(NSCoder*)coder { | 23 - (id)initWithCoder:(NSCoder*)coder { |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 - (void)setVSync:(bool)enable { | 423 - (void)setVSync:(bool)enable { |
| 424 if (fGLContext) { | 424 if (fGLContext) { |
| 425 GLint interval = enable ? 1 : 0; | 425 GLint interval = enable ? 1 : 0; |
| 426 CGLContextObj ctx = (CGLContextObj)[fGLContext CGLContextObj]; | 426 CGLContextObj ctx = (CGLContextObj)[fGLContext CGLContextObj]; |
| 427 CGLSetParameter(ctx, kCGLCPSwapInterval, &interval); | 427 CGLSetParameter(ctx, kCGLCPSwapInterval, &interval); |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 @end | 430 @end |
| OLD | NEW |