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

Unified Diff: src/gpu/GrShape.h

Issue 1951613002: Expand GrStyle's interface. (Closed) Base URL: https://chromium.googlesource.com/skia.git@style
Patch Set: Don't use temp for stroke in GrShape::GrShape() 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 | « no previous file | src/gpu/GrShape.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrShape.h
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h
index 0e863e2c6e9167368f98523ab8a11e25dc917c3a..efc28cf73719718289e670a6a279ebc23555ac61 100644
--- a/src/gpu/GrShape.h
+++ b/src/gpu/GrShape.h
@@ -106,19 +106,7 @@ public:
const GrStyle& style() const { return fStyle; }
- /**
- * Returns a GrShape where the shape's geometry fully reflects the original shape's GrStyle.
- * The GrStyle of the returned shape will either be fill or hairline.
- */
- GrShape applyFullStyle() { return GrShape(*this, false); }
-
- /**
- * Similar to above but applies only the path effect. Path effects take the original geometry
- * and fill/stroking information and compute a new geometry and residual fill/stroking
- * information to be applied. The path effect's output geometry and stroking will be captured
- * in the returned GrShape.
- */
- GrShape applyPathEffect() { return GrShape(*this, true); }
+ GrShape applyStyle(GrStyle::Apply apply) { return GrShape(*this, apply); }
bool asRRect(SkRRect* rrect) const {
if (Type::kRRect != fType) {
@@ -165,29 +153,15 @@ private:
kPath,
};
- /**
- * Computes the key length for a GrStyle. The return will be negative if it cannot be turned
- * into a key.
- */
- static int StyleKeySize(const GrStyle& , bool stopAfterPE);
-
- /**
- * Writes a unique key for the style into the provided buffer. This function assumes the buffer
- * has room for at least StyleKeySize() values. It assumes that StyleKeySize() returns a
- * positive value for the style and stopAfterPE 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.
- */
- static void StyleKey(uint32_t*, const GrStyle&, bool stopAfterPE);
/** Constructor used by Apply* functions */
- GrShape(const GrShape& parentShape, bool stopAfterPE);
+ GrShape(const GrShape& parentShape, GrStyle::Apply);
/**
* Determines the key we should inherit from the input shape's geometry and style when
* we are applying the style to create a new shape.
*/
- void setInheritedKey(const GrShape& parentShape, bool stopAfterPE);
+ void setInheritedKey(const GrShape& parentShape, GrStyle::Apply);
void attemptToReduceFromPath() {
SkASSERT(Type::kPath == fType);
« no previous file with comments | « no previous file | src/gpu/GrShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698