| 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 GrGLPrimitiveProcessor_DEFINED | 8 #ifndef GrGLPrimitiveProcessor_DEFINED |
| 9 #define GrGLPrimitiveProcessor_DEFINED | 9 #define GrGLPrimitiveProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrPrimitiveProcessor.h" | 11 #include "GrPrimitiveProcessor.h" |
| 12 #include "GrGLProcessor.h" | 12 #include "glsl/GrGLSLProcessorTypes.h" |
| 13 #include "glsl/GrGLSLProgramDataManager.h" | 13 #include "glsl/GrGLSLProgramDataManager.h" |
| 14 #include "glsl/GrGLSLTextureSampler.h" |
| 14 | 15 |
| 15 class GrBatchTracker; | 16 class GrBatchTracker; |
| 16 class GrPrimitiveProcessor; | 17 class GrPrimitiveProcessor; |
| 17 class GrGLGPBuilder; | 18 class GrGLGPBuilder; |
| 18 | 19 |
| 19 class GrGLPrimitiveProcessor { | 20 class GrGLPrimitiveProcessor { |
| 20 public: | 21 public: |
| 21 virtual ~GrGLPrimitiveProcessor() {} | 22 virtual ~GrGLPrimitiveProcessor() {} |
| 22 | 23 |
| 23 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; | 24 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; |
| 24 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray; | 25 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray; |
| 25 | 26 |
| 26 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords; | 27 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords; |
| 27 typedef SkSTArray<8, ProcCoords> TransformsIn; | 28 typedef SkSTArray<8, ProcCoords> TransformsIn; |
| 28 typedef SkSTArray<8, GrGLProcessor::TransformedCoordsArray> TransformsOut; | 29 typedef SkSTArray<8, GrGLSLTransformedCoordsArray> TransformsOut; |
| 29 | 30 |
| 30 struct EmitArgs { | 31 struct EmitArgs { |
| 31 EmitArgs(GrGLGPBuilder* pb, | 32 EmitArgs(GrGLGPBuilder* pb, |
| 32 const GrPrimitiveProcessor& gp, | 33 const GrPrimitiveProcessor& gp, |
| 33 const char* outputColor, | 34 const char* outputColor, |
| 34 const char* outputCoverage, | 35 const char* outputCoverage, |
| 35 const TextureSamplerArray& samplers, | 36 const TextureSamplerArray& samplers, |
| 36 const TransformsIn& transformsIn, | 37 const TransformsIn& transformsIn, |
| 37 TransformsOut* transformsOut) | 38 TransformsOut* transformsOut) |
| 38 : fPB(pb) | 39 : fPB(pb) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual void setTransformData(const GrPrimitiveProcessor&, | 72 virtual void setTransformData(const GrPrimitiveProcessor&, |
| 72 const GrGLSLProgramDataManager& pdman, | 73 const GrGLSLProgramDataManager& pdman, |
| 73 int index, | 74 int index, |
| 74 const SkTArray<const GrCoordTransform*, true>&
transforms) = 0; | 75 const SkTArray<const GrCoordTransform*, true>&
transforms) = 0; |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan
dle* colorUniform); | 78 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan
dle* colorUniform); |
| 78 | 79 |
| 79 struct Transform { | 80 struct Transform { |
| 80 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM
atrix(); } | 81 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM
atrix(); } |
| 81 GrGLSLProgramDataManager::UniformHandle fHandle; | 82 UniformHandle fHandle; |
| 82 SkMatrix fCurrentValue; | 83 SkMatrix fCurrentValue; |
| 83 GrSLType fType; | 84 GrSLType fType; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; | 87 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 #endif | 90 #endif |
| OLD | NEW |