Add commented out code to create a core profile on windows.

Review URL: https://codereview.chromium.org/12393044

git-svn-id: http://skia.googlecode.com/svn/trunk@7953 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2013-03-04 14:29:01 +00:00
parent c490f801b0
commit b12dc38964

View File

@ -396,7 +396,37 @@ HGLRC create_gl(HWND hwnd, int msaaSampleCount) {
SkASSERT(TRUE == set);
}
HGLRC glrc = wglCreateContext(dc);
HGLRC glrc = NULL;
#if 0 // Change to 1 to attempt to create a core profile GL context of version 4.3 or lower
if (extensions.hasExtension(dc, "WGL_ARB_create_context")) {
static const GLint kCoreGLVersions[] = {
4, 3,
4, 2,
4, 1,
4, 0,
3, 3,
3, 2,
};
GLint coreProfileAttribs[] = {
SK_WGL_CONTEXT_MAJOR_VERSION, -1,
SK_WGL_CONTEXT_MINOR_VERSION, -1,
SK_WGL_CONTEXT_PROFILE_MASK, SK_WGL_CONTEXT_CORE_PROFILE_BIT,
0,
};
for (int v = 0; v < SK_ARRAY_COUNT(kCoreGLVersions) / 2; ++v) {
coreProfileAttribs[1] = kCoreGLVersions[2 * v];
coreProfileAttribs[3] = kCoreGLVersions[2 * v + 1];
glrc = extensions.createContextAttribs(dc, NULL, coreProfileAttribs);
if (NULL != glrc) {
break;
}
}
}
#endif
if (NULL == glrc) {
glrc = wglCreateContext(dc);
}
SkASSERT(glrc);
wglMakeCurrent(prevDC, prevGLRC);