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

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: memory leaks fixed 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
« no previous file with comments | « src/gpu/gl/GrGLProcessor.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgram.h
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index fc441e5d76f9fe3e123fc5dad53ae078e4ffc9db..e8aef35f1decd9e26885dde35d303ada4d564b30 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*);
@@ -167,13 +164,12 @@ protected:
const BuiltinUniformHandles&,
GrGLuint programID,
const UniformInfoArray&,
- GrGLInstalledProcessors* geometryProcessor,
- GrGLInstalledProcessors* colorProcessors,
- GrGLInstalledProcessors* coverageProcessors);
+ GrGLInstalledGeoProc* geometryProcessor,
+ GrGLInstalledFragProcs* fragmentProcessors);
// Sets the texture units for samplers.
void initSamplerUniforms();
- void initSamplers(GrGLInstalledProcessors* processors, int* texUnitIdx);
+ void initSamplers(GrGLInstalledProc*, int* texUnitIdx);
// Helper for setData(). Makes GL calls to specify the initial color when there is not
// per-vertex colors.
@@ -184,23 +180,9 @@ 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) {
- 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();
- installedProcessors->fGLProcessors[e]->setData(fProgramDataManager, effect);
- this->setTransformData(*effectStages[e], e, installedProcessors);
- this->bindTextures(installedProcessors, effect, e);
- }
- }
- virtual void setTransformData(const GrProcessorStage& effectStage,
- int effectIdx,
- GrGLInstalledProcessors* pe);
- void bindTextures(const GrGLInstalledProcessors*, const GrProcessor&, int effectIdx);
+ void setFragmentData(const GrOptDrawState&);
+ virtual void setTransformData(const GrFragmentStage& effectStage, GrGLInstalledFragProc* pe);
+ void bindTextures(const GrGLInstalledProc*, const GrProcessor&);
/*
* Legacy NVPR needs a hook here to flush path tex gen settings.
@@ -221,9 +203,8 @@ protected:
GrGLuint fProgramID;
// the installed effects
- SkAutoTUnref<GrGLInstalledProcessors> fGeometryProcessor;
- SkAutoTUnref<GrGLInstalledProcessors> fColorEffects;
- SkAutoTUnref<GrGLInstalledProcessors> fCoverageEffects;
+ SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor;
+ SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors;
GrGLProgramDesc fDesc;
GrGpuGL* fGpu;
@@ -248,8 +229,7 @@ protected:
const BuiltinUniformHandles&,
GrGLuint programID,
const UniformInfoArray&,
- GrGLInstalledProcessors* colorProcessors,
- GrGLInstalledProcessors* coverageProcessors);
+ GrGLInstalledFragProcs* fragmentProcessors);
virtual void onSetMatrixAndRenderTargetHeight(GrGpu::DrawType, const GrOptDrawState&);
typedef GrGLProgram INHERITED;
@@ -267,13 +247,10 @@ private:
const BuiltinUniformHandles&,
GrGLuint programID,
const UniformInfoArray&,
- GrGLInstalledProcessors* colorProcessors,
- GrGLInstalledProcessors* coverageProcessors,
+ GrGLInstalledFragProcs* fragmentProcessors,
const SeparableVaryingInfoArray& separableVaryings);
virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
- virtual void setTransformData(const GrProcessorStage&,
- int effectIdx,
- GrGLInstalledProcessors*) SK_OVERRIDE;
+ virtual void setTransformData(const GrFragmentStage&, GrGLInstalledFragProc*) SK_OVERRIDE;
struct Varying {
GrGLint fLocation;
@@ -298,13 +275,10 @@ private:
const BuiltinUniformHandles&,
GrGLuint programID,
const UniformInfoArray&,
- GrGLInstalledProcessors* colorProcessors,
- GrGLInstalledProcessors* coverageProcessors,
+ GrGLInstalledFragProcs* fragmentProcessors,
int texCoordSetCnt);
virtual void didSetData(GrGpu::DrawType) SK_OVERRIDE;
- virtual void setTransformData(const GrProcessorStage&,
- int effectIdx,
- GrGLInstalledProcessors*) SK_OVERRIDE;
+ virtual void setTransformData(const GrFragmentStage&, GrGLInstalledFragProc*) SK_OVERRIDE;
int fTexCoordSetCnt;
« no previous file with comments | « src/gpu/gl/GrGLProcessor.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698