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

Unified Diff: src/gpu/batches/GrAADistanceFieldPathRenderer.h

Issue 1460873002: Add stroking support to distance field path renderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Valgrind issue Created 5 years, 1 month 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/GrPathRenderer.h ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAADistanceFieldPathRenderer.h
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.h b/src/gpu/batches/GrAADistanceFieldPathRenderer.h
index 469aeeb981241bce1dd4a34e7440f5ef59d17988..c0e68268dedfe0def5ad98f7daedf3385d95f263 100755
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.h
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.h
@@ -33,13 +33,30 @@ private:
bool onDrawPath(const DrawPathArgs&) override;
struct PathData {
- struct Key {
+ class Key {
+ public:
+ // default ctor needed for new of uninitialized PathData
+ // since fStroke has no default ctor
+ Key()
+ : fGenID(0)
+ , fDimension(0)
+ , fStroke(SkStrokeRec::kFill_InitStyle) {}
+ Key(uint32_t genID, uint32_t dim, const SkStrokeRec& stroke)
+ : fGenID(genID)
+ , fDimension(dim)
+ , fStroke(stroke) {}
+
+ bool operator==(const Key& other) const {
+ return other.fGenID == fGenID && other.fDimension == fDimension &&
+ fStroke.hasEqualEffect(other.fStroke);
+ }
+
+ private:
uint32_t fGenID;
// rendered size for stored path (32x32 max, 64x64 max, 128x128 max)
uint32_t fDimension;
- bool operator==(const Key& other) const {
- return other.fGenID == fGenID && other.fDimension == fDimension;
- }
+ // stroking information
+ SkStrokeRec fStroke;
};
Key fKey;
SkScalar fScale;
« no previous file with comments | « src/gpu/GrPathRenderer.h ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698