Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: experimental/svg/model/SkSVGAttribute.cpp

Issue 2234153002: [SVGDom] Add more presentation attributes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/svg/model/SkSVGAttribute.h ('k') | experimental/svg/model/SkSVGAttributeParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « experimental/svg/model/SkSVGAttribute.h ('k') | experimental/svg/model/SkSVGAttributeParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698