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

Unified Diff: src/views/mac/SkNSView.mm

Issue 1184143011: nibless mac, visual bench working on mac (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix HelloWorld compile on windows Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/views/mac/SkNSView.h ('k') | src/views/mac/SkOSWindow_Mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/mac/SkNSView.mm
diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm
index 7ca23f40e523fb98096abb2c3ad502b38239182d..e9e486a2085b5835b2e8610d678c731a295d474b 100644
--- a/src/views/mac/SkNSView.mm
+++ b/src/views/mac/SkNSView.mm
@@ -329,8 +329,7 @@ static unsigned convertNSModifiersToSk(NSUInteger nsModi) {
///////////////////////////////////////////////////////////////////////////////
#include <OpenGL/OpenGL.h>
-namespace {
-CGLContextObj createGLContext(int msaaSampleCount) {
+static CGLContextObj createGLContext(int msaaSampleCount) {
GLint major, minor;
CGLGetVersion(&major, &minor);
@@ -369,7 +368,6 @@ CGLContextObj createGLContext(int msaaSampleCount) {
CGLSetCurrentContext(ctx);
return ctx;
}
-}
- (void)viewDidMoveToWindow {
[super viewDidMoveToWindow];
@@ -420,4 +418,12 @@ CGLContextObj createGLContext(int msaaSampleCount) {
[fGLContext flushBuffer];
}
}
+
+- (void)setVSync:(bool)enable {
+ if (fGLContext) {
+ GLint interval = enable ? 1 : 0;
+ CGLContextObj ctx = (CGLContextObj)[fGLContext CGLContextObj];
+ CGLSetParameter(ctx, kCGLCPSwapInterval, &interval);
+ }
+}
@end
« no previous file with comments | « src/views/mac/SkNSView.h ('k') | src/views/mac/SkOSWindow_Mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698