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

Unified Diff: src/gpu/GrDrawState.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/GrContext.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 00bec9f7c24f45e9088440bd6cdd1614e1d8764d..a1b07de6d6cdb04331e044ec6444939a8016e10a 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -165,6 +165,20 @@ public:
/// @}
+ /**
+ * The geometry processor is the sole element of the skia pipeline which can use the vertex,
+ * geometry, and tesselation shaders. The GP may also compute a coverage in its fragment shader
+ * but is never put in the color processing pipeline.
+ */
+
+ const GrEffect* setGeometryProcessor(const GrEffect* effect, int attr0 = -1, int attr1 = -1) {
+ SkASSERT(NULL != effect);
+ SkASSERT(!this->hasGeometryProcessor());
+ fGeometryProcessor.reset(new GrEffectStage(effect, attr0, attr1));
+ this->invalidateBlendOptFlags();
+ return effect;
+ }
+
///////////////////////////////////////////////////////////////////////////
/// @name Effect Stages
/// Each stage hosts a GrEffect. The effect produces an output color or coverage in the fragment
@@ -242,6 +256,7 @@ public:
private:
GrDrawState* fDrawState;
+ SkAutoTDelete<GrEffectStage> fGeometryProcessor;
int fColorEffectCnt;
int fCoverageEffectCnt;
};
@@ -364,6 +379,7 @@ public:
GrDrawState* fDrawState;
SkMatrix fViewMatrix;
int fNumColorStages;
+ bool fHasGeometryProcessor;
SkAutoSTArray<8, GrEffectStage::SavedCoordChange> fSavedCoordChanges;
};
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698