| 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" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 name:@"NSWindowDidChangeBackingPropert
iesNotification" | 51 name:@"NSWindowDidChangeBackingPropert
iesNotification" |
| 52 object:[self window]]; | 52 object:[self window]]; |
| 53 if (fWind) { | 53 if (fWind) { |
| 54 fWind->setVisibleP(true); | 54 fWind->setVisibleP(true); |
| 55 NSSize size = self.frame.size; | 55 NSSize size = self.frame.size; |
| 56 #if RETINA_API_AVAILABLE | 56 #if RETINA_API_AVAILABLE |
| 57 size = [self convertSizeToBacking:self.frame.size]; | 57 size = [self convertSizeToBacking:self.frame.size]; |
| 58 #endif | 58 #endif |
| 59 fWind->resize((int) size.width, (int) size.height, | 59 fWind->resize((int) size.width, (int) size.height, |
| 60 kN32_SkColorType); | 60 kN32_SkColorType); |
| 61 [[self window] setAcceptsMouseMovedEvents:YES]; |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 | 64 |
| 64 -(BOOL) isFlipped { | 65 -(BOOL) isFlipped { |
| 65 return YES; | 66 return YES; |
| 66 } | 67 } |
| 67 | 68 |
| 68 - (BOOL)acceptsFirstResponder { | 69 - (BOOL)acceptsFirstResponder { |
| 69 return YES; | 70 return YES; |
| 70 } | 71 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 421 } |
| 421 | 422 |
| 422 - (void)setVSync:(bool)enable { | 423 - (void)setVSync:(bool)enable { |
| 423 if (fGLContext) { | 424 if (fGLContext) { |
| 424 GLint interval = enable ? 1 : 0; | 425 GLint interval = enable ? 1 : 0; |
| 425 CGLContextObj ctx = (CGLContextObj)[fGLContext CGLContextObj]; | 426 CGLContextObj ctx = (CGLContextObj)[fGLContext CGLContextObj]; |
| 426 CGLSetParameter(ctx, kCGLCPSwapInterval, &interval); | 427 CGLSetParameter(ctx, kCGLCPSwapInterval, &interval); |
| 427 } | 428 } |
| 428 } | 429 } |
| 429 @end | 430 @end |
| OLD | NEW |