| Index: experimental/svg/model/SkSVGAttribute.cpp
|
| diff --git a/experimental/svg/model/SkSVGAttribute.cpp b/experimental/svg/model/SkSVGAttribute.cpp
|
| index 2f1cace7738c602bad45f1c60cc431b038524f85..9d6b193e043512ceaa989e4c9c0e9ceb0570d0c6 100644
|
| --- a/experimental/svg/model/SkSVGAttribute.cpp
|
| +++ b/experimental/svg/model/SkSVGAttribute.cpp
|
| @@ -6,29 +6,18 @@
|
| */
|
|
|
| #include "SkSVGAttribute.h"
|
| -#include "SkSVGRenderContext.h"
|
|
|
| -SkSVGPresentationAttributes::SkSVGPresentationAttributes()
|
| - : fFillIsSet(false)
|
| - , fStrokeIsSet(false) { }
|
| -
|
| -void SkSVGPresentationAttributes::setFill(const SkSVGColorType& c) {
|
| - fFill = c;
|
| - fFillIsSet = true;
|
| -}
|
| -
|
| -void SkSVGPresentationAttributes::setStroke(const SkSVGColorType& c) {
|
| - fStroke = c;
|
| - fStrokeIsSet = true;
|
| -}
|
| +SkSVGPresentationAttributes SkSVGPresentationAttributes::MakeInitial() {
|
| + SkSVGPresentationAttributes result;
|
|
|
| + result.fFill.set(SkSVGPaint(SkSVGColorType(SK_ColorBLACK)));
|
| + result.fFillOpacity.set(SkSVGNumberType(1));
|
|
|
| -void SkSVGPresentationAttributes::applyTo(SkSVGRenderContext* ctx) const {
|
| - if (fFillIsSet) {
|
| - ctx->writablePresentationContext()->setFillColor(fFill);
|
| - }
|
| + result.fStroke.set(SkSVGPaint(SkSVGPaint::Type::kNone));
|
| + result.fStrokeLineCap.set(SkSVGLineCap(SkSVGLineCap::Type::kButt));
|
| + result.fStrokeLineJoin.set(SkSVGLineJoin(SkSVGLineJoin::Type::kMiter));
|
| + result.fStrokeOpacity.set(SkSVGNumberType(1));
|
| + result.fStrokeWidth.set(SkSVGLength(1));
|
|
|
| - if (fStrokeIsSet) {
|
| - ctx->writablePresentationContext()->setStrokeColor(fStroke);
|
| - }
|
| + return result;
|
| }
|
|
|