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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.h

Issue 678953002: Default geometry processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dm bug 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/builders/GrGLProgramBuilder.h
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 9d8e7e0ac9657ee6844d7b43a85c925be0305143..39a72a885def26e8d1c4eb4f7d47c7709240fd41 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -231,8 +231,8 @@ protected:
static GrGLProgramBuilder* CreateProgramBuilder(const GrGLProgramDesc&,
const GrOptDrawState&,
GrGpu::DrawType,
- bool hasGeometryProcessor,
GrGpuGL*);
+ virtual GrGLProgram* create();
GrGLProgramBuilder(GrGpuGL*, const GrOptDrawState&, const GrGLProgramDesc&);
@@ -245,9 +245,7 @@ protected:
// generating stage code.
void nameVariable(SkString* out, char prefix, const char* name);
void setupUniformColorAndCoverageIfNeeded(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage);
- void emitAndInstallProcs(const GrOptDrawState& optState,
- GrGLSLExpr4* inputColor,
- GrGLSLExpr4* inputCoverage);
+ void emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage);
void emitAndInstallFragProcs(int procOffset, int numProcs, GrGLSLExpr4* inOut);
template <class Proc>
void emitAndInstallProc(const Proc&,
@@ -318,6 +316,22 @@ protected:
void enterStage() { fOutOfStage = false; }
int stageIndex() const { return fStageIndex; }
+ struct TransformVarying {
+ TransformVarying(const GrGLVarying& v, const char* uniName, const char* sourceCoords)
+ : fV(v), fUniName(uniName), fSourceCoords(sourceCoords) {}
+ GrGLVarying fV;
+ SkString fUniName;
+ SkString fSourceCoords;
+ };
+
+ void addCoordVarying(const char* name, GrGLVarying* v, const char* uniName,
+ const char* sourceCoords) {
+ this->addVarying(name, v);
+ fCoordVaryings.push_back(TransformVarying(*v, uniName, sourceCoords));
+ }
+
+ const char* rtAdjustment() const { return "rtAdjustment"; }
+
// number of each input/output type in a single allocation block, used by many builders
static const int kVarsPerBlock;
@@ -335,6 +349,7 @@ protected:
const GrGLProgramDesc& fDesc;
GrGpuGL* fGpu;
UniformInfoArray fUniforms;
+ SkSTArray<16, TransformVarying, true> fCoordVaryings;
friend class GrGLShaderBuilder;
friend class GrGLVertexBuilder;

Powered by Google App Engine
This is Rietveld 408576698