| 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 GrProcessorKey& key, | |
| 29 const char* output, | 28 const char* output, |
| 30 const char* input, | 29 const char* input, |
| 31 const TextureSamplerArray& samplers) | 30 const TextureSamplerArray& samplers) |
| 32 : fPB(pb), fGP(gp), fKey(key), fOutput(output), fInput(input), fSamp
lers(samplers) {} | 31 : fPB(pb), fGP(gp), fOutput(output), fInput(input), fSamplers(sample
rs) {} |
| 33 GrGLGPBuilder* fPB; | 32 GrGLGPBuilder* fPB; |
| 34 const GrGeometryProcessor& fGP; | 33 const GrGeometryProcessor& fGP; |
| 35 const GrProcessorKey& fKey; | |
| 36 const char* fOutput; | 34 const char* fOutput; |
| 37 const char* fInput; | 35 const char* fInput; |
| 38 const TextureSamplerArray& fSamplers; | 36 const TextureSamplerArray& fSamplers; |
| 39 }; | 37 }; |
| 40 /** | 38 /** |
| 41 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. | 39 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. |
| 42 * This allows the effect subclass to emit vertex code. | 40 * This allows the effect subclass to emit vertex code. |
| 43 */ | 41 */ |
| 44 virtual void emitCode(const EmitArgs&) = 0; | 42 virtual void emitCode(const EmitArgs&) = 0; |
| 45 | 43 |
| 46 private: | 44 private: |
| 47 typedef GrGLProcessor INHERITED; | 45 typedef GrGLProcessor INHERITED; |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 #endif | 48 #endif |
| OLD | NEW |