| 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 |
| 11 #include "GrBlend.h" | 11 #include "GrBlend.h" |
| 12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
| 13 #include "GrClip.h" | 13 #include "GrClip.h" |
| 14 #include "GrGpuResourceRef.h" | 14 #include "GrGpuResourceRef.h" |
| 15 #include "GrFragmentStage.h" | 15 #include "GrFragmentStage.h" |
| 16 #include "GrProcOptInfo.h" | 16 #include "GrProcOptInfo.h" |
| 17 #include "GrProcessorDataManager.h" |
| 17 #include "GrRenderTarget.h" | 18 #include "GrRenderTarget.h" |
| 18 #include "GrStencil.h" | 19 #include "GrStencil.h" |
| 19 #include "GrXferProcessor.h" | 20 #include "GrXferProcessor.h" |
| 20 #include "SkMatrix.h" | 21 #include "SkMatrix.h" |
| 21 #include "effects/GrCoverageSetOpXP.h" | 22 #include "effects/GrCoverageSetOpXP.h" |
| 22 #include "effects/GrDisableColorXP.h" | 23 #include "effects/GrDisableColorXP.h" |
| 23 #include "effects/GrPorterDuffXferProcessor.h" | 24 #include "effects/GrPorterDuffXferProcessor.h" |
| 24 #include "effects/GrSimpleTextureEffect.h" | 25 #include "effects/GrSimpleTextureEffect.h" |
| 25 | 26 |
| 26 class GrBatch; | 27 class GrBatch; |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 385 } |
| 385 | 386 |
| 386 const GrProcOptInfo& coverageProcInfo(const GrBatch* batch) const { | 387 const GrProcOptInfo& coverageProcInfo(const GrBatch* batch) const { |
| 387 this->calcCoverageInvariantOutput(batch); | 388 this->calcCoverageInvariantOutput(batch); |
| 388 return fCoverageProcInfo; | 389 return fCoverageProcInfo; |
| 389 } | 390 } |
| 390 | 391 |
| 391 void setClip(const GrClip& clip) { fClip = clip; } | 392 void setClip(const GrClip& clip) { fClip = clip; } |
| 392 const GrClip& clip() const { return fClip; } | 393 const GrClip& clip() const { return fClip; } |
| 393 | 394 |
| 395 GrProcessorDataManager* getProcessorDataManager() { return &fProcDataManager
; } |
| 396 |
| 394 private: | 397 private: |
| 395 // Calculating invariant color / coverage information is expensive, so we pa
rtially cache the | 398 // Calculating invariant color / coverage information is expensive, so we pa
rtially cache the |
| 396 // results. | 399 // results. |
| 397 // | 400 // |
| 398 // canUseFracCoveragePrimProc() - Called in regular skia draw, caches result
s but only for a | 401 // canUseFracCoveragePrimProc() - Called in regular skia draw, caches result
s but only for a |
| 399 // specific color and coverage. May be calle
d multiple times | 402 // specific color and coverage. May be calle
d multiple times |
| 400 // willColorBlendWithDst() - only called by Nvpr, does not cache results | 403 // willColorBlendWithDst() - only called by Nvpr, does not cache results |
| 401 // GrOptDrawState constructor - never caches results | 404 // GrOptDrawState constructor - never caches results |
| 402 | 405 |
| 403 /** | 406 /** |
| (...skipping 20 matching lines...) Expand all Loading... |
| 424 * processors and results are stored in fCoverageProcInfo. | 427 * processors and results are stored in fCoverageProcInfo. |
| 425 */ | 428 */ |
| 426 void calcCoverageInvariantOutput(GrColor) const; | 429 void calcCoverageInvariantOutput(GrColor) const; |
| 427 | 430 |
| 428 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 431 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
| 429 // This is used to assert that this condition holds. | 432 // This is used to assert that this condition holds. |
| 430 SkDEBUGCODE(int fBlockEffectRemovalCnt;) | 433 SkDEBUGCODE(int fBlockEffectRemovalCnt;) |
| 431 | 434 |
| 432 typedef SkSTArray<4, GrFragmentStage> FragmentStageArray; | 435 typedef SkSTArray<4, GrFragmentStage> FragmentStageArray; |
| 433 | 436 |
| 437 GrProcessorDataManager fProcDataManager; |
| 434 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 438 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
| 435 uint32_t fFlags; | 439 uint32_t fFlags; |
| 436 GrStencilSettings fStencilSettings; | 440 GrStencilSettings fStencilSettings; |
| 437 DrawFace fDrawFace; | 441 DrawFace fDrawFace; |
| 438 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; | 442 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; |
| 439 FragmentStageArray fColorStages; | 443 FragmentStageArray fColorStages; |
| 440 FragmentStageArray fCoverageStages; | 444 FragmentStageArray fCoverageStages; |
| 441 GrClip fClip; | 445 GrClip fClip; |
| 442 | 446 |
| 443 mutable GrProcOptInfo fColorProcInfo; | 447 mutable GrProcOptInfo fColorProcInfo; |
| 444 mutable GrProcOptInfo fCoverageProcInfo; | 448 mutable GrProcOptInfo fCoverageProcInfo; |
| 445 mutable bool fColorProcInfoValid; | 449 mutable bool fColorProcInfoValid; |
| 446 mutable bool fCoverageProcInfoValid; | 450 mutable bool fCoverageProcInfoValid; |
| 447 mutable GrColor fColorCache; | 451 mutable GrColor fColorCache; |
| 448 mutable GrColor fCoverageCache; | 452 mutable GrColor fCoverageCache; |
| 449 | 453 |
| 450 friend class GrPipeline; | 454 friend class GrPipeline; |
| 451 }; | 455 }; |
| 452 | 456 |
| 453 #endif | 457 #endif |
| OLD | NEW |