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

Side by Side Diff: src/views/mac/SkNSView.mm

Issue 1812223002: added support for glMinSampleShading (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updated for Jim's change Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipeline.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 #include <OpenGL/OpenGL.h> 330 #include <OpenGL/OpenGL.h>
331 331
332 static CGLContextObj createGLContext(int msaaSampleCount) { 332 static CGLContextObj createGLContext(int msaaSampleCount) {
333 GLint major, minor; 333 GLint major, minor;
334 CGLGetVersion(&major, &minor); 334 CGLGetVersion(&major, &minor);
335 335
336 static const CGLPixelFormatAttribute attributes[] = { 336 static const CGLPixelFormatAttribute attributes[] = {
337 kCGLPFAStencilSize, (CGLPixelFormatAttribute) 8, 337 kCGLPFAStencilSize, (CGLPixelFormatAttribute) 8,
338 kCGLPFAAccelerated, 338 kCGLPFAAccelerated,
339 kCGLPFADoubleBuffer, 339 kCGLPFADoubleBuffer,
340 kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core ,
340 (CGLPixelFormatAttribute)0 341 (CGLPixelFormatAttribute)0
341 }; 342 };
342 343
343 CGLPixelFormatObj format; 344 CGLPixelFormatObj format;
344 GLint npix = 0; 345 GLint npix = 0;
345 if (msaaSampleCount > 0) { 346 if (msaaSampleCount > 0) {
346 static int kAttributeCount = SK_ARRAY_COUNT(attributes); 347 static int kAttributeCount = SK_ARRAY_COUNT(attributes);
347 CGLPixelFormatAttribute msaaAttributes[kAttributeCount + 5]; 348 CGLPixelFormatAttribute msaaAttributes[kAttributeCount + 5];
348 memcpy(msaaAttributes, attributes, sizeof(attributes)); 349 memcpy(msaaAttributes, attributes, sizeof(attributes));
349 SkASSERT(0 == msaaAttributes[kAttributeCount - 1]); 350 SkASSERT(0 == msaaAttributes[kAttributeCount - 1]);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkPipeline.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698