Chromium Code Reviews| 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 GrGLSLPrimitiveProcessor_DEFINED | 8 #ifndef GrGLSLPrimitiveProcessor_DEFINED |
| 9 #define GrGLSLPrimitiveProcessor_DEFINED | 9 #define GrGLSLPrimitiveProcessor_DEFINED |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 const TransformsIn& fTransformsIn; | 71 const TransformsIn& fTransformsIn; |
| 72 TransformsOut* fTransformsOut; | 72 TransformsOut* fTransformsOut; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * This is similar to emitCode() in the base class, except it takes a full s hader builder. | 76 * This is similar to emitCode() in the base class, except it takes a full s hader builder. |
| 77 * This allows the effect subclass to emit vertex code. | 77 * This allows the effect subclass to emit vertex code. |
| 78 */ | 78 */ |
| 79 virtual void emitCode(EmitArgs&) = 0; | 79 virtual void emitCode(EmitArgs&) = 0; |
| 80 | 80 |
| 81 | |
| 82 /** A GrGLSLPrimitiveProcessor instance can be reused with any GrGLSLPrimiti veProcessor that | 81 /** A GrGLSLPrimitiveProcessor instance can be reused with any GrGLSLPrimiti veProcessor that |
| 83 produces the same stage key; this function reads data from a GrGLSLPrimi tiveProcessor and | 82 produces the same stage key; this function reads data from a GrGLSLPrimi tiveProcessor and |
| 84 uploads any uniform variables required by the shaders created in emitCo de(). The | 83 uploads any uniform variables required by the shaders created in emitCo de(). The |
| 85 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this | 84 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this |
| 86 GrGLSLPrimitiveProcessor and to have an identical processor key as the o ne that created this | 85 GrGLSLPrimitiveProcessor and to have an identical processor key as the o ne that created this |
| 87 GrGLSLPrimitiveProcessor. */ | 86 GrGLSLPrimitiveProcessor. */ |
| 88 virtual void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProce ssor&) = 0; | 87 virtual void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProce ssor&) = 0; |
| 89 | 88 |
| 90 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&); | 89 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&); |
| 91 | 90 |
| 92 virtual void setTransformData(const GrPrimitiveProcessor&, | 91 virtual void setTransformData(const GrPrimitiveProcessor&, |
| 93 const GrGLSLProgramDataManager& pdman, | 92 const GrGLSLProgramDataManager& pdman, |
| 94 int index, | 93 int index, |
| 95 const SkTArray<const GrCoordTransform*, true>& transforms) = 0; | 94 const SkTArray<const GrCoordTransform*, true>& transforms) = 0; |
| 96 | 95 |
| 96 | |
|
egdaniel
2016/07/13 19:27:27
extra \n
dvonbeck
2016/07/13 21:28:14
Done.
| |
| 97 protected: | 97 protected: |
| 98 void setupUniformColor(GrGLSLPPFragmentBuilder* fragBuilder, | 98 void setupUniformColor(GrGLSLPPFragmentBuilder* fragBuilder, |
| 99 GrGLSLUniformHandler* uniformHandler, | 99 GrGLSLUniformHandler* uniformHandler, |
| 100 const char* outputName, | 100 const char* outputName, |
| 101 UniformHandle* colorUniform); | 101 UniformHandle* colorUniform); |
| 102 | 102 |
| 103 struct Transform { | 103 struct Transform { |
| 104 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } | 104 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } |
| 105 SkMatrix fCurrentValue; | 105 SkMatrix fCurrentValue; |
| 106 GrSLType fType; | 106 GrSLType fType; |
| 107 }; | 107 }; |
| 108 | |
|
egdaniel
2016/07/13 19:27:27
extra \n
dvonbeck
2016/07/13 21:28:14
Done.
| |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 #endif | 111 #endif |
| OLD | NEW |