OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkWGL.h" | 9 #include "SkWGL.h" |
10 | 10 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 if (SetPixelFormat(dc, formatToTry, &pfd)) { | 324 if (SetPixelFormat(dc, formatToTry, &pfd)) { |
325 format = formatToTry; | 325 format = formatToTry; |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 if (0 == format) { | 329 if (0 == format) { |
330 // Either MSAA wasn't requested or creation failed | 330 // Either MSAA wasn't requested or creation failed |
331 unsigned int num; | 331 unsigned int num; |
332 extensions.choosePixelFormat(dc, iAttrs, fAttrs, 1, &format, &num); | 332 extensions.choosePixelFormat(dc, iAttrs, fAttrs, 1, &format, &num); |
333 DescribePixelFormat(dc, format, sizeof(pfd), &pfd); | 333 DescribePixelFormat(dc, format, sizeof(pfd), &pfd); |
334 BOOL set = SetPixelFormat(dc, format, &pfd); | 334 SkDEBUGCODE(BOOL set =) SetPixelFormat(dc, format, &pfd); |
335 SkASSERT(TRUE == set); | 335 SkASSERT(TRUE == set); |
336 } | 336 } |
337 | 337 |
338 HGLRC glrc = NULL; | 338 HGLRC glrc = NULL; |
339 if (preferCoreProfile && extensions.hasExtension(dc, "WGL_ARB_create_context
")) { | 339 if (preferCoreProfile && extensions.hasExtension(dc, "WGL_ARB_create_context
")) { |
340 static const int kCoreGLVersions[] = { | 340 static const int kCoreGLVersions[] = { |
341 4, 3, | 341 4, 3, |
342 4, 2, | 342 4, 2, |
343 4, 1, | 343 4, 1, |
344 4, 0, | 344 4, 0, |
(...skipping 17 matching lines...) Expand all Loading... |
362 } | 362 } |
363 | 363 |
364 if (NULL == glrc) { | 364 if (NULL == glrc) { |
365 glrc = wglCreateContext(dc); | 365 glrc = wglCreateContext(dc); |
366 } | 366 } |
367 SkASSERT(glrc); | 367 SkASSERT(glrc); |
368 | 368 |
369 wglMakeCurrent(prevDC, prevGLRC); | 369 wglMakeCurrent(prevDC, prevGLRC); |
370 return glrc; | 370 return glrc; |
371 } | 371 } |
OLD | NEW |