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

Unified Diff: src/utils/win/SkWGL_win.cpp

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/win/SkNativeGLContext_win.cpp ('k') | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/win/SkWGL_win.cpp
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index a8552a8ea3ce19c74c1747bb137047a59ab6f2e4..3b1966dae8fbcd352229440c6d5c2582cb234046 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -245,7 +245,7 @@
wglMakeCurrent(prevDC, prevGLRC);
}
-HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, SkWGLContextRequest contextType) {
+HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile) {
SkWGLExtensions extensions;
if (!extensions.hasExtension(dc, "WGL_ARB_pixel_format")) {
return NULL;
@@ -307,44 +307,27 @@
}
HGLRC glrc = NULL;
- if (kGLES_SkWGLContextRequest == contextType) {
- if (!extensions.hasExtension(dc, "WGL_EXT_create_context_es2_profile")) {
- return NULL;
- }
- static const int glesAttribs[] = {
- SK_WGL_CONTEXT_MAJOR_VERSION, 3,
- SK_WGL_CONTEXT_MINOR_VERSION, 0,
- SK_WGL_CONTEXT_PROFILE_MASK, SK_WGL_CONTEXT_ES2_PROFILE_BIT,
+ if (preferCoreProfile && extensions.hasExtension(dc, "WGL_ARB_create_context")) {
+ static const int kCoreGLVersions[] = {
+ 4, 3,
+ 4, 2,
+ 4, 1,
+ 4, 0,
+ 3, 3,
+ 3, 2,
+ };
+ int 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,
};
- glrc = extensions.createContextAttribs(dc, NULL, glesAttribs);
- if (NULL == glrc) {
- return NULL;
- }
- } else {
- if (kGLPreferCoreProfile_SkWGLContextRequest == contextType &&
- extensions.hasExtension(dc, "WGL_ARB_create_context")) {
- static const int kCoreGLVersions[] = {
- 4, 3,
- 4, 2,
- 4, 1,
- 4, 0,
- 3, 3,
- 3, 2,
- };
- int 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;
- }
+ 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;
}
}
}
« no previous file with comments | « src/gpu/gl/win/SkNativeGLContext_win.cpp ('k') | src/views/win/SkOSWindow_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698