Add fillType support to VectorDrawable
Default as non-zero, which is the same as SVG.
b/27533958
Change-Id: Id20e6d3493bb4d2b4b65d7f6cdb13586631c40e4
diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h
index 36a8aeb..4d2fed0 100644
--- a/libs/hwui/VectorDrawable.h
+++ b/libs/hwui/VectorDrawable.h
@@ -96,7 +96,7 @@
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 @@
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 @@
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 @@
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 @@
StrokeLineCap,
StrokeLineJoin,
StrokeMiterLimit,
+ FillType,
Count,
};
// Applies trimming to the specified path.
@@ -233,7 +235,7 @@
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;
};