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

Unified Diff: src/gpu/GrPathProcessor.h

Issue 920863002: A simple change to move a bunch of stuff out of Gr*Geometry.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clang fix Created 5 years, 10 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/GrGeometryProcessor.cpp ('k') | src/gpu/GrPathProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathProcessor.h
diff --git a/src/gpu/GrPathProcessor.h b/src/gpu/GrPathProcessor.h
new file mode 100644
index 0000000000000000000000000000000000000000..03d3907459f077ee0b3699470f361e3d61cdb289
--- /dev/null
+++ b/src/gpu/GrPathProcessor.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrPathProcessor_DEFINED
+#define GrPathProcessor_DEFINED
+
+#include "GrPrimitiveProcessor.h"
+
+struct PathBatchTracker {
+ GrGPInput fInputColorType;
+ GrGPInput fInputCoverageType;
+ GrColor fColor;
+ bool fUsesLocalCoords;
+};
+
+/*
+ * The path equivalent of the GP. For now this just manages color. In the long term we plan on
+ * extending this class to handle all nvpr uniform / varying / program work.
+ */
+class GrPathProcessor : public GrPrimitiveProcessor {
+public:
+ static GrPathProcessor* Create(GrColor color,
+ const SkMatrix& viewMatrix = SkMatrix::I(),
+ const SkMatrix& localMatrix = SkMatrix::I()) {
+ return SkNEW_ARGS(GrPathProcessor, (color, viewMatrix, localMatrix));
+ }
+
+ void initBatchTracker(GrBatchTracker*, const GrPipelineInfo&) const SK_OVERRIDE;
+
+ bool canMakeEqual(const GrBatchTracker& mine,
+ const GrPrimitiveProcessor& that,
+ const GrBatchTracker& theirs) const SK_OVERRIDE;
+
+ const char* name() const SK_OVERRIDE { return "PathProcessor"; }
+
+ GrColor color() const { return fColor; }
+
+ void getInvariantOutputColor(GrInitInvariantOutput* out) const SK_OVERRIDE;
+ void getInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE;
+
+ bool willUseGeoShader() const SK_OVERRIDE { return false; }
+
+ virtual void getGLProcessorKey(const GrBatchTracker& bt,
+ const GrGLCaps& caps,
+ GrProcessorKeyBuilder* b) const SK_OVERRIDE;
+
+ virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
+ const GrGLCaps& caps) const SK_OVERRIDE;
+
+protected:
+ GrPathProcessor(GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);
+
+private:
+ bool hasExplicitLocalCoords() const SK_OVERRIDE { return false; }
+
+ GrColor fColor;
+
+ typedef GrPrimitiveProcessor INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/GrGeometryProcessor.cpp ('k') | src/gpu/GrPathProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698