| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrGLPathProcessor_DEFINED | 8 #ifndef GrGLPathProcessor_DEFINED |
| 9 #define GrGLPathProcessor_DEFINED | 9 #define GrGLPathProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrGLPrimitiveProcessor.h" | 11 #include "GrGLPrimitiveProcessor.h" |
| 12 | 12 |
| 13 class GrPathProcessor; | 13 class GrPathProcessor; |
| 14 class GrGLPathRendering; | 14 class GrGLPathRendering; |
| 15 class GrGLGpu; | 15 class GrGLGpu; |
| 16 | 16 |
| 17 class GrGLPathProcessor : public GrGLPrimitiveProcessor { | 17 class GrGLPathProcessor : public GrGLPrimitiveProcessor { |
| 18 public: | 18 public: |
| 19 GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracker&); | 19 GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracker&); |
| 20 | 20 |
| 21 static void GenKey(const GrPathProcessor&, | 21 static void GenKey(const GrPathProcessor&, |
| 22 const GrBatchTracker& bt, | 22 const GrBatchTracker& bt, |
| 23 const GrGLCaps&, | 23 const GrGLCaps&, |
| 24 GrProcessorKeyBuilder* b); | 24 GrProcessorKeyBuilder* b); |
| 25 | 25 |
| 26 void emitCode(EmitArgs&) SK_OVERRIDE; | 26 void emitCode(EmitArgs&) override; |
| 27 | 27 |
| 28 virtual void emitTransforms(GrGLGPBuilder*, const TransformsIn&, TransformsO
ut*) = 0; | 28 virtual void emitTransforms(GrGLGPBuilder*, const TransformsIn&, TransformsO
ut*) = 0; |
| 29 | 29 |
| 30 virtual void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId) {} | 30 virtual void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId) {} |
| 31 | 31 |
| 32 void setData(const GrGLProgramDataManager&, | 32 void setData(const GrGLProgramDataManager&, |
| 33 const GrPrimitiveProcessor&, | 33 const GrPrimitiveProcessor&, |
| 34 const GrBatchTracker&) SK_OVERRIDE; | 34 const GrBatchTracker&) override; |
| 35 | 35 |
| 36 virtual void setTransformData(const GrPrimitiveProcessor&, | 36 virtual void setTransformData(const GrPrimitiveProcessor&, |
| 37 int index, | 37 int index, |
| 38 const SkTArray<const GrCoordTransform*, true>&
transforms, | 38 const SkTArray<const GrCoordTransform*, true>&
transforms, |
| 39 GrGLPathRendering*, | 39 GrGLPathRendering*, |
| 40 GrGLuint programID) = 0; | 40 GrGLuint programID) = 0; |
| 41 | 41 |
| 42 virtual void didSetData(GrGLPathRendering*) {} | 42 virtual void didSetData(GrGLPathRendering*) {} |
| 43 | 43 |
| 44 private: | 44 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 SkDEBUGCODE(fMaxTexCoords = maxTexCoords;) | 57 SkDEBUGCODE(fMaxTexCoords = maxTexCoords;) |
| 58 } | 58 } |
| 59 | 59 |
| 60 int addTexCoordSets(int count) { | 60 int addTexCoordSets(int count) { |
| 61 int firstFreeCoordSet = fTexCoordSetCnt; | 61 int firstFreeCoordSet = fTexCoordSetCnt; |
| 62 fTexCoordSetCnt += count; | 62 fTexCoordSetCnt += count; |
| 63 SkASSERT(fMaxTexCoords >= fTexCoordSetCnt); | 63 SkASSERT(fMaxTexCoords >= fTexCoordSetCnt); |
| 64 return firstFreeCoordSet; | 64 return firstFreeCoordSet; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut*
tout) SK_OVERRIDE; | 67 void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut*
tout) override; |
| 68 | 68 |
| 69 void setTransformData(const GrPrimitiveProcessor& primProc, | 69 void setTransformData(const GrPrimitiveProcessor& primProc, |
| 70 int index, | 70 int index, |
| 71 const SkTArray<const GrCoordTransform*, true>& transfo
rms, | 71 const SkTArray<const GrCoordTransform*, true>& transfo
rms, |
| 72 GrGLPathRendering* glpr, | 72 GrGLPathRendering* glpr, |
| 73 GrGLuint) SK_OVERRIDE; | 73 GrGLuint) override; |
| 74 | 74 |
| 75 void didSetData(GrGLPathRendering* glpr) SK_OVERRIDE; | 75 void didSetData(GrGLPathRendering* glpr) override; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 SkDEBUGCODE(int fMaxTexCoords;) | 78 SkDEBUGCODE(int fMaxTexCoords;) |
| 79 int fTexCoordSetCnt; | 79 int fTexCoordSetCnt; |
| 80 | 80 |
| 81 typedef GrGLPathProcessor INHERITED; | 81 typedef GrGLPathProcessor INHERITED; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class GrGLNormalPathProcessor : public GrGLPathProcessor { | 84 class GrGLNormalPathProcessor : public GrGLPathProcessor { |
| 85 public: | 85 public: |
| 86 GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt) | 86 GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt) |
| 87 : INHERITED(pathProc, bt) {} | 87 : INHERITED(pathProc, bt) {} |
| 88 | 88 |
| 89 void emitTransforms(GrGLGPBuilder* pb, const TransformsIn& tin,TransformsOut
* tout) SK_OVERRIDE; | 89 void emitTransforms(GrGLGPBuilder* pb, const TransformsIn& tin,TransformsOut
* tout) override; |
| 90 | 90 |
| 91 void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId); | 91 void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId); |
| 92 | 92 |
| 93 void setTransformData(const GrPrimitiveProcessor& primProc, | 93 void setTransformData(const GrPrimitiveProcessor& primProc, |
| 94 int index, | 94 int index, |
| 95 const SkTArray<const GrCoordTransform*, true>& coordTr
ansforms, | 95 const SkTArray<const GrCoordTransform*, true>& coordTr
ansforms, |
| 96 GrGLPathRendering* glpr, | 96 GrGLPathRendering* glpr, |
| 97 GrGLuint programID) SK_OVERRIDE; | 97 GrGLuint programID) override; |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 struct SeparableVaryingInfo { | 100 struct SeparableVaryingInfo { |
| 101 GrSLType fType; | 101 GrSLType fType; |
| 102 GrGLShaderVar fVariable; | 102 GrGLShaderVar fVariable; |
| 103 GrGLint fLocation; | 103 GrGLint fLocation; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 typedef SkSTArray<8, SeparableVaryingInfo, true> SeparableVaryingInfoArray; | 106 typedef SkSTArray<8, SeparableVaryingInfo, true> SeparableVaryingInfoArray; |
| 107 | 107 |
| 108 SeparableVaryingInfoArray fSeparableVaryingInfos; | 108 SeparableVaryingInfoArray fSeparableVaryingInfos; |
| 109 | 109 |
| 110 typedef GrGLPathProcessor INHERITED; | 110 typedef GrGLPathProcessor INHERITED; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 #endif | 113 #endif |
| OLD | NEW |