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

Unified Diff: src/gpu/GrPathProcessor.h

Issue 1131513005: remove localmatrix from GrGeometryProcessor base class (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup4
Patch Set: tweaks 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/GrOvalRenderer.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
index 39b0b7afef3b55ded9c3d0c3d0e9ba45b5b711fd..e34d0cefbe5d2302ceb707dd32d6883902d4b561 100644
--- a/src/gpu/GrPathProcessor.h
+++ b/src/gpu/GrPathProcessor.h
@@ -37,8 +37,10 @@ public:
const char* name() const override { return "PathProcessor"; }
- const SkMatrix& viewMatrix() const { return fViewMatrix; }
GrColor color() const { return fColor; }
+ const SkMatrix& viewMatrix() const { return fViewMatrix; }
+ const SkMatrix& localMatrix() const { return fLocalMatrix; }
+
void getInvariantOutputColor(GrInitInvariantOutput* out) const override;
void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override;
@@ -54,10 +56,44 @@ public:
private:
GrPathProcessor(GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);
+
+ /*
+ * CanCombineOutput will return true if two draws are 'batchable' from a color perspective.
+ * TODO is this really necessary?
+ */
+ static bool CanCombineOutput(GrGPInput left, GrColor lColor, GrGPInput right, GrColor rColor) {
+ if (left != right) {
+ return false;
+ }
+
+ if (kUniform_GrGPInput == left && lColor != rColor) {
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool CanCombineLocalMatrices(const GrPrimitiveProcessor& l,
+ bool leftUsesLocalCoords,
+ const GrPrimitiveProcessor& r,
+ bool rightUsesLocalCoords) {
+ if (leftUsesLocalCoords != rightUsesLocalCoords) {
+ return false;
+ }
+
+ const GrPathProcessor& left = l.cast<GrPathProcessor>();
+ const GrPathProcessor& right = r.cast<GrPathProcessor>();
+ if (leftUsesLocalCoords && !left.localMatrix().cheapEqualTo(right.localMatrix())) {
+ return false;
+ }
+ return true;
+ }
+
bool hasExplicitLocalCoords() const override { return false; }
- const SkMatrix fViewMatrix;
GrColor fColor;
+ const SkMatrix fViewMatrix;
+ const SkMatrix fLocalMatrix;
typedef GrPrimitiveProcessor INHERITED;
};
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrPathProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698