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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 this->disableState(flags); | 259 this->disableState(flags); |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 /// @} | 263 /// @} |
264 | 264 |
265 /////////////////////////////////////////////////////////////////////////// | 265 /////////////////////////////////////////////////////////////////////////// |
266 /// @name Face Culling | 266 /// @name Face Culling |
267 //// | 267 //// |
268 | 268 |
269 enum DrawFace { | |
270 kInvalid_DrawFace = -1, | |
271 | |
272 kBoth_DrawFace, | |
273 kCCW_DrawFace, | |
274 kCW_DrawFace, | |
275 }; | |
276 | |
277 /** | 269 /** |
278 * Gets whether the target is drawing clockwise, counterclockwise, | 270 * Gets whether the target is drawing clockwise, counterclockwise, |
279 * or both faces. | 271 * or both faces. |
280 * @return the current draw face(s). | 272 * @return the current draw face(s). |
281 */ | 273 */ |
282 DrawFace getDrawFace() const { return fDrawFace; } | 274 GrDrawFace getDrawFace() const { return fDrawFace; } |
283 | 275 |
284 /** | 276 /** |
285 * Controls whether clockwise, counterclockwise, or both faces are drawn. | 277 * Controls whether clockwise, counterclockwise, or both faces are drawn. |
286 * @param face the face(s) to draw. | 278 * @param face the face(s) to draw. |
287 */ | 279 */ |
288 void setDrawFace(DrawFace face) { | 280 void setDrawFace(GrDrawFace face) { |
289 SkASSERT(kInvalid_DrawFace != face); | 281 SkASSERT(GrDrawFace::kInvalid != face); |
290 fDrawFace = face; | 282 fDrawFace = face; |
291 } | 283 } |
292 | 284 |
293 /// @} | 285 /// @} |
294 | 286 |
295 /////////////////////////////////////////////////////////////////////////// | 287 /////////////////////////////////////////////////////////////////////////// |
296 | 288 |
297 bool usePLSDstRead(const GrDrawBatch* batch) const; | 289 bool usePLSDstRead(const GrDrawBatch* batch) const; |
298 | 290 |
299 private: | 291 private: |
300 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 292 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
301 // This is used to assert that this condition holds. | 293 // This is used to assert that this condition holds. |
302 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) | 294 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) |
303 | 295 |
304 typedef SkSTArray<4, sk_sp<GrFragmentProcessor>> FragmentProcessorArray; | 296 typedef SkSTArray<4, sk_sp<GrFragmentProcessor>> FragmentProcessorArray; |
305 | 297 |
306 uint32_t fFlags; | 298 uint32_t fFlags; |
307 const GrUserStencilSettings* fUserStencilSettings; | 299 const GrUserStencilSettings* fUserStencilSettings; |
308 DrawFace fDrawFace; | 300 GrDrawFace fDrawFace; |
309 mutable sk_sp<GrXPFactory> fXPFactory; | 301 mutable sk_sp<GrXPFactory> fXPFactory; |
310 FragmentProcessorArray fColorFragmentProcessors; | 302 FragmentProcessorArray fColorFragmentProcessors; |
311 FragmentProcessorArray fCoverageFragmentProcessors; | 303 FragmentProcessorArray fCoverageFragmentProcessors; |
312 | 304 |
313 friend class GrPipeline; | 305 friend class GrPipeline; |
314 friend class GrDrawTarget; | 306 friend class GrDrawTarget; |
315 }; | 307 }; |
316 | 308 |
317 #endif | 309 #endif |
OLD | NEW |