diff options
author | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 16:04:09 +0000 |
---|---|---|
committer | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 16:04:09 +0000 |
commit | 68c74884d0da1aa794bb660a37f31f2f9108bc36 (patch) | |
tree | 15e0fd795d0fd88b28763ae145923c883dae9571 /src/gpu/gl | |
parent | 0ded88d431a1872e21986984f009db2e84f52738 (diff) |
Revert "Turn NVPR on by default (but off in tools)."
This reverts commit 83d81c96de34950bdd84dc575997a250b685a3d6.
Broke Windows build. Autorevert didn't work.
TBR=bsalomon@google.com,robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true
BUG=skia:2042
Review URL: https://codereview.chromium.org/146863003
git-svn-id: http://skia.googlecode.com/svn/trunk@13169 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 3 | ||||
-rw-r--r-- | src/gpu/gl/GrGLExtensions.cpp | 50 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 77 | ||||
-rw-r--r-- | src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp | 5 | ||||
-rw-r--r-- | src/gpu/gl/win/SkNativeGLContext_win.cpp | 6 |
5 files changed, 18 insertions, 123 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index bdb19e2e3a..153be6a4be 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -309,7 +309,8 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { // attachment, hence this min: fMaxRenderTargetSize = GrMin(fMaxTextureSize, fMaxRenderTargetSize); - fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering"); + fPathRenderingSupport = GR_GL_USE_NV_PATH_RENDERING && + ctxInfo.hasExtension("GL_NV_path_rendering"); SkASSERT(!fPathRenderingSupport || fFixedFunctionSupport); fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType; diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp index 33273e5f65..4e75d3e08c 100644 --- a/src/gpu/gl/GrGLExtensions.cpp +++ b/src/gpu/gl/GrGLExtensions.cpp @@ -12,35 +12,12 @@ #include "SkTSearch.h" #include "SkTSort.h" -namespace { // This cannot be static because it is used as a template parameter. +namespace { inline bool extension_compare(const SkString& a, const SkString& b) { return strcmp(a.c_str(), b.c_str()) < 0; } } -// finds the index of ext in strings or a negative result if ext is not found. -static int find_string(const SkTArray<SkString>& strings, const char ext[]) { - if (strings.empty()) { - return -1; - } - SkString extensionStr(ext); - int idx = SkTSearch<SkString, extension_compare>(&strings.front(), - strings.count(), - extensionStr, - sizeof(SkString)); - return idx; -} - -GrGLExtensions::GrGLExtensions(const GrGLExtensions& that) : fStrings(SkNEW(SkTArray<SkString>)) { - *this = that; -} - -GrGLExtensions& GrGLExtensions::operator=(const GrGLExtensions& that) { - *fStrings = *that.fStrings; - fInitialized = that.fInitialized; - return *this; -} - bool GrGLExtensions::init(GrGLStandard standard, GrGLGetStringProc getString, GrGLGetStringiProc getStringi, @@ -99,25 +76,16 @@ bool GrGLExtensions::init(GrGLStandard standard, return true; } -bool GrGLExtensions::has(const char ext[]) const { - SkASSERT(fInitialized); - return find_string(*fStrings, ext) >= 0; -} - -bool GrGLExtensions::remove(const char ext[]) { - SkASSERT(fInitialized); - int idx = find_string(*fStrings, ext); - if (idx >= 0) { - // This is not terribly effecient but we really only expect this function to be called at - // most a handful of times when our test programs start. - SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach()); - fStrings.reset(SkNEW(SkTArray<SkString>(oldStrings->count() - 1))); - fStrings->push_back_n(idx, &oldStrings->front()); - fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1); - return true; - } else { +bool GrGLExtensions::has(const char* ext) const { + if (fStrings->empty()) { return false; } + SkString extensionStr(ext); + int idx = SkTSearch<SkString, extension_compare>(&fStrings->front(), + fStrings->count(), + extensionStr, + sizeof(SkString)); + return idx >= 0; } void GrGLExtensions::print(const char* sep) const { diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index f7b0a53c20..0a0ff59408 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -18,64 +18,6 @@ void GrGLDefaultInterfaceCallback(const GrGLInterface*) {} } #endif -const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { - GrGLInterface* newInterface = GrGLInterface::NewClone(interface); - - newInterface->fExtensions.remove("GL_NV_path_rendering"); - - newInterface->fPathCommands = NULL; - newInterface->fPathCoords = NULL; - newInterface->fPathSubCommands = NULL; - newInterface->fPathSubCoords = NULL; - newInterface->fPathString = NULL; - newInterface->fPathGlyphs = NULL; - newInterface->fPathGlyphRange = NULL; - newInterface->fWeightPaths = NULL; - newInterface->fCopyPath = NULL; - newInterface->fInterpolatePaths = NULL; - newInterface->fTransformPath = NULL; - newInterface->fPathParameteriv = NULL; - newInterface->fPathParameteri = NULL; - newInterface->fPathParameterfv = NULL; - newInterface->fPathParameterf = NULL; - newInterface->fPathDashArray = NULL; - newInterface->fGenPaths = NULL; - newInterface->fDeletePaths = NULL; - newInterface->fIsPath = NULL; - newInterface->fPathStencilFunc = NULL; - newInterface->fPathStencilDepthOffset = NULL; - newInterface->fStencilFillPath = NULL; - newInterface->fStencilStrokePath = NULL; - newInterface->fStencilFillPathInstanced = NULL; - newInterface->fStencilStrokePathInstanced = NULL; - newInterface->fPathCoverDepthFunc = NULL; - newInterface->fPathColorGen = NULL; - newInterface->fPathTexGen = NULL; - newInterface->fPathFogGen = NULL; - newInterface->fCoverFillPath = NULL; - newInterface->fCoverStrokePath = NULL; - newInterface->fCoverFillPathInstanced = NULL; - newInterface->fCoverStrokePathInstanced = NULL; - newInterface->fGetPathParameteriv = NULL; - newInterface->fGetPathParameterfv = NULL; - newInterface->fGetPathCommands = NULL; - newInterface->fGetPathCoords = NULL; - newInterface->fGetPathDashArray = NULL; - newInterface->fGetPathMetrics = NULL; - newInterface->fGetPathMetricRange = NULL; - newInterface->fGetPathSpacing = NULL; - newInterface->fGetPathColorGeniv = NULL; - newInterface->fGetPathColorGenfv = NULL; - newInterface->fGetPathTexGeniv = NULL; - newInterface->fGetPathTexGenfv = NULL; - newInterface->fIsPointInFillPath = NULL; - newInterface->fIsPointInStrokePath = NULL; - newInterface->fGetPathLength = NULL; - newInterface->fPointAlongPath = NULL; - - return newInterface; -} - GrGLInterface::GrGLInterface() // TODO: Remove this madness ASAP. : fActiveTexture(&fFunctions.fActiveTexture) @@ -263,7 +205,8 @@ GrGLInterface::GrGLInterface() , fIsPointInFillPath(&fFunctions.fIsPointInFillPath) , fIsPointInStrokePath(&fFunctions.fIsPointInStrokePath) , fGetPathLength(&fFunctions.fGetPathLength) - , fPointAlongPath(&fFunctions.fPointAlongPath) { + , fPointAlongPath(&fFunctions.fPointAlongPath) +{ fStandard = kNone_GrGLStandard; #if GR_GL_PER_GL_FUNC_CALLBACK @@ -272,20 +215,6 @@ GrGLInterface::GrGLInterface() #endif } -GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { - SkASSERT(NULL != interface); - - GrGLInterface* clone = SkNEW(GrGLInterface); - clone->fStandard = interface->fStandard; - clone->fExtensions = interface->fExtensions; - clone->fFunctions = interface->fFunctions; -#if GR_GL_PER_GL_FUNC_CALLBACK - clone->fCallback = interface->fCallback; - clone->fCallbackData = interface->fCallbackData; -#endif - return clone; -} - bool GrGLInterface::validate() const { if (kNone_GrGLStandard == fStandard) { @@ -476,7 +405,7 @@ bool GrGLInterface::validate() const { return false; } } - if (fExtensions.has("GL_NV_path_rendering")) { + if (false && fExtensions.has("GL_NV_path_rendering")) { if (NULL == fFunctions.fPathCommands || NULL == fFunctions.fPathCoords || NULL == fFunctions.fPathSubCommands || diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp index 1695c3c36f..2858541ed9 100644 --- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp +++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp @@ -152,10 +152,5 @@ const GrGLInterface* GrGLCreateANGLEInterface() { functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES"); functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES"); - - interface->fExtensions.init(kGLES_GrGLStandard, - interface->fFunctions.fGetString, - interface->fFunctions.fGetStringi, - interface->fFunctions.fGetIntegerv); return interface; } diff --git a/src/gpu/gl/win/SkNativeGLContext_win.cpp b/src/gpu/gl/win/SkNativeGLContext_win.cpp index bae97a780c..17b4e4ad9b 100644 --- a/src/gpu/gl/win/SkNativeGLContext_win.cpp +++ b/src/gpu/gl/win/SkNativeGLContext_win.cpp @@ -86,8 +86,10 @@ const GrGLInterface* SkNativeGLContext::createGLContext() { return NULL; } - // Requesting a Core profile would bar us from using NVPR. So we pass false. - if (!(fGlRenderContext = SkCreateWGLContext(fDeviceContext, 0, false))) { + // 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; |