Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: src/gpu/gl/GrGLGeometryProcessor.h

Issue 666693012: GP Emit Code takes a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
26 EmitArgs(GrGLGPBuilder* pb,
27 const GrGeometryProcessor& gp,
28 const GrProcessorKey& key,
29 const char* output,
30 const char* input,
31 const TextureSamplerArray& samplers)
32 : fPB(pb), fGP(gp), fKey(key), fOutput(output), fInput(input), fSamp lers(samplers) {}
33 GrGLGPBuilder* fPB;
34 const GrGeometryProcessor& fGP;
35 const GrProcessorKey& fKey;
36 const char* fOutput;
37 const char* fInput;
38 const TextureSamplerArray& fSamplers;
39 };
25 /** 40 /**
26 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 41 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
27 * This allows the effect subclass to emit vertex code. 42 * This allows the effect subclass to emit vertex code.
28 */ 43 */
29 virtual void emitCode(GrGLGPBuilder* builder, 44 virtual void emitCode(const EmitArgs&) = 0;
30 const GrGeometryProcessor& geometryProcessor,
31 const GrProcessorKey& key,
32 const char* outputColor,
33 const char* inputColor,
34 const TransformedCoordsArray& coords,
35 const TextureSamplerArray& samplers) = 0;
36 45
37 private: 46 private:
38 typedef GrGLProcessor INHERITED; 47 typedef GrGLProcessor INHERITED;
39 }; 48 };
40 49
41 #endif 50 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldTextureEffect.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698