diff options
author | cdalton <cdalton@nvidia.com> | 2014-09-17 09:19:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-17 09:19:18 -0700 |
commit | 149b3ec2b1ccaf00e40bf296d2a3394852d73fe9 (patch) | |
tree | c945ae380eb26860b4db4d9137afd247100955a6 /src/gpu | |
parent | 9a0267fa9aa1dab078ab67b40b647de5be80696f (diff) |
Adds glMemoryGlyphIndexArrayNV to the GrGLInterface and begins
detecting support for this method in GrGLPathRendering.
BUG=skia:2939
R=bsalomon@google.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/570733002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLDefines.h | 15 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLPathRendering.cpp | 12 | ||||
-rw-r--r-- | src/gpu/gl/GrGLPathRendering.h | 1 |
5 files changed, 28 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index da88547f9b..c5c0785fe8 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -267,6 +267,7 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, NV); // NV_path_rendering v1.3 (These methods may not be present) GET_PROC_SUFFIX(ProgramPathFragmentInputGen, NV); + GET_PROC_SUFFIX(PathMemoryGlyphIndexArray, NV); } if (extensions.has("GL_EXT_debug_marker")) { @@ -503,6 +504,7 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { GET_PROC_SUFFIX(StencilThenCoverFillPathInstanced, NV); GET_PROC_SUFFIX(StencilThenCoverStrokePathInstanced, NV); GET_PROC_SUFFIX(ProgramPathFragmentInputGen, NV); + GET_PROC_SUFFIX(PathMemoryGlyphIndexArray, NV); } interface->fStandard = kGLES_GrGLStandard; diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h index 048ad54df6..11dc60167e 100644 --- a/src/gpu/gl/GrGLDefines.h +++ b/src/gpu/gl/GrGLDefines.h @@ -895,6 +895,21 @@ #define GR_GL_MITER_REVERT 0x90A7 #define GR_GL_MITER_TRUNCATE 0x90A8 +// glyph loading values +#define GR_GL_STANDARD_FONT_NAME 0x9072 +#define GR_GL_SYSTEM_FONT_NAME 0x9073 +#define GR_GL_FILE_NAME 0x9074 +#define GR_GL_STANDARD_FONT_FORMAT 0x936C +#define GR_GL_SKIP_MISSING_GLYPH 0x90A9 +#define GR_GL_USE_MISSING_GLYPH 0x90AA +#define GR_GL_FONT_GLYPHS_AVAILABLE 0x9368 +#define GR_GL_FONT_TARGET_UNAVAILABLE 0x9369 +#define GR_GL_FONT_UNAVAILABLE 0x936A +#define GR_GL_FONT_UNINTELLIGIBLE 0x936B +/* GL_INVALID_ENUM */ +/* GL_INVALID_VALUE */ +/* GL_OUT_OF_MEMORY */ + // NV_path_rendering extension to ARB_program_interface_query: // .. corresponds to the set of active input variables used by the fragment // shader stage of <program> (if a fragment stage exists). diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index 4c2713d334..063de56aeb 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -61,6 +61,7 @@ const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; + newInterface->fFunctions.fPathMemoryGlyphIndexArray = NULL; return newInterface; } @@ -485,7 +486,8 @@ bool GrGLInterface::validate() const { NULL == fFunctions.fStencilThenCoverStrokePath || NULL == fFunctions.fStencilThenCoverFillPathInstanced || NULL == fFunctions.fStencilThenCoverStrokePathInstanced || - NULL == fFunctions.fProgramPathFragmentInputGen) { + NULL == fFunctions.fProgramPathFragmentInputGen || + NULL == fFunctions.fPathMemoryGlyphIndexArray) { RETURN_FALSE_INTERFACE } } diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp index f524ff2aca..81d47c4722 100644 --- a/src/gpu/gl/GrGLPathRendering.cpp +++ b/src/gpu/gl/GrGLPathRendering.cpp @@ -49,13 +49,15 @@ GrGLPathRendering::GrGLPathRendering(GrGpuGL* gpu) : fGpu(gpu) { const GrGLInterface* glInterface = gpu->glInterface(); fCaps.stencilThenCoverSupport = - glInterface->fFunctions.fStencilThenCoverFillPath && - glInterface->fFunctions.fStencilThenCoverStrokePath && - glInterface->fFunctions.fStencilThenCoverFillPathInstanced && - glInterface->fFunctions.fStencilThenCoverStrokePathInstanced; + NULL != glInterface->fFunctions.fStencilThenCoverFillPath && + NULL != glInterface->fFunctions.fStencilThenCoverStrokePath && + NULL != glInterface->fFunctions.fStencilThenCoverFillPathInstanced && + NULL != glInterface->fFunctions.fStencilThenCoverStrokePathInstanced; fCaps.fragmentInputGenSupport = kGLES_GrGLStandard == glInterface->fStandard && - glInterface->fFunctions.fProgramPathFragmentInputGen; + NULL != glInterface->fFunctions.fProgramPathFragmentInputGen; + fCaps.glyphLoadingSupport = + NULL != glInterface->fFunctions.fPathMemoryGlyphIndexArray; if (!fCaps.fragmentInputGenSupport) { fHWPathTexGenSettings.reset(fGpu->glCaps().maxFixedFunctionTextureCoords()); diff --git a/src/gpu/gl/GrGLPathRendering.h b/src/gpu/gl/GrGLPathRendering.h index c7a6993abc..6583951c22 100644 --- a/src/gpu/gl/GrGLPathRendering.h +++ b/src/gpu/gl/GrGLPathRendering.h @@ -99,6 +99,7 @@ private: struct Caps { bool stencilThenCoverSupport : 1; bool fragmentInputGenSupport : 1; + bool glyphLoadingSupport : 1; }; const Caps& caps() const { return fCaps; } |