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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.h

Issue 1257193002: Cleanup GrDefaultGeoProcFactory localCoords (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: further tweaks Created 5 years, 5 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 | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | src/gpu/GrDefaultGeoProcFactory.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultGeoProcFactory.h
diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h
index 86c59c40e1b0d64c7278956f8e7e1e0061c4cbfc..cdea97bde9fe044044d6ed6bff1cceb5af09897f 100644
--- a/src/gpu/GrDefaultGeoProcFactory.h
+++ b/src/gpu/GrDefaultGeoProcFactory.h
@@ -111,17 +111,30 @@ public:
struct LocalCoords {
enum Type {
- kNone_Type,
+ kUnused_Type,
kUsePosition_Type,
kHasExplicit_Type,
};
+ LocalCoords(Type type) : fType(type), fMatrix(NULL) {}
+ LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(matrix) {
+ SkASSERT(kUnused_Type != type);
+ }
+ bool hasLocalMatrix() const { return NULL != fMatrix; }
+
+ Type fType;
+ const SkMatrix* fMatrix;
};
static const GrGeometryProcessor* Create(const Color&,
const Coverage&,
- LocalCoords::Type,
- const SkMatrix& viewMatrix = SkMatrix::I(),
- const SkMatrix& localMatrix = SkMatrix::I());
+ const LocalCoords&,
+ const SkMatrix& viewMatrix = SkMatrix::I());
+
+ // can fail if the viewmatrix is noninvertible
bsalomon 2015/07/28 14:39:08 I think this needs a little bit of explanation. "U
+ static const GrGeometryProcessor* CreateForDeviceSpace(const Color&,
+ const Coverage&,
+ const LocalCoords&,
+ const SkMatrix& viewMatrix);
/*
* The following functions are used to create default GPs. If you just need to create
« no previous file with comments | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | src/gpu/GrDefaultGeoProcFactory.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698