diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2016-03-15 14:32:16 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2016-03-16 11:03:27 -0700 |
commit | 46591f4a2dbd785bcae2b82bb490e78208605ec8 (patch) | |
tree | 617adae82702b9a1d093f312a07d41ae3ec1977b /libs/hwui/VectorDrawable.h | |
parent | e2578e2d9ea968cf900814cc3d2e62e4cf476f3e (diff) |
Add fillType support to VectorDrawable
Default as non-zero, which is the same as SVG.
b/27533958
Change-Id: Id20e6d3493bb4d2b4b65d7f6cdb13586631c40e4
Diffstat (limited to 'libs/hwui/VectorDrawable.h')
-rw-r--r-- | libs/hwui/VectorDrawable.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h index 36a8aebeaa33..4d2fed096adf 100644 --- a/libs/hwui/VectorDrawable.h +++ b/libs/hwui/VectorDrawable.h @@ -96,7 +96,7 @@ public: protected: virtual const SkPath& getUpdatedPath(); - virtual void drawPath(SkCanvas *outCanvas, const SkPath& renderPath, + virtual void drawPath(SkCanvas *outCanvas, SkPath& renderPath, float strokeScale, const SkMatrix& matrix) = 0; Data mData; SkPath mSkPath; @@ -118,6 +118,7 @@ struct Properties { int32_t strokeLineCap = SkPaint::Cap::kButt_Cap; int32_t strokeLineJoin = SkPaint::Join::kMiter_Join; float strokeMiterLimit = 4; + int fillType = 0; /* non-zero or kWinding_FillType in Skia */ }; FullPath(const FullPath& path); // for cloning @@ -133,7 +134,7 @@ struct Properties { void updateProperties(float strokeWidth, SkColor strokeColor, float strokeAlpha, SkColor fillColor, float fillAlpha, float trimPathStart, float trimPathEnd, float trimPathOffset, - float strokeMiterLimit, int strokeLineCap, int strokeLineJoin); + float strokeMiterLimit, int strokeLineCap, int strokeLineJoin, int fillType); // TODO: Cleanup: Remove the setter and getters below, and their counterparts in java and JNI float getStrokeWidth() { return mProperties.strokeWidth; @@ -197,7 +198,7 @@ struct Properties { protected: const SkPath& getUpdatedPath() override; - void drawPath(SkCanvas* outCanvas, const SkPath& renderPath, + void drawPath(SkCanvas* outCanvas, SkPath& renderPath, float strokeScale, const SkMatrix& matrix) override; private: @@ -213,6 +214,7 @@ private: StrokeLineCap, StrokeLineJoin, StrokeMiterLimit, + FillType, Count, }; // Applies trimming to the specified path. @@ -233,7 +235,7 @@ public: ClipPath(const Data& nodes) : Path(nodes) {} protected: - void drawPath(SkCanvas* outCanvas, const SkPath& renderPath, + void drawPath(SkCanvas* outCanvas, SkPath& renderPath, float strokeScale, const SkMatrix& matrix) override; }; |