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

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

Issue 12437010: Make SkOSWindow return the sample count and stencil bit count for its GL context. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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
===================================================================
--- src/views/mac/SkNSView.mm (revision 7991)
+++ src/views/mac/SkNSView.mm (working copy)
@@ -291,7 +291,6 @@
if (!npix) {
CGLChoosePixelFormat(attributes, &format, &npix);
}
-
CGLContextObj ctx;
CGLCreateContext(format, NULL, &ctx);
CGLDestroyPixelFormat(format);
@@ -314,7 +313,8 @@
}
}
- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType
- withMSAASampleCount:(int) sampleCount {
+ withMSAASampleCount:(int) sampleCount
+ andGetInfo:(SkOSWindow::AttachmentInfo*) info {
if (nil == fGLContext) {
CGLContextObj ctx = createGLContext(sampleCount);
fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:ctx];
@@ -324,9 +324,11 @@
}
[fGLContext setView:self];
}
-
+
[fGLContext makeCurrentContext];
-
+ CGLPixelFormatObj format = CGLGetPixelFormat((CGLContextObj)[fGLContext CGLContextObj]);
+ CGLDescribePixelFormat(format, 0, kCGLPFASamples, &info->fSampleCount);
+ CGLDescribePixelFormat(format, 0, kCGLPFAStencilSize, &info->fStencilBits);
glViewport(0, 0, (int) self.bounds.size.width, (int) self.bounds.size.width);
glClearColor(0, 0, 0, 0);
glClearStencil(0);
« 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