| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 #ifndef GrEffectStage_DEFINED | 11 #ifndef GrEffectStage_DEFINED |
| 12 #define GrEffectStage_DEFINED | 12 #define GrEffectStage_DEFINED |
| 13 | 13 |
| 14 #include "GrBackendEffectFactory.h" | 14 #include "GrBackendEffectFactory.h" |
| 15 #include "GrEffect.h" | 15 #include "GrEffect.h" |
| 16 #include "GrProgramElementRef.h" |
| 16 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
| 17 #include "GrTypes.h" | |
| 18 | |
| 19 #include "SkShader.h" | 18 #include "SkShader.h" |
| 20 | 19 |
| 21 class GrEffectStage { | 20 class GrEffectStage { |
| 22 public: | 21 public: |
| 23 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr
Index1 = -1) | 22 explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attr
Index1 = -1) |
| 24 : fEffect(SkRef(effect)) { | 23 : fEffect(SkRef(effect)) { |
| 25 fCoordChangeMatrixSet = false; | 24 fCoordChangeMatrixSet = false; |
| 26 fVertexAttribIndices[0] = attrIndex0; | 25 fVertexAttribIndices[0] = attrIndex0; |
| 27 fVertexAttribIndices[1] = attrIndex1; | 26 fVertexAttribIndices[1] = attrIndex1; |
| 28 } | 27 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } else { | 128 } else { |
| 130 return SkMatrix::I(); | 129 return SkMatrix::I(); |
| 131 } | 130 } |
| 132 } | 131 } |
| 133 | 132 |
| 134 const GrEffect* getEffect() const { return fEffect.get(); } | 133 const GrEffect* getEffect() const { return fEffect.get(); } |
| 135 | 134 |
| 136 const int* getVertexAttribIndices() const { return fVertexAttribIndices; } | 135 const int* getVertexAttribIndices() const { return fVertexAttribIndices; } |
| 137 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} | 136 int getVertexAttribIndexCount() const { return fEffect->numVertexAttribs();
} |
| 138 | 137 |
| 138 void convertToPendingExec() { fEffect.convertToPendingExec(); } |
| 139 |
| 139 private: | 140 private: |
| 140 bool fCoordChangeMatrixSet; | 141 bool fCoordChangeMatrixSet; |
| 141 SkMatrix fCoordChangeMatrix; | 142 SkMatrix fCoordChangeMatrix; |
| 142 SkAutoTUnref<const GrEffect> fEffect; | 143 GrProgramElementRef<const GrEffect> fEffect; |
| 143 int fVertexAttribIndices[2]; | 144 int fVertexAttribIndices[2]; |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 #endif | 147 #endif |
| OLD | NEW |