OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 fClassID = kClassID; | 348 fClassID = kClassID; |
349 } | 349 } |
350 | 350 |
351 uint32_t fClassID; | 351 uint32_t fClassID; |
352 | 352 |
353 private: | 353 private: |
354 virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, | 354 virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
355 const GrPipelineOptimizations
& optimizations, | 355 const GrPipelineOptimizations
& optimizations, |
356 bool hasMixedSamples, | 356 bool hasMixedSamples, |
357 const DstTexture*) const = 0; | 357 const DstTexture*) const = 0; |
| 358 |
| 359 virtual bool onIsEqual(const GrXPFactory&) const = 0; |
| 360 |
| 361 bool willReadDstColor(const GrCaps& caps, |
| 362 const GrPipelineOptimizations& optimizations, |
| 363 bool hasMixedSamples) const; |
358 /** | 364 /** |
359 * Returns true if the XP generated by this factory will explicitly read ds
t in the fragment | 365 * Returns true if the XP generated by this factory will explicitly read ds
t in the fragment |
360 * shader. | 366 * shader. |
361 */ | 367 */ |
362 virtual bool willReadDstColor(const GrCaps& caps, | 368 virtual bool onWillReadDstColor(const GrCaps& caps, |
363 const GrPipelineOptimizations& optimizations, | 369 const GrPipelineOptimizations& optimizations
, |
364 bool hasMixedSamples) const = 0; | 370 bool hasMixedSamples) const = 0; |
365 | |
366 virtual bool onIsEqual(const GrXPFactory&) const = 0; | |
367 | 371 |
368 static uint32_t GenClassID() { | 372 static uint32_t GenClassID() { |
369 // fCurrXPFactoryID has been initialized to kIllegalXPFactoryID. The | 373 // fCurrXPFactoryID has been initialized to kIllegalXPFactoryID. The |
370 // atomic inc returns the old value not the incremented value. So we add | 374 // atomic inc returns the old value not the incremented value. So we add |
371 // 1 to the returned value. | 375 // 1 to the returned value. |
372 uint32_t id = static_cast<uint32_t>(sk_atomic_inc(&gCurrXPFClassID)) + 1
; | 376 uint32_t id = static_cast<uint32_t>(sk_atomic_inc(&gCurrXPFClassID)) + 1
; |
373 if (!id) { | 377 if (!id) { |
374 SkFAIL("This should never wrap as it should only be called once for
each GrXPFactory " | 378 SkFAIL("This should never wrap as it should only be called once for
each GrXPFactory " |
375 "subclass."); | 379 "subclass."); |
376 } | 380 } |
377 return id; | 381 return id; |
378 } | 382 } |
379 | 383 |
380 enum { | 384 enum { |
381 kIllegalXPFClassID = 0, | 385 kIllegalXPFClassID = 0, |
382 }; | 386 }; |
383 static int32_t gCurrXPFClassID; | 387 static int32_t gCurrXPFClassID; |
384 | 388 |
385 typedef GrProgramElement INHERITED; | 389 typedef GrProgramElement INHERITED; |
386 }; | 390 }; |
387 | 391 |
388 #endif | 392 #endif |
389 | 393 |
OLD | NEW |