OLD | NEW |
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 GrPipeline_DEFINED | 8 #ifndef GrPipeline_DEFINED |
9 #define GrPipeline_DEFINED | 9 #define GrPipeline_DEFINED |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class GrPipelineBuilder; | 22 class GrPipelineBuilder; |
23 | 23 |
24 /** | 24 /** |
25 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable | 25 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable |
26 * class, and contains all data needed to set the state for a gpu draw. | 26 * class, and contains all data needed to set the state for a gpu draw. |
27 */ | 27 */ |
28 class GrPipeline { | 28 class GrPipeline { |
29 public: | 29 public: |
30 SK_DECLARE_INST_COUNT(GrPipeline) | 30 SK_DECLARE_INST_COUNT(GrPipeline) |
31 | 31 |
32 // TODO get rid of this version of the constructor when we use batch everywh
ere | 32 GrPipeline(const GrPipelineBuilder&, |
33 GrPipeline(const GrPipelineBuilder& pipelineBuilder, const GrPrimitiveProces
sor*, | 33 const GrProcOptInfo& colorPOI, |
34 const GrDrawTargetCaps&, const GrScissorState&, | 34 const GrProcOptInfo& coveragePOI, |
| 35 const GrDrawTargetCaps&, |
| 36 const GrScissorState&, |
35 const GrDeviceCoordTexture* dstCopy); | 37 const GrDeviceCoordTexture* dstCopy); |
36 | 38 |
37 GrPipeline(GrBatch*, const GrPipelineBuilder&, const GrDrawTargetCaps&, | |
38 const GrScissorState&, const GrDeviceCoordTexture* dstCopy); | |
39 | |
40 /* | 39 /* |
41 * Returns true if it is possible to combine the two GrPipelines and it will
update 'this' | 40 * Returns true if it is possible to combine the two GrPipelines and it will
update 'this' |
42 * to subsume 'that''s draw. | 41 * to subsume 'that''s draw. |
43 */ | 42 */ |
44 bool isEqual(const GrPipeline& that) const; | 43 bool isEqual(const GrPipeline& that) const; |
45 | 44 |
46 /// @} | 45 /// @} |
47 | 46 |
48 /////////////////////////////////////////////////////////////////////////// | 47 /////////////////////////////////////////////////////////////////////////// |
49 /// @name Effect Stages | 48 /// @name Effect Stages |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 129 |
131 /// @} | 130 /// @} |
132 | 131 |
133 /////////////////////////////////////////////////////////////////////////// | 132 /////////////////////////////////////////////////////////////////////////// |
134 | 133 |
135 bool readsFragPosition() const { return fReadsFragPosition; } | 134 bool readsFragPosition() const { return fReadsFragPosition; } |
136 | 135 |
137 const GrPipelineInfo& getInitBatchTracker() const { return fInitBT; } | 136 const GrPipelineInfo& getInitBatchTracker() const { return fInitBT; } |
138 | 137 |
139 private: | 138 private: |
140 // TODO we can have one constructor once GrBatch is complete | |
141 void internalConstructor(const GrPipelineBuilder&, | |
142 const GrProcOptInfo& colorPOI, | |
143 const GrProcOptInfo& coveragePOI, | |
144 const GrDrawTargetCaps&, | |
145 const GrScissorState&, | |
146 const GrDeviceCoordTexture* dstCopy); | |
147 | |
148 /** | 139 /** |
149 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. | 140 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. |
150 */ | 141 */ |
151 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds, | 142 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds, |
152 GrXferProcessor::OptFlags, | 143 GrXferProcessor::OptFlags, |
153 const GrProcOptInfo& colorPOI, | 144 const GrProcOptInfo& colorPOI, |
154 const GrProcOptInfo& coveragePOI, | 145 const GrProcOptInfo& coveragePOI, |
155 int* firstColorStageIdx, | 146 int* firstColorStageIdx, |
156 int* firstCoverageStageIdx); | 147 int* firstCoverageStageIdx); |
157 | 148 |
(...skipping 25 matching lines...) Expand all Loading... |
183 | 174 |
184 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 175 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
185 int fNumColorStages; | 176 int fNumColorStages; |
186 | 177 |
187 GrProgramDesc fDesc; | 178 GrProgramDesc fDesc; |
188 | 179 |
189 typedef SkRefCnt INHERITED; | 180 typedef SkRefCnt INHERITED; |
190 }; | 181 }; |
191 | 182 |
192 #endif | 183 #endif |
OLD | NEW |