| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 msaaIAttrs[kIAttrsCount + 3] = 1; | 305 msaaIAttrs[kIAttrsCount + 3] = 1; |
| 306 msaaIAttrs[kIAttrsCount + 4] = 0; | 306 msaaIAttrs[kIAttrsCount + 4] = 0; |
| 307 msaaIAttrs[kIAttrsCount + 5] = 0; | 307 msaaIAttrs[kIAttrsCount + 5] = 0; |
| 308 } else { | 308 } else { |
| 309 msaaIAttrs[kIAttrsCount + 2] = 0; | 309 msaaIAttrs[kIAttrsCount + 2] = 0; |
| 310 msaaIAttrs[kIAttrsCount + 3] = 0; | 310 msaaIAttrs[kIAttrsCount + 3] = 0; |
| 311 } | 311 } |
| 312 unsigned int num; | 312 unsigned int num; |
| 313 int formats[64]; | 313 int formats[64]; |
| 314 extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num); | 314 extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num); |
| 315 num = min(num,64); | 315 num = SkTMin(num, 64U); |
| 316 int formatToTry = extensions.selectFormat(formats, | 316 int formatToTry = extensions.selectFormat(formats, |
| 317 num, | 317 num, |
| 318 dc, | 318 dc, |
| 319 msaaSampleCount); | 319 msaaSampleCount); |
| 320 DescribePixelFormat(dc, formatToTry, sizeof(pfd), &pfd); | 320 DescribePixelFormat(dc, formatToTry, sizeof(pfd), &pfd); |
| 321 if (SetPixelFormat(dc, formatToTry, &pfd)) { | 321 if (SetPixelFormat(dc, formatToTry, &pfd)) { |
| 322 format = formatToTry; | 322 format = formatToTry; |
| 323 } | 323 } |
| 324 } | 324 } |
| 325 | 325 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 | 360 |
| 361 if (NULL == glrc) { | 361 if (NULL == glrc) { |
| 362 glrc = wglCreateContext(dc); | 362 glrc = wglCreateContext(dc); |
| 363 } | 363 } |
| 364 SkASSERT(glrc); | 364 SkASSERT(glrc); |
| 365 | 365 |
| 366 wglMakeCurrent(prevDC, prevGLRC); | 366 wglMakeCurrent(prevDC, prevGLRC); |
| 367 return glrc; | 367 return glrc; |
| 368 } | 368 } |
| OLD | NEW |