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

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

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 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
« no previous file with comments | « src/gpu/effects/GrYUVEffect.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
11 #include "glsl/GrGLSLProcessorTypes.h" 11 #include "glsl/GrGLSLProcessorTypes.h"
12 #include "glsl/GrGLSLProgramDataManager.h" 12 #include "glsl/GrGLSLProgramDataManager.h"
13 #include "glsl/GrGLSLTextureSampler.h" 13 #include "glsl/GrGLSLTextureSampler.h"
14 14
15 class GrProcessor; 15 class GrProcessor;
16 class GrProcessorKeyBuilder; 16 class GrProcessorKeyBuilder;
17 class GrGLSLCaps; 17 class GrGLSLCaps;
18 class GrGLSLFPBuilder; 18 class GrGLSLFPBuilder;
19 class GrGLSLFragmentBuilder; 19 class GrGLSLFPFragmentBuilder;
20 class GrGLSLUniformHandler; 20 class GrGLSLUniformHandler;
21 21
22 class GrGLSLFragmentProcessor { 22 class GrGLSLFragmentProcessor {
23 public: 23 public:
24 GrGLSLFragmentProcessor() {} 24 GrGLSLFragmentProcessor() {}
25 25
26 virtual ~GrGLSLFragmentProcessor() { 26 virtual ~GrGLSLFragmentProcessor() {
27 for (int i = 0; i < fChildProcessors.count(); ++i) { 27 for (int i = 0; i < fChildProcessors.count(); ++i) {
28 delete fChildProcessors[i]; 28 delete fChildProcessors[i];
29 } 29 }
(...skipping 15 matching lines...) Expand all
45 nullptr in which case the implied input is solid whi te (all ones). 45 nullptr in which case the implied input is solid whi te (all ones).
46 TODO: Better system for communicating optimization i nfo (e.g. input 46 TODO: Better system for communicating optimization i nfo (e.g. input
47 color is solid white, trans black, known to be opaqu e, etc.) that allows 47 color is solid white, trans black, known to be opaqu e, etc.) that allows
48 the processor to communicate back similar known info about its output. 48 the processor to communicate back similar known info about its output.
49 @param samplers Contains one entry for each GrTextureAccess of the G rProcessor. These 49 @param samplers Contains one entry for each GrTextureAccess of the G rProcessor. These
50 can be passed to the builder to emit texture reads i n the generated 50 can be passed to the builder to emit texture reads i n the generated
51 code. 51 code.
52 */ 52 */
53 53
54 struct EmitArgs { 54 struct EmitArgs {
55 EmitArgs(GrGLSLFragmentBuilder* fragBuilder, 55 EmitArgs(GrGLSLFPFragmentBuilder* fragBuilder,
56 GrGLSLUniformHandler* uniformHandler, 56 GrGLSLUniformHandler* uniformHandler,
57 const GrGLSLCaps* caps, 57 const GrGLSLCaps* caps,
58 const GrFragmentProcessor& fp, 58 const GrFragmentProcessor& fp,
59 const char* outputColor, 59 const char* outputColor,
60 const char* inputColor, 60 const char* inputColor,
61 const GrGLSLTransformedCoordsArray& coords, 61 const GrGLSLTransformedCoordsArray& coords,
62 const TextureSamplerArray& samplers) 62 const TextureSamplerArray& samplers)
63 : fFragBuilder(fragBuilder) 63 : fFragBuilder(fragBuilder)
64 , fUniformHandler(uniformHandler) 64 , fUniformHandler(uniformHandler)
65 , fGLSLCaps(caps) 65 , fGLSLCaps(caps)
66 , fFp(fp) 66 , fFp(fp)
67 , fOutputColor(outputColor) 67 , fOutputColor(outputColor)
68 , fInputColor(inputColor) 68 , fInputColor(inputColor)
69 , fCoords(coords) 69 , fCoords(coords)
70 , fSamplers(samplers) {} 70 , fSamplers(samplers) {}
71 GrGLSLFragmentBuilder* fFragBuilder; 71 GrGLSLFPFragmentBuilder* fFragBuilder;
72 GrGLSLUniformHandler* fUniformHandler; 72 GrGLSLUniformHandler* fUniformHandler;
73 const GrGLSLCaps* fGLSLCaps; 73 const GrGLSLCaps* fGLSLCaps;
74 const GrFragmentProcessor& fFp; 74 const GrFragmentProcessor& fFp;
75 const char* fOutputColor; 75 const char* fOutputColor;
76 const char* fInputColor; 76 const char* fInputColor;
77 const GrGLSLTransformedCoordsArray& fCoords; 77 const GrGLSLTransformedCoordsArray& fCoords;
78 const TextureSamplerArray& fSamplers; 78 const TextureSamplerArray& fSamplers;
79 }; 79 };
80 80
81 virtual void emitCode(EmitArgs&) = 0; 81 virtual void emitCode(EmitArgs&) = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 private: 116 private:
117 void internalEmitChild(int, const char*, const char*, EmitArgs&); 117 void internalEmitChild(int, const char*, const char*, EmitArgs&);
118 118
119 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors; 119 SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors;
120 120
121 friend class GrFragmentProcessor; 121 friend class GrFragmentProcessor;
122 }; 122 };
123 123
124 #endif 124 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrYUVEffect.cpp ('k') | src/gpu/glsl/GrGLSLFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698