skia2/experimental/svg/model/SkSVGAttribute.cpp
fmalita 2d961e086b [SVGDom] Add more presentation attributes.
Implement proper presentation attribute inheritance, and add
support for

* fill-opacity
* stroke-linecap
* stroke-linejoin
* stroke-opacity
* stroke-width

R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234153002

Review-Url: https://codereview.chromium.org/2234153002
2016-08-11 09:16:29 -07:00

24 lines
730 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.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;
}