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

Side by Side Diff: src/gpu/glsl/GrGLSLFragmentProcessor.h

Issue 1453623003: Move glsl onto EmitArgs struct for emitCode (Closed) Base URL: https://skia.googlesource.com/skia.git@moveShaders
Patch Set: nit Created 5 years, 1 month 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
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLFragmentProcessor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 GrGLSLFragmentProcessor_DEFINED 8 #ifndef GrGLSLFragmentProcessor_DEFINED
9 #define GrGLSLFragmentProcessor_DEFINED 9 #define GrGLSLFragmentProcessor_DEFINED
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 color is solid white, trans black, known to be opaqu e, etc.) that allows 46 color is solid white, trans black, known to be opaqu e, etc.) that allows
47 the processor to communicate back similar known info about its output. 47 the processor to communicate back similar known info about its output.
48 @param samplers Contains one entry for each GrTextureAccess of the G rProcessor. These 48 @param samplers Contains one entry for each GrTextureAccess of the G rProcessor. These
49 can be passed to the builder to emit texture reads i n the generated 49 can be passed to the builder to emit texture reads i n the generated
50 code. 50 code.
51 */ 51 */
52 52
53 struct EmitArgs { 53 struct EmitArgs {
54 EmitArgs(GrGLSLFPBuilder* builder, 54 EmitArgs(GrGLSLFPBuilder* builder,
55 GrGLSLFragmentBuilder* fragBuilder, 55 GrGLSLFragmentBuilder* fragBuilder,
56 const GrGLSLCaps* caps,
56 const GrFragmentProcessor& fp, 57 const GrFragmentProcessor& fp,
57 const char* outputColor, 58 const char* outputColor,
58 const char* inputColor, 59 const char* inputColor,
59 const GrGLSLTransformedCoordsArray& coords, 60 const GrGLSLTransformedCoordsArray& coords,
60 const TextureSamplerArray& samplers) 61 const TextureSamplerArray& samplers)
61 : fBuilder(builder) 62 : fBuilder(builder)
62 , fFragBuilder(fragBuilder) 63 , fFragBuilder(fragBuilder)
64 , fGLSLCaps(caps)
63 , fFp(fp) 65 , fFp(fp)
64 , fOutputColor(outputColor) 66 , fOutputColor(outputColor)
65 , fInputColor(inputColor) 67 , fInputColor(inputColor)
66 , fCoords(coords) 68 , fCoords(coords)
67 , fSamplers(samplers) {} 69 , fSamplers(samplers) {}
68 GrGLSLFPBuilder* fBuilder; 70 GrGLSLFPBuilder* fBuilder;
69 GrGLSLFragmentBuilder* fFragBuilder; 71 GrGLSLFragmentBuilder* fFragBuilder;
72 const GrGLSLCaps* fGLSLCaps;
70 const GrFragmentProcessor& fFp; 73 const GrFragmentProcessor& fFp;
71 const char* fOutputColor; 74 const char* fOutputColor;
72 const char* fInputColor; 75 const char* fInputColor;
73 const GrGLSLTransformedCoordsArray& fCoords; 76 const GrGLSLTransformedCoordsArray& fCoords;
74 const TextureSamplerArray& fSamplers; 77 const TextureSamplerArray& fSamplers;
75 }; 78 };
76 79
77 virtual void emitCode(EmitArgs&) = 0; 80 virtual void emitCode(EmitArgs&) = 0;
78 81
79 void setData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcesso r& processor); 82 void setData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcesso r& processor);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 114
112 private: 115 private:
113 void internalEmitChild(int, const char*, const char*, EmitArgs&); 116 void internalEmitChild(int, const char*, const char*, EmitArgs&);
114 117
115 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors; 118 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors;
116 119
117 friend class GrFragmentProcessor; 120 friend class GrFragmentProcessor;
118 }; 121 };
119 122
120 #endif 123 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/glsl/GrGLSLFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698