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

Unified Diff: src/gpu/GrStyle.h

Issue 1949193002: Make cap only affect the keys of GrShapes that are possibly-open (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: due Created 4 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/GrShape.cpp ('k') | src/gpu/GrStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStyle.h
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
index d63df3229085773a056f79abaef18fc446c8411f..c65b22b81a6d74f0ce67aa9d267f08962fedbaa0 100644
--- a/src/gpu/GrStyle.h
+++ b/src/gpu/GrStyle.h
@@ -49,21 +49,30 @@ public:
};
/**
+ * Optional flags for computing keys that may remove unnecessary variation in the key due to
+ * style settings that don't affect particular classes of geometry.
+ */
+ enum KeyFlags {
+ // The shape being styled has no open contours.
+ kClosed_KeyFlag = 0x1
+ };
+
+ /**
* Computes the key length for a GrStyle. The return will be negative if it cannot be turned
* into a key. This occurs when there is a path effect that is not a dash. The key can
* either reflect just the path effect (if one) or the path effect and the strokerec. Note
* that a simple fill has a zero sized key.
*/
- static int KeySize(const GrStyle& , Apply);
+ static int KeySize(const GrStyle& , Apply, uint32_t flags = 0);
/**
* Writes a unique key for the style into the provided buffer. This function assumes the buffer
* has room for at least KeySize() values. It assumes that KeySize() returns a non-negative
- * value for the style and Apply param. This is written so that the key for just dash
- * application followed by the key for the remaining SkStrokeRec is the same as the key for
- * applying dashing and SkStrokeRec all at once.
+ * value for the combination of GrStyle, Apply and flags params. This is written so that the key
+ * for just dash application followed by the key for the remaining SkStrokeRec is the same as
+ * the key for applying dashing and SkStrokeRec all at once.
*/
- static void WriteKey(uint32_t*, const GrStyle&, Apply);
+ static void WriteKey(uint32_t*, const GrStyle&, Apply, uint32_t flags = 0);
GrStyle() : GrStyle(SkStrokeRec::kFill_InitStyle) {}
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | src/gpu/GrStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698