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

Unified Diff: src/gpu/gl/GrGLProgram.h

Issue 637003003: Opt state takes a GP instead of a GeometryStage (Closed) Base URL: https://skia.googlesource.com/skia.git@builder_cleanup
Patch Set: Created 6 years, 2 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
Index: src/gpu/gl/GrGLProgram.h
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index fc441e5d76f9fe3e123fc5dad53ae078e4ffc9db..9bd1fbb9f2aeb0af768849c87d8a04e22d7ce157 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -152,9 +152,6 @@ public:
*/
void setData(const GrOptDrawState&,
GrGpu::DrawType,
- const GrGeometryStage* geometryProcessor,
- const GrFragmentStage* colorStages[],
- const GrFragmentStage* coverageStages[],
const GrDeviceCoordTexture* dstCopy, // can be NULL
SharedGLState*);
@@ -184,23 +181,24 @@ protected:
void setCoverage(const GrOptDrawState&, GrColor coverage, SharedGLState*);
// A templated helper to loop over effects, set the transforms(via subclass) and bind textures
- template <class ProcessorStage>
- void setData(const ProcessorStage* effectStages[],
- GrGLInstalledProcessors* installedProcessors) {
+ template <class StageMapper>
+ void setData(const GrOptDrawState& optState, GrGLInstalledProcessors* installedProcessors) {
bsalomon 2014/10/09 18:35:45 Is it useful that this operates on an array? It's
egdaniel 2014/10/09 18:52:04 I can definitely make GrODS have a single FP array
int numEffects = installedProcessors->fGLProcessors.count();
SkASSERT(numEffects == installedProcessors->fTransforms.count());
SkASSERT(numEffects == installedProcessors->fSamplers.count());
for (int e = 0; e < numEffects; ++e) {
- const GrProcessor& effect = *effectStages[e]->getProcessor();
+ const GrFragmentStage& stage = StageMapper::GetStage(optState, e);
+ SkASSERT(stage.getProcessor());
+ const GrProcessor& effect = *stage.getProcessor();
installedProcessors->fGLProcessors[e]->setData(fProgramDataManager, effect);
- this->setTransformData(*effectStages[e], e, installedProcessors);
- this->bindTextures(installedProcessors, effect, e);
+ this->setTransformData(stage, e, installedProcessors);
+ this->bindTextures(*installedProcessors, effect, e);
}
}
- virtual void setTransformData(const GrProcessorStage& effectStage,
+ virtual void setTransformData(const GrFragmentStage& effectStage,
int effectIdx,
GrGLInstalledProcessors* pe);
- void bindTextures(const GrGLInstalledProcessors*, const GrProcessor&, int effectIdx);
+ void bindTextures(const GrGLInstalledProcessors&, const GrProcessor&, int effectIdx);
/*
* Legacy NVPR needs a hook here to flush path tex gen settings.
@@ -271,7 +269,7 @@ private:
GrGLInstalledProcessors* coverageProcessors,
const SeparableVaryingInfoArray& separableVaryings);
virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
- virtual void setTransformData(const GrProcessorStage&,
+ virtual void setTransformData(const GrFragmentStage&,
int effectIdx,
GrGLInstalledProcessors*) SK_OVERRIDE;
@@ -302,7 +300,7 @@ private:
GrGLInstalledProcessors* coverageProcessors,
int texCoordSetCnt);
virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
- virtual void setTransformData(const GrProcessorStage&,
+ virtual void setTransformData(const GrFragmentStage&,
int effectIdx,
GrGLInstalledProcessors*) SK_OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698