OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkDOM.h" | 9 #include "SkDOM.h" |
10 #include "SkParsePath.h" | 10 #include "SkParsePath.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 struct AttrParseInfo { | 157 struct AttrParseInfo { |
158 SkSVGAttribute fAttr; | 158 SkSVGAttribute fAttr; |
159 bool (*fSetter)(const sk_sp<SkSVGNode>& node, SkSVGAttribute attr, const cha
r* stringValue); | 159 bool (*fSetter)(const sk_sp<SkSVGNode>& node, SkSVGAttribute attr, const cha
r* stringValue); |
160 }; | 160 }; |
161 | 161 |
162 SortedDictionaryEntry<AttrParseInfo> gAttributeParseInfo[] = { | 162 SortedDictionaryEntry<AttrParseInfo> gAttributeParseInfo[] = { |
163 { "d" , { SkSVGAttribute::kD , SetPathDataAttribute }}, | 163 { "d" , { SkSVGAttribute::kD , SetPathDataAttribute }}, |
164 { "fill" , { SkSVGAttribute::kFill , SetPaintAttribute }}, | 164 { "fill" , { SkSVGAttribute::kFill , SetPaintAttribute }}, |
165 { "height" , { SkSVGAttribute::kHeight , SetLengthAttribute }}, | 165 { "height" , { SkSVGAttribute::kHeight , SetLengthAttribute }}, |
| 166 { "rx" , { SkSVGAttribute::kRx , SetLengthAttribute }}, |
| 167 { "ry" , { SkSVGAttribute::kRy , SetLengthAttribute }}, |
166 { "stroke" , { SkSVGAttribute::kStroke , SetPaintAttribute }}, | 168 { "stroke" , { SkSVGAttribute::kStroke , SetPaintAttribute }}, |
167 { "style" , { SkSVGAttribute::kUnknown , SetStyleAttributes }}, | 169 { "style" , { SkSVGAttribute::kUnknown , SetStyleAttributes }}, |
168 { "transform", { SkSVGAttribute::kTransform, SetTransformAttribute }}, | 170 { "transform", { SkSVGAttribute::kTransform, SetTransformAttribute }}, |
169 { "viewBox" , { SkSVGAttribute::kViewBox , SetViewBoxAttribute }}, | 171 { "viewBox" , { SkSVGAttribute::kViewBox , SetViewBoxAttribute }}, |
170 { "width" , { SkSVGAttribute::kWidth , SetLengthAttribute }}, | 172 { "width" , { SkSVGAttribute::kWidth , SetLengthAttribute }}, |
171 { "x" , { SkSVGAttribute::kX , SetLengthAttribute }}, | 173 { "x" , { SkSVGAttribute::kX , SetLengthAttribute }}, |
172 { "y" , { SkSVGAttribute::kY , SetLengthAttribute }}, | 174 { "y" , { SkSVGAttribute::kY , SetLengthAttribute }}, |
173 }; | 175 }; |
174 | 176 |
175 SortedDictionaryEntry<sk_sp<SkSVGNode>(*)()> gTagFactories[] = { | 177 SortedDictionaryEntry<sk_sp<SkSVGNode>(*)()> gTagFactories[] = { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 SkSVGLengthContext(fContainerSize), | 281 SkSVGLengthContext(fContainerSize), |
280 SkSVGPresentationContext()); | 282 SkSVGPresentationContext()); |
281 fRoot->render(ctx); | 283 fRoot->render(ctx); |
282 } | 284 } |
283 } | 285 } |
284 | 286 |
285 void SkSVGDOM::setContainerSize(const SkSize& containerSize) { | 287 void SkSVGDOM::setContainerSize(const SkSize& containerSize) { |
286 // TODO: inval | 288 // TODO: inval |
287 fContainerSize = containerSize; | 289 fContainerSize = containerSize; |
288 } | 290 } |
OLD | NEW |