summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorTenghui Zhu <ztenghui@google.com>2016-03-16 21:13:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-16 21:13:24 +0000
commit71e806b2f464b0ac85367fe008b554b44e4c5812 (patch)
treeeb4aefcb68eb454b878fbbaf3f902a50aac52f8c /libs/hwui/VectorDrawable.cpp
parent495defd74f9a47dec33eb27ca25f5e390bd3fb4a (diff)
parent46591f4a2dbd785bcae2b82bb490e78208605ec8 (diff)
Merge "Add fillType support to VectorDrawable" into nyc-dev
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index f7b38e33cae7..d35f76485bd1 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -158,7 +158,8 @@ const SkPath& FullPath::getUpdatedPath() {
void FullPath::updateProperties(float strokeWidth, SkColor strokeColor, float strokeAlpha,
SkColor fillColor, float fillAlpha, float trimPathStart, float trimPathEnd,
- float trimPathOffset, float strokeMiterLimit, int strokeLineCap, int strokeLineJoin) {
+ float trimPathOffset, float strokeMiterLimit, int strokeLineCap, int strokeLineJoin,
+ int fillType) {
mProperties.strokeWidth = strokeWidth;
mProperties.strokeColor = strokeColor;
mProperties.strokeAlpha = strokeAlpha;
@@ -167,6 +168,7 @@ void FullPath::updateProperties(float strokeWidth, SkColor strokeColor, float st
mProperties.strokeMiterLimit = strokeMiterLimit;
mProperties.strokeLineCap = strokeLineCap;
mProperties.strokeLineJoin = strokeLineJoin;
+ mProperties.fillType = fillType;
// If any trim property changes, mark trim dirty and update the trim path
setTrimPathStart(trimPathStart);
@@ -179,7 +181,7 @@ inline SkColor applyAlpha(SkColor color, float alpha) {
return SkColorSetA(color, alphaBytes * alpha);
}
-void FullPath::drawPath(SkCanvas* outCanvas, const SkPath& renderPath, float strokeScale,
+void FullPath::drawPath(SkCanvas* outCanvas, SkPath& renderPath, float strokeScale,
const SkMatrix& matrix){
// Draw path's fill, if fill color or gradient is valid
bool needsFill = false;
@@ -196,6 +198,8 @@ void FullPath::drawPath(SkCanvas* outCanvas, const SkPath& renderPath, float str
if (needsFill) {
mPaint.setStyle(SkPaint::Style::kFill_Style);
mPaint.setAntiAlias(true);
+ SkPath::FillType ft = static_cast<SkPath::FillType>(mProperties.fillType);
+ renderPath.setFillType(ft);
outCanvas->drawPath(renderPath, mPaint);
}
@@ -306,7 +310,7 @@ void FullPath::setPropertyValue(int propertyId, float value) {
}
}
-void ClipPath::drawPath(SkCanvas* outCanvas, const SkPath& renderPath,
+void ClipPath::drawPath(SkCanvas* outCanvas, SkPath& renderPath,
float strokeScale, const SkMatrix& matrix){
outCanvas->clipPath(renderPath, SkRegion::kIntersect_Op);
}