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

Unified Diff: src/gpu/gl/win/SkNativeGLContext_win.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add docs 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
Index: src/gpu/gl/win/SkNativeGLContext_win.cpp
diff --git a/src/gpu/gl/win/SkNativeGLContext_win.cpp b/src/gpu/gl/win/SkNativeGLContext_win.cpp
index bae97a780c0b09e78d5108a7eaab4619128b96cb..f085fdc6eedef859328fb983a756c8821ec5d851 100644
--- a/src/gpu/gl/win/SkNativeGLContext_win.cpp
+++ b/src/gpu/gl/win/SkNativeGLContext_win.cpp
@@ -47,7 +47,7 @@ void SkNativeGLContext::destroyGLContext() {
}
}
-const GrGLInterface* SkNativeGLContext::createGLContext() {
+const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedGpuAPI) {
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
if (!gWC) {
@@ -85,9 +85,13 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
this->destroyGLContext();
return NULL;
}
+ // Requesting a Core profile would bar us from using NVPR. So we request
+ // compatibility profile or GL ES.
+ SkWGLContextRequest contextType =
+ kGLES_GrGLStandard == forcedGpuAPI ?
+ kGLES_SkWGLContextRequest : kGLPreferCompatibilityProfile_SkWGLContextRequest;
- // Requesting a Core profile would bar us from using NVPR. So we pass false.
- if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, false))) {
+ if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, contextType))) {
SkDebugf("Could not create rendering context.\n");
this->destroyGLContext();
return NULL;

Powered by Google App Engine
This is Rietveld 408576698