OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef DMSrcSink_DEFINED | 8 #ifndef DMSrcSink_DEFINED |
9 #define DMSrcSink_DEFINED | 9 #define DMSrcSink_DEFINED |
10 | 10 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 explicit SKPSrc(Path path); | 242 explicit SKPSrc(Path path); |
243 | 243 |
244 Error draw(SkCanvas*) const override; | 244 Error draw(SkCanvas*) const override; |
245 SkISize size() const override; | 245 SkISize size() const override; |
246 Name name() const override; | 246 Name name() const override; |
247 private: | 247 private: |
248 Path fPath; | 248 Path fPath; |
249 }; | 249 }; |
250 | 250 |
251 #if defined(SK_XML) | 251 #if defined(SK_XML) |
| 252 } // namespace DM |
| 253 |
| 254 class SkSVGDOM; |
| 255 |
| 256 namespace DM { |
| 257 |
252 class SVGSrc : public Src { | 258 class SVGSrc : public Src { |
253 public: | 259 public: |
254 explicit SVGSrc(Path path); | 260 explicit SVGSrc(Path path); |
255 | 261 |
256 Error draw(SkCanvas*) const override; | 262 Error draw(SkCanvas*) const override; |
257 SkISize size() const override; | 263 SkISize size() const override; |
258 Name name() const override; | 264 Name name() const override; |
259 bool veto(SinkFlags) const override; | 265 bool veto(SinkFlags) const override; |
260 | 266 |
261 private: | 267 private: |
262 Path fPath; | 268 Error ensureDom() const; |
| 269 |
| 270 Path fPath; |
| 271 mutable sk_sp<SkSVGDOM> fDom; |
| 272 mutable SkScalar fScale; |
263 | 273 |
264 typedef Src INHERITED; | 274 typedef Src INHERITED; |
265 }; | 275 }; |
266 #endif // SK_XML | 276 #endif // SK_XML |
267 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 277 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
268 | 278 |
269 class MSKPSrc : public Src { | 279 class MSKPSrc : public Src { |
270 public: | 280 public: |
271 explicit MSKPSrc(Path path); | 281 explicit MSKPSrc(Path path); |
272 | 282 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 474 |
465 class ViaLite : public Via { | 475 class ViaLite : public Via { |
466 public: | 476 public: |
467 explicit ViaLite(Sink* sink) : Via(sink) {} | 477 explicit ViaLite(Sink* sink) : Via(sink) {} |
468 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; | 478 Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; |
469 }; | 479 }; |
470 | 480 |
471 } // namespace DM | 481 } // namespace DM |
472 | 482 |
473 #endif//DMSrcSink_DEFINED | 483 #endif//DMSrcSink_DEFINED |
OLD | NEW |