Fix GL context creation on Windows when NV path rendering
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 9 Jan 2014 13:20:48 +0000 (13:20 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 9 Jan 2014 13:20:48 +0000 (13:20 +0000)
https://codereview.chromium.org/129033003/

git-svn-id: http://skia.googlecode.com/svn/trunk@12983 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/win/SkNativeGLContext_win.cpp

index 8833a05..beee39d 100644 (file)
@@ -311,6 +311,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
 
     fPathRenderingSupport = GR_GL_USE_NV_PATH_RENDERING &&
                             ctxInfo.hasExtension("GL_NV_path_rendering");
+    SkASSERT(!fPathRenderingSupport || fFixedFunctionSupport);
 
     fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType;
 
index 392c2bc..08061d5 100644 (file)
@@ -86,7 +86,10 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
         return NULL;
     }
 
-    if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, true))) {
+    // We don't want the core profile when using NV path rendering (since
+    // NV path rendering relies on fixed function calls)
+    if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, 
+                                                !GR_GL_USE_NV_PATH_RENDERING))) {
         SkDebugf("Could not create rendering context.\n");
         this->destroyGLContext();
         return NULL;