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

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

Issue 2068863002: Added warning for variable-length arrays to GYP (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Made array size variable 'const' in file triggering -Wvla Created 4 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 unified diff | Download patch
« no previous file with comments | « gyp/common_conditions.gypi ('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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 kCGLPFAStencilSize, (CGLPixelFormatAttribute) 8, 337 kCGLPFAStencilSize, (CGLPixelFormatAttribute) 8,
338 kCGLPFAAccelerated, 338 kCGLPFAAccelerated,
339 kCGLPFADoubleBuffer, 339 kCGLPFADoubleBuffer,
340 kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core , 340 kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core ,
341 (CGLPixelFormatAttribute)0 341 (CGLPixelFormatAttribute)0
342 }; 342 };
343 343
344 CGLPixelFormatObj format; 344 CGLPixelFormatObj format;
345 GLint npix = 0; 345 GLint npix = 0;
346 if (msaaSampleCount > 0) { 346 if (msaaSampleCount > 0) {
347 static int kAttributeCount = SK_ARRAY_COUNT(attributes); 347 static const int kAttributeCount = SK_ARRAY_COUNT(attributes);
348 CGLPixelFormatAttribute msaaAttributes[kAttributeCount + 5]; 348 CGLPixelFormatAttribute msaaAttributes[kAttributeCount + 5];
349 memcpy(msaaAttributes, attributes, sizeof(attributes)); 349 memcpy(msaaAttributes, attributes, sizeof(attributes));
350 SkASSERT(0 == msaaAttributes[kAttributeCount - 1]); 350 SkASSERT(0 == msaaAttributes[kAttributeCount - 1]);
351 msaaAttributes[kAttributeCount - 1] = kCGLPFASampleBuffers; 351 msaaAttributes[kAttributeCount - 1] = kCGLPFASampleBuffers;
352 msaaAttributes[kAttributeCount + 0] = (CGLPixelFormatAttribute)1; 352 msaaAttributes[kAttributeCount + 0] = (CGLPixelFormatAttribute)1;
353 msaaAttributes[kAttributeCount + 1] = kCGLPFAMultisample; 353 msaaAttributes[kAttributeCount + 1] = kCGLPFAMultisample;
354 msaaAttributes[kAttributeCount + 2] = kCGLPFASamples; 354 msaaAttributes[kAttributeCount + 2] = kCGLPFASamples;
355 msaaAttributes[kAttributeCount + 3] = 355 msaaAttributes[kAttributeCount + 3] =
356 (CGLPixelFormatAttribute)msaaSampleCount; 356 (CGLPixelFormatAttribute)msaaSampleCount;
357 msaaAttributes[kAttributeCount + 4] = (CGLPixelFormatAttribute)0; 357 msaaAttributes[kAttributeCount + 4] = (CGLPixelFormatAttribute)0;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698