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

Unified Diff: src/gpu/GrGeometryProcessor.h

Issue 1132323003: Revert of Preliminary attempt to remove batch tracker (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup5
Patch Set: Created 5 years, 7 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGeometryProcessor.h
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index 9c55359af59c39be63260e3dc937995d8d86c6d6..eee286b20deeb935226950681404880094af6418 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -26,9 +26,6 @@
bool willUseGeoShader() const { return fWillUseGeoShader; }
- // TODO delete when paths are in batch
- void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const override {}
-
// TODO delete this when paths are in batch
bool canMakeEqual(const GrBatchTracker& mine,
const GrPrimitiveProcessor& that,
@@ -46,6 +43,35 @@
}
protected:
+ /*
+ * An optional simple helper function to determine by what means the GrGeometryProcessor should
+ * use to provide color. If we are given an override color(ie the given overridecolor is NOT
+ * GrColor_ILLEGAL) then we must always emit that color(currently overrides are only supported
+ * via uniform, but with deferred Geometry we could use attributes). Otherwise, if our color is
+ * ignored then we should not emit a color. Lastly, if we don't have vertex colors then we must
+ * emit a color via uniform
+ * TODO this function changes quite a bit with deferred geometry. There the GrGeometryProcessor
+ * can upload a new color via attribute if needed.
+ */
+ static GrGPInput GetColorInputType(GrColor* color, GrColor primitiveColor,
+ const GrPipelineInfo& init,
+ bool hasVertexColor) {
+ if (init.fColorIgnored) {
+ *color = GrColor_ILLEGAL;
+ return kIgnored_GrGPInput;
+ } else if (GrColor_ILLEGAL != init.fOverrideColor) {
+ *color = init.fOverrideColor;
+ return kUniform_GrGPInput;
+ }
+
+ *color = primitiveColor;
+ if (hasVertexColor) {
+ return kAttribute_GrGPInput;
+ } else {
+ return kUniform_GrGPInput;
+ }
+ }
+
/**
* Subclasses call this from their constructor to register vertex attributes. Attributes
* will be padded to the nearest 4 bytes for performance reasons.
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698