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

Side by Side Diff: src/gpu/gl/GrGLPrimitiveProcessor.h

Issue 1332923003: Remove batchtracker (Closed) Base URL: https://skia.googlesource.com/skia.git@latecreatepathprocessor
Patch Set: tweaks Created 5 years, 3 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/gl/GrGLPathProcessor.cpp ('k') | src/gpu/gl/GrGLProgram.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 GrGLPrimitiveProcessor_DEFINED 8 #ifndef GrGLPrimitiveProcessor_DEFINED
9 #define GrGLPrimitiveProcessor_DEFINED 9 #define GrGLPrimitiveProcessor_DEFINED
10 10
(...skipping 13 matching lines...) Expand all
24 typedef GrGLPathProgramDataManager::SeparableVaryingHandle SeparableVaryingH andle; 24 typedef GrGLPathProgramDataManager::SeparableVaryingHandle SeparableVaryingH andle;
25 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray; 25 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
26 26
27 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords; 27 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords;
28 typedef SkSTArray<8, ProcCoords> TransformsIn; 28 typedef SkSTArray<8, ProcCoords> TransformsIn;
29 typedef SkSTArray<8, GrGLProcessor::TransformedCoordsArray> TransformsOut; 29 typedef SkSTArray<8, GrGLProcessor::TransformedCoordsArray> TransformsOut;
30 30
31 struct EmitArgs { 31 struct EmitArgs {
32 EmitArgs(GrGLGPBuilder* pb, 32 EmitArgs(GrGLGPBuilder* pb,
33 const GrPrimitiveProcessor& gp, 33 const GrPrimitiveProcessor& gp,
34 const GrBatchTracker& bt,
35 const char* outputColor, 34 const char* outputColor,
36 const char* outputCoverage, 35 const char* outputCoverage,
37 const TextureSamplerArray& samplers, 36 const TextureSamplerArray& samplers,
38 const TransformsIn& transformsIn, 37 const TransformsIn& transformsIn,
39 TransformsOut* transformsOut) 38 TransformsOut* transformsOut)
40 : fPB(pb) 39 : fPB(pb)
41 , fGP(gp) 40 , fGP(gp)
42 , fBT(bt)
43 , fOutputColor(outputColor) 41 , fOutputColor(outputColor)
44 , fOutputCoverage(outputCoverage) 42 , fOutputCoverage(outputCoverage)
45 , fSamplers(samplers) 43 , fSamplers(samplers)
46 , fTransformsIn(transformsIn) 44 , fTransformsIn(transformsIn)
47 , fTransformsOut(transformsOut) {} 45 , fTransformsOut(transformsOut) {}
48 GrGLGPBuilder* fPB; 46 GrGLGPBuilder* fPB;
49 const GrPrimitiveProcessor& fGP; 47 const GrPrimitiveProcessor& fGP;
50 const GrBatchTracker& fBT;
51 const char* fOutputColor; 48 const char* fOutputColor;
52 const char* fOutputCoverage; 49 const char* fOutputCoverage;
53 const TextureSamplerArray& fSamplers; 50 const TextureSamplerArray& fSamplers;
54 const TransformsIn& fTransformsIn; 51 const TransformsIn& fTransformsIn;
55 TransformsOut* fTransformsOut; 52 TransformsOut* fTransformsOut;
56 }; 53 };
57 54
58 /** 55 /**
59 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 56 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
60 * This allows the effect subclass to emit vertex code. 57 * This allows the effect subclass to emit vertex code.
61 */ 58 */
62 virtual void emitCode(EmitArgs&) = 0; 59 virtual void emitCode(EmitArgs&) = 0;
63 60
64 61
65 /** A GrGLPrimitiveProcessor instance can be reused with any GrGLPrimitivePr ocessor that 62 /** A GrGLPrimitiveProcessor instance can be reused with any GrGLPrimitivePr ocessor that
66 produces the same stage key; this function reads data from a GrGLPrimiti veProcessor and 63 produces the same stage key; this function reads data from a GrGLPrimiti veProcessor and
67 uploads any uniform variables required by the shaders created in emitCo de(). The 64 uploads any uniform variables required by the shaders created in emitCo de(). The
68 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this 65 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this
69 GrGLPrimitiveProcessor and to have an identical processor key as the one that created this 66 GrGLPrimitiveProcessor and to have an identical processor key as the one that created this
70 GrGLPrimitiveProcessor. */ 67 GrGLPrimitiveProcessor. */
71 virtual void setData(const GrGLProgramDataManager&, 68 virtual void setData(const GrGLProgramDataManager&, const GrPrimitiveProcess or&) = 0;
72 const GrPrimitiveProcessor&,
73 const GrBatchTracker&) = 0;
74 69
75 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&); 70 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&);
76 71
77 protected: 72 protected:
78 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan dle* colorUniform); 73 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan dle* colorUniform);
79 74
80 class ShaderVarHandle { 75 class ShaderVarHandle {
81 public: 76 public:
82 bool isValid() const { return fHandle > -1; } 77 bool isValid() const { return fHandle > -1; }
83 ShaderVarHandle() : fHandle(-1) {} 78 ShaderVarHandle() : fHandle(-1) {}
(...skipping 16 matching lines...) Expand all
100 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } 95 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); }
101 ShaderVarHandle fHandle; 96 ShaderVarHandle fHandle;
102 SkMatrix fCurrentValue; 97 SkMatrix fCurrentValue;
103 GrSLType fType; 98 GrSLType fType;
104 }; 99 };
105 100
106 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; 101 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms;
107 }; 102 };
108 103
109 #endif 104 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathProcessor.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698