| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrGLPathRendering_DEFINED | 8 #ifndef GrGLPathRendering_DEFINED |
| 9 #define GrGLPathRendering_DEFINED | 9 #define GrGLPathRendering_DEFINED |
| 10 | 10 |
| 11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
| 12 #include "GrPathRendering.h" | 12 #include "GrPathRendering.h" |
| 13 #include "GrStencil.h" | 13 #include "GrStencil.h" |
| 14 #include "gl/GrGLFunctions.h" | 14 #include "gl/GrGLFunctions.h" |
| 15 #include "gl/GrGLProgram.h" | 15 #include "gl/GrGLProgram.h" |
| 16 | 16 |
| 17 class GrGLNameAllocator; | 17 class GrGLNameAllocator; |
| 18 class GrGpuGL; | 18 class GrGLGpu; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * This class wraps the NV_path_rendering extension and manages its various | 21 * This class wraps the NV_path_rendering extension and manages its various |
| 22 * API versions. If a method is not present in the GrGLInterface of the GrGpuGL | 22 * API versions. If a method is not present in the GrGLInterface of the GrGLGpu |
| 23 * (because the driver version is old), it tries to provide a backup | 23 * (because the driver version is old), it tries to provide a backup |
| 24 * implementation. But if a backup implementation is not practical, it marks the | 24 * implementation. But if a backup implementation is not practical, it marks the |
| 25 * method as not supported. | 25 * method as not supported. |
| 26 */ | 26 */ |
| 27 class GrGLPathRendering : public GrPathRendering { | 27 class GrGLPathRendering : public GrPathRendering { |
| 28 public: | 28 public: |
| 29 /** | 29 /** |
| 30 * Create a new GrGLPathRendering object from a given GrGpuGL. | 30 * Create a new GrGLPathRendering object from a given GrGLGpu. |
| 31 */ | 31 */ |
| 32 GrGLPathRendering(GrGpuGL* gpu); | 32 GrGLPathRendering(GrGLGpu* gpu); |
| 33 virtual ~GrGLPathRendering(); | 33 virtual ~GrGLPathRendering(); |
| 34 | 34 |
| 35 // GrPathRendering implementations. | 35 // GrPathRendering implementations. |
| 36 virtual GrPath* createPath(const SkPath&, const SkStrokeRec&) SK_OVERRIDE; | 36 virtual GrPath* createPath(const SkPath&, const SkStrokeRec&) SK_OVERRIDE; |
| 37 virtual GrPathRange* createPathRange(GrPathRange::PathGenerator*, | 37 virtual GrPathRange* createPathRange(GrPathRange::PathGenerator*, |
| 38 const SkStrokeRec&) SK_OVERRIDE; | 38 const SkStrokeRec&) SK_OVERRIDE; |
| 39 virtual GrPathRange* createGlyphs(const SkTypeface*, | 39 virtual GrPathRange* createGlyphs(const SkTypeface*, |
| 40 const SkDescriptor*, | 40 const SkDescriptor*, |
| 41 const SkStrokeRec&) SK_OVERRIDE; | 41 const SkStrokeRec&) SK_OVERRIDE; |
| 42 virtual void stencilPath(const GrPath*, const GrStencilSettings&) SK_OVERRID
E; | 42 virtual void stencilPath(const GrPath*, const GrStencilSettings&) SK_OVERRID
E; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void stencilThenCoverFillPathInstanced( | 119 void stencilThenCoverFillPathInstanced( |
| 120 GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, | 120 GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, |
| 121 GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, Gr
GLenum coverMode, | 121 GrGLuint pathBase, GrGLenum fillMode, GrGLuint mask, Gr
GLenum coverMode, |
| 122 GrGLenum transformType, const GrGLfloat *transformValue
s); | 122 GrGLenum transformType, const GrGLfloat *transformValue
s); |
| 123 | 123 |
| 124 void stencilThenCoverStrokePathInstanced( | 124 void stencilThenCoverStrokePathInstanced( |
| 125 GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvo
id *paths, | 125 GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvo
id *paths, |
| 126 GrGLuint pathBase, GrGLint reference, GrGLuint mask, Gr
GLenum coverMode, | 126 GrGLuint pathBase, GrGLint reference, GrGLuint mask, Gr
GLenum coverMode, |
| 127 GrGLenum transformType, const GrGLfloat *transformValue
s); | 127 GrGLenum transformType, const GrGLfloat *transformValue
s); |
| 128 | 128 |
| 129 GrGpuGL* fGpu; | 129 GrGLGpu* fGpu; |
| 130 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; | 130 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; |
| 131 Caps fCaps; | 131 Caps fCaps; |
| 132 GrGLProgram::MatrixState fHWProjectionMatrixState; | 132 GrGLProgram::MatrixState fHWProjectionMatrixState; |
| 133 GrStencilSettings fHWPathStencilSettings; | 133 GrStencilSettings fHWPathStencilSettings; |
| 134 struct PathTexGenData { | 134 struct PathTexGenData { |
| 135 GrGLenum fMode; | 135 GrGLenum fMode; |
| 136 GrGLint fNumComponents; | 136 GrGLint fNumComponents; |
| 137 GrGLfloat fCoefficients[3 * 3]; | 137 GrGLfloat fCoefficients[3 * 3]; |
| 138 }; | 138 }; |
| 139 int fHWActivePathTexGenSets; | 139 int fHWActivePathTexGenSets; |
| 140 SkTArray<PathTexGenData, true> fHWPathTexGenSettings; | 140 SkTArray<PathTexGenData, true> fHWPathTexGenSettings; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 #endif | 143 #endif |
| OLD | NEW |