diff options
author | 2015-08-26 05:39:18 -0700 | |
---|---|---|
committer | 2015-08-26 05:39:18 -0700 | |
commit | 24243446cdf7b7e4e132c2a0c387c7723777e0c7 (patch) | |
tree | a1515829dd08b0c600dc5878fe3495d28adc8549 /src/gpu/GrPipelineBuilder.h | |
parent | 60e0fee6d4acff638ccc9670c4055aced529a7a0 (diff) |
Remove GrStagedProcessor, remove the word Stage as it applies to FPs
Review URL: https://codereview.chromium.org/1307223004
Diffstat (limited to 'src/gpu/GrPipelineBuilder.h')
-rw-r--r-- | src/gpu/GrPipelineBuilder.h | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h index 1c6eb5f022..47b996ad3d 100644 --- a/src/gpu/GrPipelineBuilder.h +++ b/src/gpu/GrPipelineBuilder.h @@ -12,7 +12,6 @@ #include "GrCaps.h" #include "GrClip.h" #include "GrGpuResourceRef.h" -#include "GrStagedProcessor.h" #include "GrProcOptInfo.h" #include "GrProcessorDataManager.h" #include "GrRenderTarget.h" @@ -29,15 +28,10 @@ class GrCaps; class GrPaint; class GrTexture; -class GrPipelineBuilder { +class GrPipelineBuilder : public SkNoncopyable { public: GrPipelineBuilder(); - GrPipelineBuilder(const GrPipelineBuilder& pipelineBuilder) { - SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) - *this = pipelineBuilder; - } - /** * Initializes the GrPipelineBuilder based on a GrPaint, render target, and clip. Note * that GrPipelineBuilder encompasses more than GrPaint. Aspects of GrPipelineBuilder that have @@ -58,51 +52,56 @@ public: /// feed their output to the GrXferProcessor which controls blending. //// - int numColorFragmentStages() const { return fColorStages.count(); } - int numCoverageFragmentStages() const { return fCoverageStages.count(); } - int numFragmentStages() const { return this->numColorFragmentStages() + - this->numCoverageFragmentStages(); } + int numColorFragmentProcessors() const { return fColorFragmentProcessors.count(); } + int numCoverageFragmentProcessors() const { return fCoverageFragmentProcessors.count(); } + int numFragmentProcessors() const { return this->numColorFragmentProcessors() + + this->numCoverageFragmentProcessors(); } - const GrFragmentStage& getColorFragmentStage(int idx) const { return fColorStages[idx]; } - const GrFragmentStage& getCoverageFragmentStage(int idx) const { return fCoverageStages[idx]; } + const GrFragmentProcessor* getColorFragmentProcessor(int idx) const { + return fColorFragmentProcessors[idx]; + } + const GrFragmentProcessor* getCoverageFragmentProcessor(int idx) const { + return fCoverageFragmentProcessors[idx]; + } - const GrFragmentProcessor* addColorProcessor(const GrFragmentProcessor* effect) { - SkASSERT(effect); - SkNEW_APPEND_TO_TARRAY(&fColorStages, GrFragmentStage, (effect)); - return effect; + const GrFragmentProcessor* addColorFragmentProcessor(const GrFragmentProcessor* processor) { + SkASSERT(processor); + fColorFragmentProcessors.push_back(SkRef(processor)); + return processor; } - const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* effect) { - SkASSERT(effect); - SkNEW_APPEND_TO_TARRAY(&fCoverageStages, GrFragmentStage, (effect)); - return effect; + const GrFragmentProcessor* addCoverageFragmentProcessor(const GrFragmentProcessor* processor) { + SkASSERT(processor); + fCoverageFragmentProcessors.push_back(SkRef(processor)); + return processor; } /** * Creates a GrSimpleTextureEffect that uses local coords as texture coordinates. */ void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { - this->addColorProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, - matrix))->unref(); + this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, + matrix))->unref(); } void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix) { - this->addCoverageProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, - matrix))->unref(); + this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, + matrix))->unref(); } void addColorTextureProcessor(GrTexture* texture, const SkMatrix& matrix, const GrTextureParams& params) { - this->addColorProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, matrix, - params))->unref(); + this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, + matrix, + params))->unref(); } void addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& matrix, const GrTextureParams& params) { - this->addCoverageProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, matrix, - params))->unref(); + this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(fProcDataManager, texture, + matrix, params))->unref(); } /** @@ -139,9 +138,9 @@ public: return fPipelineBuilder->getProcessorDataManager(); } - const GrFragmentProcessor* addCoverageProcessor(const GrFragmentProcessor* processor) { + const GrFragmentProcessor* addCoverageFragmentProcessor(const GrFragmentProcessor* processor) { SkASSERT(this->isSet()); - return fPipelineBuilder->addCoverageProcessor(processor); + return fPipelineBuilder->addCoverageFragmentProcessor(processor); } private: @@ -385,8 +384,6 @@ public: /////////////////////////////////////////////////////////////////////////// - GrPipelineBuilder& operator=(const GrPipelineBuilder& that); - // TODO delete when we have Batch const GrProcOptInfo& colorProcInfo(const GrPrimitiveProcessor* pp) const { this->calcColorInvariantOutput(pp); @@ -439,7 +436,7 @@ private: // This is used to assert that this condition holds. SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) - typedef SkSTArray<4, GrFragmentStage> FragmentStageArray; + typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArray; SkAutoTUnref<GrProcessorDataManager> fProcDataManager; SkAutoTUnref<GrRenderTarget> fRenderTarget; @@ -447,8 +444,8 @@ private: GrStencilSettings fStencilSettings; DrawFace fDrawFace; mutable SkAutoTUnref<const GrXPFactory> fXPFactory; - FragmentStageArray fColorStages; - FragmentStageArray fCoverageStages; + FragmentProcessorArray fColorFragmentProcessors; + FragmentProcessorArray fCoverageFragmentProcessors; GrClip fClip; mutable GrProcOptInfo fColorProcInfo; |