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

Side by Side Diff: src/gpu/GrPipeline.h

Issue 1306803003: Revert of Remove GrStagedProcessor, remove the word Stage as it applies to FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrPendingFragmentStage.h ('k') | src/gpu/GrPipeline.cpp » ('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 GrPipeline_DEFINED 8 #ifndef GrPipeline_DEFINED
9 #define GrPipeline_DEFINED 9 #define GrPipeline_DEFINED
10 10
11 #include "GrColor.h" 11 #include "GrColor.h"
12 #include "GrFragmentProcessor.h"
13 #include "GrGpu.h" 12 #include "GrGpu.h"
14 #include "GrNonAtomicRef.h" 13 #include "GrNonAtomicRef.h"
15 #include "GrPendingProgramElement.h" 14 #include "GrPendingFragmentStage.h"
16 #include "GrPrimitiveProcessor.h" 15 #include "GrPrimitiveProcessor.h"
17 #include "GrProgramDesc.h" 16 #include "GrProgramDesc.h"
18 #include "GrStencil.h" 17 #include "GrStencil.h"
19 #include "GrTypesPriv.h" 18 #include "GrTypesPriv.h"
20 #include "SkMatrix.h" 19 #include "SkMatrix.h"
21 #include "SkRefCnt.h" 20 #include "SkRefCnt.h"
22 21
23 class GrBatch; 22 class GrBatch;
24 class GrDeviceCoordTexture; 23 class GrDeviceCoordTexture;
25 class GrPipelineBuilder; 24 class GrPipelineBuilder;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 77 }
79 return true; 78 return true;
80 } 79 }
81 80
82 /// @} 81 /// @}
83 82
84 /////////////////////////////////////////////////////////////////////////// 83 ///////////////////////////////////////////////////////////////////////////
85 /// @name GrFragmentProcessors 84 /// @name GrFragmentProcessors
86 85
87 86
88 int numColorFragmentProcessors() const { return fNumColorProcessors; } 87 int numColorFragmentStages() const { return fNumColorStages; }
89 int numCoverageFragmentProcessors() const { 88 int numCoverageFragmentStages() const { return fFragmentStages.count() - fNu mColorStages; }
90 return fFragmentProcessors.count() - fNumColorProcessors; 89 int numFragmentStages() const { return fFragmentStages.count(); }
91 }
92 int numFragmentProcessors() const { return fFragmentProcessors.count(); }
93 90
94 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get( ); } 91 const GrXferProcessor* getXferProcessor() const { return fXferProcessor.get( ); }
95 92
96 const GrFragmentProcessor& getColorFragmentProcessor(int idx) const { 93 const GrPendingFragmentStage& getColorStage(int idx) const {
97 SkASSERT(idx < this->numColorFragmentProcessors()); 94 SkASSERT(idx < this->numColorFragmentStages());
98 return *fFragmentProcessors[idx].get(); 95 return fFragmentStages[idx];
99 } 96 }
100 97 const GrPendingFragmentStage& getCoverageStage(int idx) const {
101 const GrFragmentProcessor& getCoverageFragmentProcessor(int idx) const { 98 SkASSERT(idx < this->numCoverageFragmentStages());
102 SkASSERT(idx < this->numCoverageFragmentProcessors()); 99 return fFragmentStages[fNumColorStages + idx];
103 return *fFragmentProcessors[fNumColorProcessors + idx].get();
104 } 100 }
105 101 const GrPendingFragmentStage& getFragmentStage(int idx) const {
106 const GrFragmentProcessor& getFragmentProcessor(int idx) const { 102 return fFragmentStages[idx];
107 return *fFragmentProcessors[idx].get();
108 } 103 }
109 104
110 /// @} 105 /// @}
111 106
112 /** 107 /**
113 * Retrieves the currently set render-target. 108 * Retrieves the currently set render-target.
114 * 109 *
115 * @return The currently set render target. 110 * @return The currently set render target.
116 */ 111 */
117 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } 112 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); }
(...skipping 29 matching lines...) Expand all
147 private: 142 private:
148 GrPipeline() { /** Initialized in factory function*/ } 143 GrPipeline() { /** Initialized in factory function*/ }
149 144
150 /** 145 /**
151 * Alter the program desc and inputs (attribs and processors) based on the b lend optimization. 146 * Alter the program desc and inputs (attribs and processors) based on the b lend optimization.
152 */ 147 */
153 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds, 148 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds,
154 GrXferProcessor::OptFlags, 149 GrXferProcessor::OptFlags,
155 const GrProcOptInfo& colorPOI, 150 const GrProcOptInfo& colorPOI,
156 const GrProcOptInfo& coveragePOI, 151 const GrProcOptInfo& coveragePOI,
157 int* firstColorProcessorIdx, 152 int* firstColorStageIdx,
158 int* firstCoverageProcessorIdx); 153 int* firstCoverageStageIdx);
159 154
160 /** 155 /**
161 * Calculates the primary and secondary output types of the shader. For cert ain output types 156 * Calculates the primary and secondary output types of the shader. For cert ain output types
162 * the function may adjust the blend coefficients. After this function is ca lled the src and dst 157 * the function may adjust the blend coefficients. After this function is ca lled the src and dst
163 * blend coeffs will represent those used by backend API. 158 * blend coeffs will represent those used by backend API.
164 */ 159 */
165 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla gs, 160 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla gs,
166 const GrCaps&); 161 const GrCaps&);
167 162
168 enum Flags { 163 enum Flags {
169 kDither_Flag = 0x1, 164 kDither_Flag = 0x1,
170 kHWAA_Flag = 0x2, 165 kHWAA_Flag = 0x2,
171 kSnapVertices_Flag = 0x4, 166 kSnapVertices_Flag = 0x4,
172 }; 167 };
173 168
174 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; 169 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
175 typedef GrPendingProgramElement<const GrFragmentProcessor> PendingFragmentPr ocessor; 170 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray;
176 typedef SkAutoSTArray<8, PendingFragmentProcessor> FragmentProcessorArray;
177 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; 171 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor;
178 RenderTarget fRenderTarget; 172 RenderTarget fRenderTarget;
179 GrScissorState fScissorState; 173 GrScissorState fScissorState;
180 GrStencilSettings fStencilSettings; 174 GrStencilSettings fStencilSettings;
181 GrPipelineBuilder::DrawFace fDrawFace; 175 GrPipelineBuilder::DrawFace fDrawFace;
182 uint32_t fFlags; 176 uint32_t fFlags;
183 ProgramXferProcessor fXferProcessor; 177 ProgramXferProcessor fXferProcessor;
184 FragmentProcessorArray fFragmentProcessors; 178 FragmentStageArray fFragmentStages;
185 bool fReadsFragPosition; 179 bool fReadsFragPosition;
186 180
187 // This value is also the index in fFragmentProcessors where coverage proces sors begin. 181 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin.
188 int fNumColorProcessors; 182 int fNumColorStages;
189 183
190 SkSTArray<8, const GrCoordTransform*, true> fCoordTransforms; 184 SkSTArray<8, const GrCoordTransform*, true> fCoordTransforms;
191 GrProgramDesc fDesc; 185 GrProgramDesc fDesc;
192 186
193 typedef SkRefCnt INHERITED; 187 typedef SkRefCnt INHERITED;
194 }; 188 };
195 189
196 #endif 190 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPendingFragmentStage.h ('k') | src/gpu/GrPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698