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

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

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: last warning Created 6 years, 3 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/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.h
diff --git a/src/gpu/gl/GrGLProgramDesc.h b/src/gpu/gl/GrGLProgramDesc.h
index aefcb508e2cebf09b85d700af5374fcb9d1564cb..b1f54b7e29280e3ad201939541725be551cc281c 100644
--- a/src/gpu/gl/GrGLProgramDesc.h
+++ b/src/gpu/gl/GrGLProgramDesc.h
@@ -48,6 +48,7 @@ public:
const GrGpuGL* gpu,
const GrRenderTarget* dummyDstRenderTarget,
const GrTexture* dummyDstCopyTexture,
+ const GrEffectStage* geometryProcessor,
const GrEffectStage* stages[],
int numColorStages,
int numCoverageStages,
@@ -67,10 +68,15 @@ public:
GrBlendCoeff dstCoeff,
const GrGpuGL* gpu,
const GrDeviceCoordTexture* dstCopy,
+ const GrEffectStage** outGeometryProcessor,
SkTArray<const GrEffectStage*, true>* outColorStages,
SkTArray<const GrEffectStage*, true>* outCoverageStages,
GrGLProgramDesc* outDesc);
+ bool hasGeometryProcessor() const {
+ return SkToBool(this->getHeader().fHasGeometryProcessor);
+ }
+
int numColorEffects() const {
return this->getHeader().fColorEffectCnt;
}
@@ -161,6 +167,7 @@ private:
int8_t fColorAttributeIndex;
int8_t fCoverageAttributeIndex;
+ SkBool8 fHasGeometryProcessor;
int8_t fColorEffectCnt;
int8_t fCoverageEffectCnt;
};
@@ -213,13 +220,24 @@ private:
class EffectKeyProvider {
public:
enum EffectType {
+ kGeometryProcessor_EffectType,
kColor_EffectType,
kCoverage_EffectType,
};
EffectKeyProvider(const GrGLProgramDesc* desc, EffectType type) : fDesc(desc) {
- // Coverage effect key offsets begin immediately after those of the color effects.
- fBaseIndex = kColor_EffectType == type ? 0 : desc->numColorEffects();
+ switch (type) {
+ case kGeometryProcessor_EffectType:
+ // there can be only one
+ fBaseIndex = 0;
+ break;
+ case kColor_EffectType:
+ fBaseIndex = desc->hasGeometryProcessor() ? 1 : 0;
+ break;
+ case kCoverage_EffectType:
+ fBaseIndex = desc->numColorEffects() + (desc->hasGeometryProcessor() ? 1 : 0);
+ break;
+ }
}
GrEffectKey get(int index) const {
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698