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

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1219663005: Revert of Cleanup legacy NVPR-related definitions (Closed) Base URL: https://skia.googlesource.com/skia.git@chromium-pathrendering-prepare-02
Patch Set: Created 5 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/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 27aa8951e29aa94ae8a7da3c7ac82eff0067d70c..22fd053c1d46ab92c9db192302c2a9a87a864443 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -279,7 +279,21 @@
* GrShaderCaps fields
**************************************************************************/
- glslCaps->fPathRenderingSupport = this->hasPathRenderingSupport(ctxInfo, gli);
+ glslCaps->fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
+
+ if (glslCaps->fPathRenderingSupport) {
+ if (kGL_GrGLStandard == standard) {
+ // We only support v1.3+ of GL_NV_path_rendering which allows us to
+ // set individual fragment inputs with ProgramPathFragmentInputGen. The API
+ // additions are detected by checking the existence of the function.
+ glslCaps->fPathRenderingSupport = ((ctxInfo.version() >= GR_GL_VER(4, 3) ||
+ ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
+ gli->fFunctions.fProgramPathFragmentInputGen);
+ }
+ else {
+ glslCaps->fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3, 1);
+ }
+ }
// For now these two are equivalent but we could have dst read in shader via some other method
glslCaps->fDstReadInShaderSupport = glslCaps->fFBFetchSupport;
@@ -440,35 +454,6 @@
this->applyOptionsOverrides(contextOptions);
glslCaps->applyOptionsOverrides(contextOptions);
-}
-
-bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
- if (!ctxInfo.hasExtension("GL_NV_path_rendering")) {
- return false;
- }
- if (kGL_GrGLStandard == ctxInfo.standard()) {
- if (ctxInfo.version() < GR_GL_VER(4, 3) &&
- !ctxInfo.hasExtension("GL_ARB_program_interface_query")) {
- return false;
- }
- } else {
- if (ctxInfo.version() < GR_GL_VER(3, 1)) {
- return false;
- }
- }
- // We only support v1.3+ of GL_NV_path_rendering which allows us to
- // set individual fragment inputs with ProgramPathFragmentInputGen. The API
- // additions are detected by checking the existence of the function.
- // We also use *Then* functions that not all drivers might have. Check
- // them for consistency.
- if (NULL == gli->fFunctions.fStencilThenCoverFillPath ||
- NULL == gli->fFunctions.fStencilThenCoverStrokePath ||
- NULL == gli->fFunctions.fStencilThenCoverFillPathInstanced ||
- NULL == gli->fFunctions.fStencilThenCoverStrokePathInstanced ||
- NULL == gli->fFunctions.fProgramPathFragmentInputGen) {
- return false;
- }
- return true;
}
void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) {
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698