Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: src/gpu/GrPipelineBuilder.h

Issue 1307223004: Remove GrStagedProcessor, remove the word Stage as it applies to FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix misresolve Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipelineBuilder.h
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index 1c6eb5f0220a013aa017ffe459d8b63c60571d10..47b996ad3d0fd3229d5a7086f134391cf09a93a2 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;
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698