skia2/experimental/svg/model/SkSVGAttribute.cpp
Florin Malita e932d4b3a9 [SVGDom] Add fill-rule support
There's a bit of friction with this attribute, because per spec it is
an inherited presentation attribute, but in Skia it is part of the
actual SkPath state.

So we must add some plumbing to SkSVGShape & friends to allow overriding
the fill type at render-time.

R=robertphillips@google.com,stephana@google.com

Change-Id: I9c926d653c6211beb3914bffac50d4349dbdd2c0
Reviewed-on: https://skia-review.googlesource.com/5415
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2016-12-06 16:05:41 +00:00

25 lines
802 B
C++

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSVGAttribute.h"
SkSVGPresentationAttributes SkSVGPresentationAttributes::MakeInitial() {
SkSVGPresentationAttributes result;
result.fFill.set(SkSVGPaint(SkSVGColorType(SK_ColorBLACK)));
result.fFillOpacity.set(SkSVGNumberType(1));
result.fFillRule.set(SkSVGFillRule(SkSVGFillRule::Type::kNonZero));
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));
return result;
}