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 GrPipelineBuilder_DEFINED | 8 #ifndef GrPipelineBuilder_DEFINED |
9 #define GrPipelineBuilder_DEFINED | 9 #define GrPipelineBuilder_DEFINED |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class GrDrawBatch; | 24 class GrDrawBatch; |
25 class GrCaps; | 25 class GrCaps; |
26 class GrPaint; | 26 class GrPaint; |
27 class GrTexture; | 27 class GrTexture; |
28 | 28 |
29 class GrPipelineBuilder : public SkNoncopyable { | 29 class GrPipelineBuilder : public SkNoncopyable { |
30 public: | 30 public: |
31 GrPipelineBuilder(); | 31 GrPipelineBuilder(); |
32 | 32 |
33 /** | 33 /** |
34 * Initializes the GrPipelineBuilder based on a GrPaint, MSAA availability.
Note | 34 * Initializes the GrPipelineBuilder based on a GrPaint and MSAA availabilit
y. Note |
35 * that GrPipelineBuilder encompasses more than GrPaint. Aspects of GrPipeli
neBuilder that have | 35 * that GrPipelineBuilder encompasses more than GrPaint. Aspects of GrPipeli
neBuilder that have |
36 * no GrPaint equivalents are set to default values with the exception of ve
rtex attribute state | 36 * no GrPaint equivalents are set to default values with the exception of ve
rtex attribute state |
37 * which is unmodified by this function and clipping which will be enabled. | 37 * which is unmodified by this function and clipping which will be enabled. |
38 */ | 38 */ |
39 GrPipelineBuilder(const GrPaint&, bool targetHasUnifiedMultisampling); | 39 GrPipelineBuilder(const GrPaint&, bool targetHasUnifiedMultisampling); |
40 | 40 |
41 virtual ~GrPipelineBuilder(); | 41 virtual ~GrPipelineBuilder(); |
42 | 42 |
43 /////////////////////////////////////////////////////////////////////////// | 43 /////////////////////////////////////////////////////////////////////////// |
44 /// @name Fragment Processors | 44 /// @name Fragment Processors |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 /** | 168 /** |
169 * Checks whether the xp will need destination in a texture to correctly ble
nd. | 169 * Checks whether the xp will need destination in a texture to correctly ble
nd. |
170 */ | 170 */ |
171 bool willXPNeedDstTexture(const GrCaps& caps, | 171 bool willXPNeedDstTexture(const GrCaps& caps, |
172 const GrPipelineOptimizations& optimizations) cons
t; | 172 const GrPipelineOptimizations& optimizations) cons
t; |
173 | 173 |
174 /// @} | 174 /// @} |
175 | 175 |
176 | 176 |
177 /////////////////////////////////////////////////////////////////////////// | 177 /////////////////////////////////////////////////////////////////////////// |
178 /// @name Render Target | |
179 //// | |
180 | |
181 /** | |
182 * Retrieves the currently set render-target. | |
183 * | |
184 * @return The currently set render target. | |
185 */ | |
186 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } | |
187 | |
188 /** | |
189 * Sets the render-target used at the next drawing call | |
190 * | |
191 * @param target The render target to set. | |
192 */ | |
193 void setRenderTarget(GrRenderTarget* target) { fRenderTarget.reset(SkSafeRef
(target)); } | |
194 | |
195 /// @} | |
196 | |
197 /////////////////////////////////////////////////////////////////////////// | |
198 /// @name Stencil | 178 /// @name Stencil |
199 //// | 179 //// |
200 | 180 |
201 bool hasUserStencilSettings() const { return !fUserStencilSettings->isUnused
(); } | 181 bool hasUserStencilSettings() const { return !fUserStencilSettings->isUnused
(); } |
202 const GrUserStencilSettings* getUserStencil() const { return fUserStencilSet
tings; } | 182 const GrUserStencilSettings* getUserStencil() const { return fUserStencilSet
tings; } |
203 | 183 |
204 /** | 184 /** |
205 * Sets the user stencil settings for the next draw. | 185 * Sets the user stencil settings for the next draw. |
206 * This class only stores pointers to stencil settings objects. | 186 * This class only stores pointers to stencil settings objects. |
207 * The caller guarantees the pointer will remain valid until it | 187 * The caller guarantees the pointer will remain valid until it |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 299 |
320 bool usePLSDstRead(const GrDrawBatch* batch) const; | 300 bool usePLSDstRead(const GrDrawBatch* batch) const; |
321 | 301 |
322 private: | 302 private: |
323 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 303 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
324 // This is used to assert that this condition holds. | 304 // This is used to assert that this condition holds. |
325 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) | 305 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) |
326 | 306 |
327 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra
y; | 307 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra
y; |
328 | 308 |
329 SkAutoTUnref<GrRenderTarget> fRenderTarget; | |
330 uint32_t fFlags; | 309 uint32_t fFlags; |
331 const GrUserStencilSettings* fUserStencilSettings; | 310 const GrUserStencilSettings* fUserStencilSettings; |
332 DrawFace fDrawFace; | 311 DrawFace fDrawFace; |
333 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; | 312 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; |
334 FragmentProcessorArray fColorFragmentProcessors; | 313 FragmentProcessorArray fColorFragmentProcessors; |
335 FragmentProcessorArray fCoverageFragmentProcessors; | 314 FragmentProcessorArray fCoverageFragmentProcessors; |
336 | 315 |
337 friend class GrPipeline; | 316 friend class GrPipeline; |
338 friend class GrDrawTarget; | 317 friend class GrDrawTarget; |
339 }; | 318 }; |
340 | 319 |
341 #endif | 320 #endif |
OLD | NEW |