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

Unified Diff: src/views/win/SkOSWindow_win.cpp

Issue 12393044: Add commented out code to create a core profile on windows. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/win/SkOSWindow_win.cpp
===================================================================
--- src/views/win/SkOSWindow_win.cpp (revision 7930)
+++ src/views/win/SkOSWindow_win.cpp (working copy)
@@ -396,7 +396,37 @@
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698