| 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 GrGLGeometryProcessor_DEFINED | 8 #ifndef GrGLGeometryProcessor_DEFINED |
| 9 #define GrGLGeometryProcessor_DEFINED | 9 #define GrGLGeometryProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrGLProcessor.h" | 11 #include "GrGLProcessor.h" |
| 12 | 12 |
| 13 class GrGLGPBuilder; | 13 class GrGLGPBuilder; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the
n it must inherit | 16 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the
n it must inherit |
| 17 * from this class. Since paths don't have vertices, this class is only meant to
be used internally | 17 * from this class. Since paths don't have vertices, this class is only meant to
be used internally |
| 18 * by skia, for special cases. | 18 * by skia, for special cases. |
| 19 */ | 19 */ |
| 20 class GrGLGeometryProcessor : public GrGLProcessor { | 20 class GrGLGeometryProcessor : public GrGLProcessor { |
| 21 public: | 21 public: |
| 22 GrGLGeometryProcessor(const GrBackendProcessorFactory& factory) | 22 GrGLGeometryProcessor(const GrBackendProcessorFactory& factory) |
| 23 : INHERITED(factory) {} | 23 : INHERITED(factory) {} |
| 24 | 24 |
| 25 struct EmitArgs { | 25 struct EmitArgs { |
| 26 EmitArgs(GrGLGPBuilder* pb, | 26 EmitArgs(GrGLGPBuilder* pb, |
| 27 const GrGeometryProcessor& gp, | 27 const GrGeometryProcessor& gp, |
| 28 const char* output, | 28 const char* outputColor, |
| 29 const char* input, | 29 const char* outputCoverage, |
| 30 const TextureSamplerArray& samplers) | 30 const TextureSamplerArray& samplers) |
| 31 : fPB(pb), fGP(gp), fOutput(output), fInput(input), fSamplers(sample
rs) {} | 31 : fPB(pb) |
| 32 , fGP(gp) |
| 33 , fOutputColor(outputColor) |
| 34 , fOutputCoverage(outputCoverage) |
| 35 , fSamplers(samplers) {} |
| 32 GrGLGPBuilder* fPB; | 36 GrGLGPBuilder* fPB; |
| 33 const GrGeometryProcessor& fGP; | 37 const GrGeometryProcessor& fGP; |
| 34 const char* fOutput; | 38 const char* fOutputColor; |
| 35 const char* fInput; | 39 const char* fOutputCoverage; |
| 36 const TextureSamplerArray& fSamplers; | 40 const TextureSamplerArray& fSamplers; |
| 37 }; | 41 }; |
| 38 /** | 42 /** |
| 39 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. | 43 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. |
| 40 * This allows the effect subclass to emit vertex code. | 44 * This allows the effect subclass to emit vertex code. |
| 41 */ | 45 */ |
| 42 virtual void emitCode(const EmitArgs&) = 0; | 46 virtual void emitCode(const EmitArgs&) = 0; |
| 43 | 47 |
| 44 private: | 48 private: |
| 45 typedef GrGLProcessor INHERITED; | 49 typedef GrGLProcessor INHERITED; |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 #endif | 52 #endif |
| OLD | NEW |