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

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

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unneeded assert 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 GrGLSLSampler::SamplerArray SamplerArray; 25 typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle;
26
26 struct EmitArgs { 27 struct EmitArgs {
27 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder, 28 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder,
28 GrGLSLUniformHandler* uniformHandler, 29 GrGLSLUniformHandler* uniformHandler,
29 const GrGLSLCaps* caps, 30 const GrGLSLCaps* caps,
30 const GrXferProcessor& xp, 31 const GrXferProcessor& xp,
31 const char* inputColor, 32 const char* inputColor,
32 const char* inputCoverage, 33 const char* inputCoverage,
33 const char* outputPrimary, 34 const char* outputPrimary,
34 const char* outputSecondary, 35 const char* outputSecondary,
35 const SamplerArray& texSamplers, 36 const SamplerHandle* texSamplers,
36 const SamplerArray& bufferSamplers, 37 const SamplerHandle* bufferSamplers,
37 const bool usePLSDstRead) 38 const bool usePLSDstRead)
38 : fXPFragBuilder(fragBuilder) 39 : fXPFragBuilder(fragBuilder)
39 , fUniformHandler(uniformHandler) 40 , fUniformHandler(uniformHandler)
40 , fGLSLCaps(caps) 41 , fGLSLCaps(caps)
41 , fXP(xp) 42 , fXP(xp)
42 , fInputColor(inputColor) 43 , fInputColor(inputColor)
43 , fInputCoverage(inputCoverage) 44 , fInputCoverage(inputCoverage)
44 , fOutputPrimary(outputPrimary) 45 , fOutputPrimary(outputPrimary)
45 , fOutputSecondary(outputSecondary) 46 , fOutputSecondary(outputSecondary)
46 , fTexSamplers(texSamplers) 47 , fTexSamplers(texSamplers)
47 , fBufferSamplers(bufferSamplers) 48 , fBufferSamplers(bufferSamplers)
48 , fUsePLSDstRead(usePLSDstRead) {} 49 , fUsePLSDstRead(usePLSDstRead) {}
49 50
50 GrGLSLXPFragmentBuilder* fXPFragBuilder; 51 GrGLSLXPFragmentBuilder* fXPFragBuilder;
51 GrGLSLUniformHandler* fUniformHandler; 52 GrGLSLUniformHandler* fUniformHandler;
52 const GrGLSLCaps* fGLSLCaps; 53 const GrGLSLCaps* fGLSLCaps;
53 const GrXferProcessor& fXP; 54 const GrXferProcessor& fXP;
54 const char* fInputColor; 55 const char* fInputColor;
55 const char* fInputCoverage; 56 const char* fInputCoverage;
56 const char* fOutputPrimary; 57 const char* fOutputPrimary;
57 const char* fOutputSecondary; 58 const char* fOutputSecondary;
58 const SamplerArray& fTexSamplers; 59 const SamplerHandle* fTexSamplers;
59 const SamplerArray& fBufferSamplers; 60 const SamplerHandle* fBufferSamplers;
60 bool fUsePLSDstRead; 61 bool fUsePLSDstRead;
61 }; 62 };
62 /** 63 /**
63 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 64 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
64 * This allows the effect subclass to emit vertex code. 65 * This allows the effect subclass to emit vertex code.
65 */ 66 */
66 void emitCode(const EmitArgs&); 67 void emitCode(const EmitArgs&);
67 68
68 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso r that produces 69 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso r that produces
69 the same stage key; this function reads data from a GrGLSLXferProcessor and uploads any 70 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
107 const GrXferProcessor&) { 108 const GrXferProcessor&) {
108 SkFAIL("emitBlendCodeForDstRead not implemented."); 109 SkFAIL("emitBlendCodeForDstRead not implemented.");
109 } 110 }
110 111
111 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0; 112 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0;
112 113
113 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; 114 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni;
114 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; 115 GrGLSLProgramDataManager::UniformHandle fDstScaleUni;
115 }; 116 };
116 #endif 117 #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