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

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

Issue 1896013003: Revert of Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/glsl/GrGLSLUniformHandler.h ('k') | src/gpu/vk/GrVkGLSLSampler.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 GrGLSLXferProcessor_DEFINED 8 #ifndef GrGLSLXferProcessor_DEFINED
9 #define GrGLSLXferProcessor_DEFINED 9 #define GrGLSLXferProcessor_DEFINED
10 10
11 #include "glsl/GrGLSLProgramDataManager.h" 11 #include "glsl/GrGLSLProgramDataManager.h"
12 #include "glsl/GrGLSLSampler.h" 12 #include "glsl/GrGLSLSampler.h"
13 13
14 class GrXferProcessor; 14 class GrXferProcessor;
15 class GrGLSLCaps; 15 class GrGLSLCaps;
16 class GrGLSLUniformHandler; 16 class GrGLSLUniformHandler;
17 class GrGLSLXPBuilder; 17 class GrGLSLXPBuilder;
18 class GrGLSLXPFragmentBuilder; 18 class GrGLSLXPFragmentBuilder;
19 19
20 class GrGLSLXferProcessor { 20 class GrGLSLXferProcessor {
21 public: 21 public:
22 GrGLSLXferProcessor() {} 22 GrGLSLXferProcessor() {}
23 virtual ~GrGLSLXferProcessor() {} 23 virtual ~GrGLSLXferProcessor() {}
24 24
25 typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle; 25 typedef GrGLSLSampler::SamplerArray SamplerArray;
26
27 struct EmitArgs { 26 struct EmitArgs {
28 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder, 27 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder,
29 GrGLSLUniformHandler* uniformHandler, 28 GrGLSLUniformHandler* uniformHandler,
30 const GrGLSLCaps* caps, 29 const GrGLSLCaps* caps,
31 const GrXferProcessor& xp, 30 const GrXferProcessor& xp,
32 const char* inputColor, 31 const char* inputColor,
33 const char* inputCoverage, 32 const char* inputCoverage,
34 const char* outputPrimary, 33 const char* outputPrimary,
35 const char* outputSecondary, 34 const char* outputSecondary,
36 const SamplerHandle* texSamplers, 35 const SamplerArray& texSamplers,
37 const SamplerHandle* bufferSamplers, 36 const SamplerArray& bufferSamplers,
38 const bool usePLSDstRead) 37 const bool usePLSDstRead)
39 : fXPFragBuilder(fragBuilder) 38 : fXPFragBuilder(fragBuilder)
40 , fUniformHandler(uniformHandler) 39 , fUniformHandler(uniformHandler)
41 , fGLSLCaps(caps) 40 , fGLSLCaps(caps)
42 , fXP(xp) 41 , fXP(xp)
43 , fInputColor(inputColor) 42 , fInputColor(inputColor)
44 , fInputCoverage(inputCoverage) 43 , fInputCoverage(inputCoverage)
45 , fOutputPrimary(outputPrimary) 44 , fOutputPrimary(outputPrimary)
46 , fOutputSecondary(outputSecondary) 45 , fOutputSecondary(outputSecondary)
47 , fTexSamplers(texSamplers) 46 , fTexSamplers(texSamplers)
48 , fBufferSamplers(bufferSamplers) 47 , fBufferSamplers(bufferSamplers)
49 , fUsePLSDstRead(usePLSDstRead) {} 48 , fUsePLSDstRead(usePLSDstRead) {}
50 49
51 GrGLSLXPFragmentBuilder* fXPFragBuilder; 50 GrGLSLXPFragmentBuilder* fXPFragBuilder;
52 GrGLSLUniformHandler* fUniformHandler; 51 GrGLSLUniformHandler* fUniformHandler;
53 const GrGLSLCaps* fGLSLCaps; 52 const GrGLSLCaps* fGLSLCaps;
54 const GrXferProcessor& fXP; 53 const GrXferProcessor& fXP;
55 const char* fInputColor; 54 const char* fInputColor;
56 const char* fInputCoverage; 55 const char* fInputCoverage;
57 const char* fOutputPrimary; 56 const char* fOutputPrimary;
58 const char* fOutputSecondary; 57 const char* fOutputSecondary;
59 const SamplerHandle* fTexSamplers; 58 const SamplerArray& fTexSamplers;
60 const SamplerHandle* fBufferSamplers; 59 const SamplerArray& fBufferSamplers;
61 bool fUsePLSDstRead; 60 bool fUsePLSDstRead;
62 }; 61 };
63 /** 62 /**
64 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 63 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
65 * This allows the effect subclass to emit vertex code. 64 * This allows the effect subclass to emit vertex code.
66 */ 65 */
67 void emitCode(const EmitArgs&); 66 void emitCode(const EmitArgs&);
68 67
69 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso r that produces 68 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso r that produces
70 the same stage key; this function reads data from a GrGLSLXferProcessor and uploads any 69 the same stage key; this function reads data from a GrGLSLXferProcessor and uploads any
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 const GrXferProcessor&) { 107 const GrXferProcessor&) {
109 SkFAIL("emitBlendCodeForDstRead not implemented."); 108 SkFAIL("emitBlendCodeForDstRead not implemented.");
110 } 109 }
111 110
112 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0; 111 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0;
113 112
114 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; 113 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni;
115 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; 114 GrGLSLProgramDataManager::UniformHandle fDstScaleUni;
116 }; 115 };
117 #endif 116 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLUniformHandler.h ('k') | src/gpu/vk/GrVkGLSLSampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698