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

Side by Side Diff: src/gpu/glsl/GrGLSLPrimitiveProcessor.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/glsl/GrGLSLFragmentProcessor.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.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 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 GrGLSLPrimitiveProcessor_DEFINED 8 #ifndef GrGLSLPrimitiveProcessor_DEFINED
9 #define GrGLSLPrimitiveProcessor_DEFINED 9 #define GrGLSLPrimitiveProcessor_DEFINED
10 10
11 #include "GrPrimitiveProcessor.h" 11 #include "GrPrimitiveProcessor.h"
12 #include "glsl/GrGLSLProcessorTypes.h" 12 #include "glsl/GrGLSLProcessorTypes.h"
13 #include "glsl/GrGLSLProgramDataManager.h" 13 #include "glsl/GrGLSLProgramDataManager.h"
14 #include "glsl/GrGLSLTextureSampler.h" 14 #include "glsl/GrGLSLTextureSampler.h"
15 15
16 class GrBatchTracker; 16 class GrBatchTracker;
17 class GrPrimitiveProcessor; 17 class GrPrimitiveProcessor;
18 class GrGLSLVertexBuilder; 18 class GrGLSLCaps;
19 class GrGLSLFragmentBuilder; 19 class GrGLSLFragmentBuilder;
20 class GrGLSLGPBuilder; 20 class GrGLSLGPBuilder;
21 class GrGLSLVertexBuilder;
21 22
22 class GrGLSLPrimitiveProcessor { 23 class GrGLSLPrimitiveProcessor {
23 public: 24 public:
24 virtual ~GrGLSLPrimitiveProcessor() {} 25 virtual ~GrGLSLPrimitiveProcessor() {}
25 26
26 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; 27 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
27 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray; 28 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray;
28 29
29 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords; 30 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords;
30 typedef SkSTArray<8, ProcCoords> TransformsIn; 31 typedef SkSTArray<8, ProcCoords> TransformsIn;
31 typedef SkSTArray<8, GrGLSLTransformedCoordsArray> TransformsOut; 32 typedef SkSTArray<8, GrGLSLTransformedCoordsArray> TransformsOut;
32 33
33 struct EmitArgs { 34 struct EmitArgs {
34 EmitArgs(GrGLSLGPBuilder* pb, 35 EmitArgs(GrGLSLGPBuilder* pb,
35 GrGLSLVertexBuilder* vertBuilder, 36 GrGLSLVertexBuilder* vertBuilder,
36 GrGLSLFragmentBuilder* fragBuilder, 37 GrGLSLFragmentBuilder* fragBuilder,
38 const GrGLSLCaps* caps,
37 const GrPrimitiveProcessor& gp, 39 const GrPrimitiveProcessor& gp,
38 const char* outputColor, 40 const char* outputColor,
39 const char* outputCoverage, 41 const char* outputCoverage,
40 const TextureSamplerArray& samplers, 42 const TextureSamplerArray& samplers,
41 const TransformsIn& transformsIn, 43 const TransformsIn& transformsIn,
42 TransformsOut* transformsOut) 44 TransformsOut* transformsOut)
43 : fPB(pb) 45 : fPB(pb)
44 , fVertBuilder(vertBuilder) 46 , fVertBuilder(vertBuilder)
45 , fFragBuilder(fragBuilder) 47 , fFragBuilder(fragBuilder)
48 , fGLSLCaps(caps)
46 , fGP(gp) 49 , fGP(gp)
47 , fOutputColor(outputColor) 50 , fOutputColor(outputColor)
48 , fOutputCoverage(outputCoverage) 51 , fOutputCoverage(outputCoverage)
49 , fSamplers(samplers) 52 , fSamplers(samplers)
50 , fTransformsIn(transformsIn) 53 , fTransformsIn(transformsIn)
51 , fTransformsOut(transformsOut) {} 54 , fTransformsOut(transformsOut) {}
52 GrGLSLGPBuilder* fPB; 55 GrGLSLGPBuilder* fPB;
53 GrGLSLVertexBuilder* fVertBuilder; 56 GrGLSLVertexBuilder* fVertBuilder;
54 GrGLSLFragmentBuilder* fFragBuilder; 57 GrGLSLFragmentBuilder* fFragBuilder;
58 const GrGLSLCaps* fGLSLCaps;
55 const GrPrimitiveProcessor& fGP; 59 const GrPrimitiveProcessor& fGP;
56 const char* fOutputColor; 60 const char* fOutputColor;
57 const char* fOutputCoverage; 61 const char* fOutputCoverage;
58 const TextureSamplerArray& fSamplers; 62 const TextureSamplerArray& fSamplers;
59 const TransformsIn& fTransformsIn; 63 const TransformsIn& fTransformsIn;
60 TransformsOut* fTransformsOut; 64 TransformsOut* fTransformsOut;
61 }; 65 };
62 66
63 /** 67 /**
64 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 68 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
(...skipping 27 matching lines...) Expand all
92 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } 96 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); }
93 UniformHandle fHandle; 97 UniformHandle fHandle;
94 SkMatrix fCurrentValue; 98 SkMatrix fCurrentValue;
95 GrSLType fType; 99 GrSLType fType;
96 }; 100 };
97 101
98 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; 102 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms;
99 }; 103 };
100 104
101 #endif 105 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLFragmentProcessor.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698