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

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

Issue 2249033003: [SVGDom] Add <circle>, <ellipse> support (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/SkSVGCircle.cpp ('k') | experimental/svg/model/SkSVGEllipse.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGDOM.cpp
diff --git a/experimental/svg/model/SkSVGDOM.cpp b/experimental/svg/model/SkSVGDOM.cpp
index 8e2667ad200ea15f8eae6cd8740d5275c4e343d3..ef1bb0d0ae0f07c305ecba06b7a31145e58f1528 100644
--- a/experimental/svg/model/SkSVGDOM.cpp
+++ b/experimental/svg/model/SkSVGDOM.cpp
@@ -10,7 +10,9 @@
#include "SkParsePath.h"
#include "SkString.h"
#include "SkSVGAttributeParser.h"
+#include "SkSVGCircle.h"
#include "SkSVGDOM.h"
+#include "SkSVGEllipse.h"
#include "SkSVGG.h"
#include "SkSVGNode.h"
#include "SkSVGPath.h"
@@ -213,12 +215,15 @@ struct AttrParseInfo {
};
SortedDictionaryEntry<AttrParseInfo> gAttributeParseInfo[] = {
+ { "cx" , { SkSVGAttribute::kCx , SetLengthAttribute }},
+ { "cy" , { SkSVGAttribute::kCy , SetLengthAttribute }},
{ "d" , { SkSVGAttribute::kD , SetPathDataAttribute }},
{ "fill" , { SkSVGAttribute::kFill , SetPaintAttribute }},
{ "fill-opacity" , { SkSVGAttribute::kFillOpacity , SetNumberAttribute }},
{ "height" , { SkSVGAttribute::kHeight , SetLengthAttribute }},
{ "opacity" , { SkSVGAttribute::kOpacity , SetNumberAttribute }},
{ "points" , { SkSVGAttribute::kPoints , SetPointsAttribute }},
+ { "r" , { SkSVGAttribute::kR , SetLengthAttribute }},
{ "rx" , { SkSVGAttribute::kRx , SetLengthAttribute }},
{ "ry" , { SkSVGAttribute::kRy , SetLengthAttribute }},
{ "stroke" , { SkSVGAttribute::kStroke , SetPaintAttribute }},
@@ -235,6 +240,8 @@ SortedDictionaryEntry<AttrParseInfo> gAttributeParseInfo[] = {
};
SortedDictionaryEntry<sk_sp<SkSVGNode>(*)()> gTagFactories[] = {
+ { "circle" , []() -> sk_sp<SkSVGNode> { return SkSVGCircle::Make(); }},
+ { "ellipse" , []() -> sk_sp<SkSVGNode> { return SkSVGEllipse::Make(); }},
{ "g" , []() -> sk_sp<SkSVGNode> { return SkSVGG::Make(); }},
{ "path" , []() -> sk_sp<SkSVGNode> { return SkSVGPath::Make(); }},
{ "polygon" , []() -> sk_sp<SkSVGNode> { return SkSVGPoly::MakePolygon(); }},
« no previous file with comments | « experimental/svg/model/SkSVGCircle.cpp ('k') | experimental/svg/model/SkSVGEllipse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698