Skia
2D Graphics Library
SkSVGTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkSVGTypes_DEFINED
9 #define SkSVGTypes_DEFINED
10 
11 #include "include/core/SkColor.h"
12 #include "include/core/SkMatrix.h"
13 #include "include/core/SkPath.h"
14 #include "include/core/SkPoint.h"
15 #include "include/core/SkRect.h"
16 #include "include/core/SkRefCnt.h"
17 #include "include/core/SkScalar.h"
18 #include "include/core/SkSpan.h"
19 #include "include/core/SkString.h"
20 #include "include/core/SkTypes.h"
21 
22 #include <optional>
23 #include <vector>
24 
26 using SkSVGIntegerType = int;
31 using SkSVGPointsType = std::vector<SkPoint>;
32 
33 enum class SkSVGPropertyState {
35  kInherit,
36  kValue,
37 };
38 
39 // https://www.w3.org/TR/SVG11/intro.html#TermProperty
40 template <typename T, bool kInheritable> class SkSVGProperty {
41 public:
42  using ValueT = T;
43 
45 
46  explicit SkSVGProperty(SkSVGPropertyState state) : fState(state) {}
47 
48  explicit SkSVGProperty(const T& value) : fState(SkSVGPropertyState::kValue) {
49  fValue = value;
50  }
51 
52  explicit SkSVGProperty(T&& value) : fState(SkSVGPropertyState::kValue) {
53  fValue = std::move(value);
54  }
55 
56  template <typename... Args>
57  void init(Args&&... args) {
59  fValue.emplace(std::forward<Args>(args)...);
60  }
61 
62  constexpr bool isInheritable() const { return kInheritable; }
63 
64  bool isValue() const { return fState == SkSVGPropertyState::kValue; }
65 
66  T* getMaybeNull() const {
67  return fValue.has_value() ? &fValue.value() : nullptr;
68  }
69 
70  void set(SkSVGPropertyState state) {
71  fState = state;
72  if (fState != SkSVGPropertyState::kValue) {
73  fValue.reset();
74  }
75  }
76 
77  void set(const T& value) {
79  fValue = value;
80  }
81 
82  void set(T&& value) {
84  fValue = std::move(value);
85  }
86 
87  T* operator->() {
88  SkASSERT(fState == SkSVGPropertyState::kValue);
89  SkASSERT(fValue.has_value());
90  return &fValue.value();
91  }
92 
93  const T* operator->() const {
94  SkASSERT(fState == SkSVGPropertyState::kValue);
95  SkASSERT(fValue.has_value());
96  return &fValue.value();
97  }
98 
99  T& operator*() {
100  SkASSERT(fState == SkSVGPropertyState::kValue);
101  SkASSERT(fValue.has_value());
102  return *fValue;
103  }
104 
105  const T& operator*() const {
106  SkASSERT(fState == SkSVGPropertyState::kValue);
107  SkASSERT(fValue.has_value());
108  return *fValue;
109  }
110 
111 private:
112  SkSVGPropertyState fState;
113  std::optional<T> fValue;
114 };
115 
116 class SK_API SkSVGLength {
117 public:
118  enum class Unit {
119  kUnknown,
120  kNumber,
121  kPercentage,
122  kEMS,
123  kEXS,
124  kPX,
125  kCM,
126  kMM,
127  kIN,
128  kPT,
129  kPC,
130  };
131 
132  constexpr SkSVGLength() : fValue(0), fUnit(Unit::kUnknown) {}
133  explicit constexpr SkSVGLength(SkScalar v, Unit u = Unit::kNumber)
134  : fValue(v), fUnit(u) {}
135  SkSVGLength(const SkSVGLength&) = default;
136  SkSVGLength& operator=(const SkSVGLength&) = default;
137 
138  bool operator==(const SkSVGLength& other) const {
139  return fUnit == other.fUnit && fValue == other.fValue;
140  }
141  bool operator!=(const SkSVGLength& other) const { return !(*this == other); }
142 
143  const SkScalar& value() const { return fValue; }
144  const Unit& unit() const { return fUnit; }
145 
146 private:
147  SkScalar fValue;
148  Unit fUnit;
149 };
150 
151 // https://www.w3.org/TR/SVG11/linking.html#IRIReference
152 class SK_API SkSVGIRI {
153 public:
154  enum class Type {
155  kLocal,
156  kNonlocal,
157  kDataURI,
158  };
159 
160  SkSVGIRI() : fType(Type::kLocal) {}
161  SkSVGIRI(Type t, const SkSVGStringType& iri) : fType(t), fIRI(iri) {}
162 
163  Type type() const { return fType; }
164  const SkSVGStringType& iri() const { return fIRI; }
165 
166  bool operator==(const SkSVGIRI& other) const {
167  return fType == other.fType && fIRI == other.fIRI;
168  }
169  bool operator!=(const SkSVGIRI& other) const { return !(*this == other); }
170 
171 private:
172  Type fType;
173  SkSVGStringType fIRI;
174 };
175 
176 // https://www.w3.org/TR/SVG11/types.html#InterfaceSVGColor
177 class SK_API SkSVGColor {
178 public:
179  enum class Type {
180  kCurrentColor,
181  kColor,
182  kICCColor,
183  };
184  using Vars = std::vector<SkString>;
185 
187  explicit SkSVGColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c), fVars(nullptr) {}
188  explicit SkSVGColor(Type t, Vars&& vars)
189  : fType(t), fColor(SK_ColorBLACK)
190  , fVars(vars.empty() ? nullptr : new RefCntVars(std::move(vars))) {}
191  explicit SkSVGColor(const SkSVGColorType& c, Vars&& vars)
192  : fType(Type::kColor), fColor(c)
193  , fVars(vars.empty() ? nullptr : new RefCntVars(std::move(vars))) {}
194 
195  SkSVGColor(const SkSVGColor&) = default;
196  SkSVGColor& operator=(const SkSVGColor&) = default;
197  SkSVGColor(SkSVGColor&&) = default;
199 
200  bool operator==(const SkSVGColor& other) const {
201  return fType == other.fType && fColor == other.fColor && fVars == other.fVars;
202  }
203  bool operator!=(const SkSVGColor& other) const { return !(*this == other); }
204 
205  Type type() const { return fType; }
206  const SkSVGColorType& color() const { SkASSERT(fType == Type::kColor); return fColor; }
207  SkSpan<const SkString> vars() const {
208  return fVars ? SkSpan<const SkString>(fVars->fData) : SkSpan<const SkString>();
209  }
210  SkSpan<SkString> vars() {
211  return fVars ? SkSpan<SkString>(fVars->fData) : SkSpan<SkString>();
212  }
213 
214 private:
215  Type fType;
216  SkSVGColorType fColor;
217  struct RefCntVars : public SkNVRefCnt<RefCntVars> {
218  RefCntVars(Vars&& vars) : fData(std::move(vars)) {}
219  Vars fData;
220  };
221  sk_sp<RefCntVars> fVars;
222 };
223 
224 class SK_API SkSVGPaint {
225 public:
226  enum class Type {
227  kNone,
228  kColor,
229  kIRI,
230  };
231 
232  SkSVGPaint() : fType(Type::kNone), fColor(SK_ColorBLACK) {}
233  explicit SkSVGPaint(Type t) : fType(t), fColor(SK_ColorBLACK) {}
234  explicit SkSVGPaint(SkSVGColor c) : fType(Type::kColor), fColor(std::move(c)) {}
235  SkSVGPaint(const SkSVGIRI& iri, SkSVGColor fallback_color)
236  : fType(Type::kIRI), fColor(std::move(fallback_color)), fIRI(iri) {}
237 
238  SkSVGPaint(const SkSVGPaint&) = default;
239  SkSVGPaint& operator=(const SkSVGPaint&) = default;
240  SkSVGPaint(SkSVGPaint&&) = default;
242 
243  bool operator==(const SkSVGPaint& other) const {
244  return fType == other.fType && fColor == other.fColor && fIRI == other.fIRI;
245  }
246  bool operator!=(const SkSVGPaint& other) const { return !(*this == other); }
247 
248  Type type() const { return fType; }
249  const SkSVGColor& color() const {
250  SkASSERT(fType == Type::kColor || fType == Type::kIRI);
251  return fColor;
252  }
253  const SkSVGIRI& iri() const { SkASSERT(fType == Type::kIRI); return fIRI; }
254 
255 private:
256  Type fType;
257 
258  // Logical union.
259  SkSVGColor fColor;
260  SkSVGIRI fIRI;
261 };
262 
263 // <funciri> | none (used for clip/mask/filter properties)
264 class SK_API SkSVGFuncIRI {
265 public:
266  enum class Type {
267  kNone,
268  kIRI,
269  };
270 
271  SkSVGFuncIRI() : fType(Type::kNone) {}
272  explicit SkSVGFuncIRI(Type t) : fType(t) {}
273  explicit SkSVGFuncIRI(SkSVGIRI&& iri) : fType(Type::kIRI), fIRI(std::move(iri)) {}
274 
275  bool operator==(const SkSVGFuncIRI& other) const {
276  return fType == other.fType && fIRI == other.fIRI;
277  }
278  bool operator!=(const SkSVGFuncIRI& other) const { return !(*this == other); }
279 
280  Type type() const { return fType; }
281  const SkSVGIRI& iri() const { SkASSERT(fType == Type::kIRI); return fIRI; }
282 
283 private:
284  Type fType;
285  SkSVGIRI fIRI;
286 };
287 
288 enum class SkSVGLineCap {
289  kButt,
290  kRound,
291  kSquare,
292 };
293 
294 class SK_API SkSVGLineJoin {
295 public:
296  enum class Type {
297  kMiter,
298  kRound,
299  kBevel,
300  kInherit,
301  };
302 
303  constexpr SkSVGLineJoin() : fType(Type::kInherit) {}
304  constexpr explicit SkSVGLineJoin(Type t) : fType(t) {}
305 
306  SkSVGLineJoin(const SkSVGLineJoin&) = default;
308 
309  bool operator==(const SkSVGLineJoin& other) const { return fType == other.fType; }
310  bool operator!=(const SkSVGLineJoin& other) const { return !(*this == other); }
311 
312  Type type() const { return fType; }
313 
314 private:
315  Type fType;
316 };
317 
318 class SK_API SkSVGSpreadMethod {
319 public:
320  // These values must match Skia's SkShader::TileMode enum.
321  enum class Type {
322  kPad, // kClamp_TileMode
323  kRepeat, // kRepeat_TileMode
324  kReflect, // kMirror_TileMode
325  };
326 
327  constexpr SkSVGSpreadMethod() : fType(Type::kPad) {}
328  constexpr explicit SkSVGSpreadMethod(Type t) : fType(t) {}
329 
332 
333  bool operator==(const SkSVGSpreadMethod& other) const { return fType == other.fType; }
334  bool operator!=(const SkSVGSpreadMethod& other) const { return !(*this == other); }
335 
336  Type type() const { return fType; }
337 
338 private:
339  Type fType;
340 };
341 
342 class SK_API SkSVGFillRule {
343 public:
344  enum class Type {
345  kNonZero,
346  kEvenOdd,
347  kInherit,
348  };
349 
350  constexpr SkSVGFillRule() : fType(Type::kInherit) {}
351  constexpr explicit SkSVGFillRule(Type t) : fType(t) {}
352 
353  SkSVGFillRule(const SkSVGFillRule&) = default;
355 
356  bool operator==(const SkSVGFillRule& other) const { return fType == other.fType; }
357  bool operator!=(const SkSVGFillRule& other) const { return !(*this == other); }
358 
359  Type type() const { return fType; }
360 
362  SkASSERT(fType != Type::kInherit); // should never be called for unresolved values.
363  return fType == Type::kEvenOdd ? SkPathFillType::kEvenOdd : SkPathFillType::kWinding;
364  }
365 
366 private:
367  Type fType;
368 };
369 
370 class SK_API SkSVGVisibility {
371 public:
372  enum class Type {
373  kVisible,
374  kHidden,
375  kCollapse,
376  kInherit,
377  };
378 
379  constexpr SkSVGVisibility() : fType(Type::kVisible) {}
380  constexpr explicit SkSVGVisibility(Type t) : fType(t) {}
381 
382  SkSVGVisibility(const SkSVGVisibility&) = default;
384 
385  bool operator==(const SkSVGVisibility& other) const { return fType == other.fType; }
386  bool operator!=(const SkSVGVisibility& other) const { return !(*this == other); }
387 
388  Type type() const { return fType; }
389 
390 private:
391  Type fType;
392 };
393 
394 class SK_API SkSVGDashArray {
395 public:
396  enum class Type {
397  kNone,
398  kDashArray,
399  kInherit,
400  };
401 
402  SkSVGDashArray() : fType(Type::kNone) {}
403  explicit SkSVGDashArray(Type t) : fType(t) {}
404  explicit SkSVGDashArray(std::vector<SkSVGLength>&& dashArray)
405  : fType(Type::kDashArray)
406  , fDashArray(std::move(dashArray)) {}
407 
408  SkSVGDashArray(const SkSVGDashArray&) = default;
410 
411  bool operator==(const SkSVGDashArray& other) const {
412  return fType == other.fType && fDashArray == other.fDashArray;
413  }
414  bool operator!=(const SkSVGDashArray& other) const { return !(*this == other); }
415 
416  Type type() const { return fType; }
417 
418  const std::vector<SkSVGLength>& dashArray() const { return fDashArray; }
419 
420 private:
421  Type fType;
422  std::vector<SkSVGLength> fDashArray;
423 };
424 
425 class SK_API SkSVGStopColor {
426 public:
427  enum class Type {
428  kColor,
429  kCurrentColor,
430  kICCColor,
431  kInherit,
432  };
433 
434  SkSVGStopColor() : fType(Type::kColor), fColor(SK_ColorBLACK) {}
435  explicit SkSVGStopColor(Type t) : fType(t), fColor(SK_ColorBLACK) {}
436  explicit SkSVGStopColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c) {}
437 
438  SkSVGStopColor(const SkSVGStopColor&) = default;
440 
441  bool operator==(const SkSVGStopColor& other) const {
442  return fType == other.fType && fColor == other.fColor;
443  }
444  bool operator!=(const SkSVGStopColor& other) const { return !(*this == other); }
445 
446  Type type() const { return fType; }
447  const SkSVGColorType& color() const { SkASSERT(fType == Type::kColor); return fColor; }
448 
449 private:
450  Type fType;
451  SkSVGColorType fColor;
452 };
453 
455 public:
456  enum class Type {
457  kUserSpaceOnUse,
458  kObjectBoundingBox,
459  };
460 
461  SkSVGObjectBoundingBoxUnits() : fType(Type::kUserSpaceOnUse) {}
462  explicit SkSVGObjectBoundingBoxUnits(Type t) : fType(t) {}
463 
464  bool operator==(const SkSVGObjectBoundingBoxUnits& other) const {
465  return fType == other.fType;
466  }
467  bool operator!=(const SkSVGObjectBoundingBoxUnits& other) const {
468  return !(*this == other);
469  }
470 
471  Type type() const { return fType; }
472 
473 private:
474  Type fType;
475 };
476 
477 class SK_API SkSVGFontFamily {
478 public:
479  enum class Type {
480  kFamily,
481  kInherit,
482  };
483 
485  explicit SkSVGFontFamily(const char family[])
486  : fType(Type::kFamily)
487  , fFamily(family) {}
488 
489  bool operator==(const SkSVGFontFamily& other) const {
490  return fType == other.fType && fFamily == other.fFamily;
491  }
492  bool operator!=(const SkSVGFontFamily& other) const { return !(*this == other); }
493 
494  Type type() const { return fType; }
495 
496  const SkString& family() const { return fFamily; }
497 
498 private:
499  Type fType;
500  SkString fFamily;
501 };
502 
503 class SK_API SkSVGFontStyle {
504 public:
505  enum class Type {
506  kNormal,
507  kItalic,
508  kOblique,
509  kInherit,
510  };
511 
512  SkSVGFontStyle() : fType(Type::kInherit) {}
513  explicit SkSVGFontStyle(Type t) : fType(t) {}
514 
515  bool operator==(const SkSVGFontStyle& other) const {
516  return fType == other.fType;
517  }
518  bool operator!=(const SkSVGFontStyle& other) const { return !(*this == other); }
519 
520  Type type() const { return fType; }
521 
522 private:
523  Type fType;
524 };
525 
526 class SK_API SkSVGFontSize {
527 public:
528  enum class Type {
529  kLength,
530  kInherit,
531  };
532 
533  SkSVGFontSize() : fType(Type::kInherit), fSize(0) {}
534  explicit SkSVGFontSize(const SkSVGLength& s)
535  : fType(Type::kLength)
536  , fSize(s) {}
537 
538  bool operator==(const SkSVGFontSize& other) const {
539  return fType == other.fType && fSize == other.fSize;
540  }
541  bool operator!=(const SkSVGFontSize& other) const { return !(*this == other); }
542 
543  Type type() const { return fType; }
544 
545  const SkSVGLength& size() const { return fSize; }
546 
547 private:
548  Type fType;
549  SkSVGLength fSize;
550 };
551 
552 class SK_API SkSVGFontWeight {
553 public:
554  enum class Type {
555  k100,
556  k200,
557  k300,
558  k400,
559  k500,
560  k600,
561  k700,
562  k800,
563  k900,
564  kNormal,
565  kBold,
566  kBolder,
567  kLighter,
568  kInherit,
569  };
570 
572  explicit SkSVGFontWeight(Type t) : fType(t) {}
573 
574  bool operator==(const SkSVGFontWeight& other) const {
575  return fType == other.fType;
576  }
577  bool operator!=(const SkSVGFontWeight& other) const { return !(*this == other); }
578 
579  Type type() const { return fType; }
580 
581 private:
582  Type fType;
583 };
584 
586  enum Align : uint8_t {
587  // These values are chosen such that bits [0,1] encode X alignment, and
588  // bits [2,3] encode Y alignment.
589  kXMinYMin = 0x00,
590  kXMidYMin = 0x01,
591  kXMaxYMin = 0x02,
592  kXMinYMid = 0x04,
593  kXMidYMid = 0x05,
594  kXMaxYMid = 0x06,
595  kXMinYMax = 0x08,
596  kXMidYMax = 0x09,
597  kXMaxYMax = 0x0a,
598 
599  kNone = 0x10,
600  };
601 
602  enum Scale {
605  };
606 
607  Align fAlign = kXMidYMid;
608  Scale fScale = kMeet;
609 };
610 
611 class SK_API SkSVGTextAnchor {
612 public:
613  enum class Type {
614  kStart,
615  kMiddle,
616  kEnd,
617  kInherit,
618  };
619 
621  explicit SkSVGTextAnchor(Type t) : fType(t) {}
622 
623  bool operator==(const SkSVGTextAnchor& other) const {
624  return fType == other.fType;
625  }
626  bool operator!=(const SkSVGTextAnchor& other) const { return !(*this == other); }
627 
628  Type type() const { return fType; }
629 
630 private:
631  Type fType;
632 };
633 
634 // https://www.w3.org/TR/SVG11/filters.html#FilterPrimitiveInAttribute
635 class SK_API SkSVGFeInputType {
636 public:
637  enum class Type {
638  kSourceGraphic,
639  kSourceAlpha,
640  kBackgroundImage,
641  kBackgroundAlpha,
642  kFillPaint,
643  kStrokePaint,
644  kFilterPrimitiveReference,
645  kUnspecified,
646  };
647 
649  explicit SkSVGFeInputType(Type t) : fType(t) {}
650  explicit SkSVGFeInputType(const SkSVGStringType& id)
651  : fType(Type::kFilterPrimitiveReference), fId(id) {}
652 
653  bool operator==(const SkSVGFeInputType& other) const {
654  return fType == other.fType && fId == other.fId;
655  }
656  bool operator!=(const SkSVGFeInputType& other) const { return !(*this == other); }
657 
658  const SkString& id() const {
659  SkASSERT(fType == Type::kFilterPrimitiveReference);
660  return fId;
661  }
662 
663  Type type() const { return fType; }
664 
665 private:
666  Type fType;
667  SkString fId;
668 };
669 
671  kMatrix,
672  kSaturate,
673  kHueRotate,
675 };
676 
677 using SkSVGFeColorMatrixValues = std::vector<SkSVGNumberType>;
678 
680  kOver,
681  kIn,
682  kOut,
683  kAtop,
684  kXor,
685  kArithmetic,
686 };
687 
689 public:
690  SkSVGFeTurbulenceBaseFrequency() : fFreqX(0), fFreqY(0) {}
692  : fFreqX(freqX), fFreqY(freqY) {}
693 
694  SkSVGNumberType freqX() const { return fFreqX; }
695  SkSVGNumberType freqY() const { return fFreqY; }
696 
697 private:
698  SkSVGNumberType fFreqX;
699  SkSVGNumberType fFreqY;
700 };
701 
702 struct SK_API SkSVGFeTurbulenceType {
703  enum Type {
706  };
707 
709 
710  SkSVGFeTurbulenceType() : fType(kTurbulence) {}
711  explicit SkSVGFeTurbulenceType(Type type) : fType(type) {}
712 };
713 
714 enum class SkSVGXmlSpace {
715  kDefault,
716  kPreserve,
717 };
718 
719 enum class SkSVGColorspace {
720  kAuto,
721  kSRGB,
722  kLinearRGB,
723 };
724 
725 // https://www.w3.org/TR/SVG11/painting.html#DisplayProperty
726 enum class SkSVGDisplay {
727  kInline,
728  kNone,
729 };
730 
731 #endif // SkSVGTypes_DEFINED
@ kXor
r = s*(1-da) + d*(1-sa)
@ kColor
hue and saturation of source with luminosity of destination
Types, consts, functions, and macros for colors.
uint32_t SkColor
32-bit ARGB color value, unpremultiplied.
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLACK
Represents fully opaque black.
Definition: SkColor.h:103
@ kNormal
glyph outlines modified to improve constrast
@ kNone
glyph outlines unchanged
SkPathFillType
Definition: SkPathTypes.h:11
@ kWinding
Specifies that "inside" is computed by a non-zero sum of signed edge crossings.
@ kEvenOdd
Specifies that "inside" is computed by an odd number of edge crossings.
SkSVGDisplay
Definition: SkSVGTypes.h:726
SkSVGXmlSpace
Definition: SkSVGTypes.h:714
SkSVGLineCap
Definition: SkSVGTypes.h:288
SkSVGFeCompositeOperator
Definition: SkSVGTypes.h:679
SkColor SkSVGColorType
Definition: SkSVGTypes.h:25
SkSVGColorspace
Definition: SkSVGTypes.h:719
std::vector< SkPoint > SkSVGPointsType
Definition: SkSVGTypes.h:31
SkSVGPropertyState
Definition: SkSVGTypes.h:33
std::vector< SkSVGNumberType > SkSVGFeColorMatrixValues
Definition: SkSVGTypes.h:677
SkScalar SkSVGNumberType
Definition: SkSVGTypes.h:27
SkSVGFeColorMatrixType
Definition: SkSVGTypes.h:670
int SkSVGIntegerType
Definition: SkSVGTypes.h:26
float SkScalar
Definition: SkScalar.h:14
@ kRepeat
Repeat the shader's image horizontally and vertically.
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
Definition: SkRefCnt.h:160
Definition: SkSVGTypes.h:177
SkSpan< const SkString > vars() const
Definition: SkSVGTypes.h:207
const SkSVGColorType & color() const
Definition: SkSVGTypes.h:206
std::vector< SkString > Vars
Definition: SkSVGTypes.h:184
SkSVGColor & operator=(SkSVGColor &&)=default
Type type() const
Definition: SkSVGTypes.h:205
SkSpan< SkString > vars()
Definition: SkSVGTypes.h:210
SkSVGColor(SkSVGColor &&)=default
bool operator!=(const SkSVGColor &other) const
Definition: SkSVGTypes.h:203
SkSVGColor(const SkSVGColorType &c, Vars &&vars)
Definition: SkSVGTypes.h:191
SkSVGColor(Type t, Vars &&vars)
Definition: SkSVGTypes.h:188
SkSVGColor & operator=(const SkSVGColor &)=default
Type
Definition: SkSVGTypes.h:179
SkSVGColor(const SkSVGColorType &c)
Definition: SkSVGTypes.h:187
SkSVGColor()
Definition: SkSVGTypes.h:186
SkSVGColor(const SkSVGColor &)=default
bool operator==(const SkSVGColor &other) const
Definition: SkSVGTypes.h:200
Definition: SkSVGTypes.h:394
bool operator==(const SkSVGDashArray &other) const
Definition: SkSVGTypes.h:411
const std::vector< SkSVGLength > & dashArray() const
Definition: SkSVGTypes.h:418
SkSVGDashArray & operator=(const SkSVGDashArray &)=default
Type type() const
Definition: SkSVGTypes.h:416
SkSVGDashArray(Type t)
Definition: SkSVGTypes.h:403
SkSVGDashArray(const SkSVGDashArray &)=default
SkSVGDashArray(std::vector< SkSVGLength > &&dashArray)
Definition: SkSVGTypes.h:404
bool operator!=(const SkSVGDashArray &other) const
Definition: SkSVGTypes.h:414
SkSVGDashArray()
Definition: SkSVGTypes.h:402
Type
Definition: SkSVGTypes.h:396
Definition: SkSVGTypes.h:635
bool operator==(const SkSVGFeInputType &other) const
Definition: SkSVGTypes.h:653
SkSVGFeInputType(Type t)
Definition: SkSVGTypes.h:649
const SkString & id() const
Definition: SkSVGTypes.h:658
bool operator!=(const SkSVGFeInputType &other) const
Definition: SkSVGTypes.h:656
SkSVGFeInputType()
Definition: SkSVGTypes.h:648
SkSVGFeInputType(const SkSVGStringType &id)
Definition: SkSVGTypes.h:650
Type type() const
Definition: SkSVGTypes.h:663
Type
Definition: SkSVGTypes.h:637
Definition: SkSVGTypes.h:688
SkSVGFeTurbulenceBaseFrequency(SkSVGNumberType freqX, SkSVGNumberType freqY)
Definition: SkSVGTypes.h:691
SkSVGNumberType freqX() const
Definition: SkSVGTypes.h:694
SkSVGFeTurbulenceBaseFrequency()
Definition: SkSVGTypes.h:690
SkSVGNumberType freqY() const
Definition: SkSVGTypes.h:695
Definition: SkSVGTypes.h:342
bool operator==(const SkSVGFillRule &other) const
Definition: SkSVGTypes.h:356
SkSVGFillRule(const SkSVGFillRule &)=default
constexpr SkSVGFillRule(Type t)
Definition: SkSVGTypes.h:351
SkSVGFillRule & operator=(const SkSVGFillRule &)=default
Type type() const
Definition: SkSVGTypes.h:359
bool operator!=(const SkSVGFillRule &other) const
Definition: SkSVGTypes.h:357
Type
Definition: SkSVGTypes.h:344
constexpr SkSVGFillRule()
Definition: SkSVGTypes.h:350
SkPathFillType asFillType() const
Definition: SkSVGTypes.h:361
Definition: SkSVGTypes.h:477
SkSVGFontFamily()
Definition: SkSVGTypes.h:484
Type type() const
Definition: SkSVGTypes.h:494
bool operator!=(const SkSVGFontFamily &other) const
Definition: SkSVGTypes.h:492
SkSVGFontFamily(const char family[])
Definition: SkSVGTypes.h:485
Type
Definition: SkSVGTypes.h:479
const SkString & family() const
Definition: SkSVGTypes.h:496
bool operator==(const SkSVGFontFamily &other) const
Definition: SkSVGTypes.h:489
Definition: SkSVGTypes.h:526
SkSVGFontSize()
Definition: SkSVGTypes.h:533
SkSVGFontSize(const SkSVGLength &s)
Definition: SkSVGTypes.h:534
Type
Definition: SkSVGTypes.h:528
bool operator!=(const SkSVGFontSize &other) const
Definition: SkSVGTypes.h:541
const SkSVGLength & size() const
Definition: SkSVGTypes.h:545
Type type() const
Definition: SkSVGTypes.h:543
bool operator==(const SkSVGFontSize &other) const
Definition: SkSVGTypes.h:538
Definition: SkSVGTypes.h:503
SkSVGFontStyle(Type t)
Definition: SkSVGTypes.h:513
SkSVGFontStyle()
Definition: SkSVGTypes.h:512
bool operator==(const SkSVGFontStyle &other) const
Definition: SkSVGTypes.h:515
Type
Definition: SkSVGTypes.h:505
Type type() const
Definition: SkSVGTypes.h:520
bool operator!=(const SkSVGFontStyle &other) const
Definition: SkSVGTypes.h:518
Definition: SkSVGTypes.h:552
SkSVGFontWeight()
Definition: SkSVGTypes.h:571
SkSVGFontWeight(Type t)
Definition: SkSVGTypes.h:572
bool operator!=(const SkSVGFontWeight &other) const
Definition: SkSVGTypes.h:577
Type
Definition: SkSVGTypes.h:554
bool operator==(const SkSVGFontWeight &other) const
Definition: SkSVGTypes.h:574
Type type() const
Definition: SkSVGTypes.h:579
Definition: SkSVGTypes.h:264
bool operator!=(const SkSVGFuncIRI &other) const
Definition: SkSVGTypes.h:278
SkSVGFuncIRI()
Definition: SkSVGTypes.h:271
SkSVGFuncIRI(SkSVGIRI &&iri)
Definition: SkSVGTypes.h:273
bool operator==(const SkSVGFuncIRI &other) const
Definition: SkSVGTypes.h:275
Type type() const
Definition: SkSVGTypes.h:280
SkSVGFuncIRI(Type t)
Definition: SkSVGTypes.h:272
const SkSVGIRI & iri() const
Definition: SkSVGTypes.h:281
Type
Definition: SkSVGTypes.h:266
Definition: SkSVGTypes.h:152
Type
Definition: SkSVGTypes.h:154
Type type() const
Definition: SkSVGTypes.h:163
bool operator!=(const SkSVGIRI &other) const
Definition: SkSVGTypes.h:169
SkSVGIRI(Type t, const SkSVGStringType &iri)
Definition: SkSVGTypes.h:161
bool operator==(const SkSVGIRI &other) const
Definition: SkSVGTypes.h:166
const SkSVGStringType & iri() const
Definition: SkSVGTypes.h:164
SkSVGIRI()
Definition: SkSVGTypes.h:160
Definition: SkSVGTypes.h:116
constexpr SkSVGLength()
Definition: SkSVGTypes.h:132
bool operator!=(const SkSVGLength &other) const
Definition: SkSVGTypes.h:141
bool operator==(const SkSVGLength &other) const
Definition: SkSVGTypes.h:138
const SkScalar & value() const
Definition: SkSVGTypes.h:143
SkSVGLength & operator=(const SkSVGLength &)=default
constexpr SkSVGLength(SkScalar v, Unit u=Unit::kNumber)
Definition: SkSVGTypes.h:133
SkSVGLength(const SkSVGLength &)=default
Unit
Definition: SkSVGTypes.h:118
const Unit & unit() const
Definition: SkSVGTypes.h:144
Definition: SkSVGTypes.h:294
SkSVGLineJoin(const SkSVGLineJoin &)=default
Type type() const
Definition: SkSVGTypes.h:312
constexpr SkSVGLineJoin()
Definition: SkSVGTypes.h:303
SkSVGLineJoin & operator=(const SkSVGLineJoin &)=default
bool operator!=(const SkSVGLineJoin &other) const
Definition: SkSVGTypes.h:310
Type
Definition: SkSVGTypes.h:296
bool operator==(const SkSVGLineJoin &other) const
Definition: SkSVGTypes.h:309
constexpr SkSVGLineJoin(Type t)
Definition: SkSVGTypes.h:304
Definition: SkSVGTypes.h:454
bool operator==(const SkSVGObjectBoundingBoxUnits &other) const
Definition: SkSVGTypes.h:464
SkSVGObjectBoundingBoxUnits(Type t)
Definition: SkSVGTypes.h:462
Type
Definition: SkSVGTypes.h:456
bool operator!=(const SkSVGObjectBoundingBoxUnits &other) const
Definition: SkSVGTypes.h:467
Type type() const
Definition: SkSVGTypes.h:471
SkSVGObjectBoundingBoxUnits()
Definition: SkSVGTypes.h:461
Definition: SkSVGTypes.h:224
SkSVGPaint & operator=(SkSVGPaint &&)=default
SkSVGPaint(Type t)
Definition: SkSVGTypes.h:233
SkSVGPaint()
Definition: SkSVGTypes.h:232
SkSVGPaint(const SkSVGIRI &iri, SkSVGColor fallback_color)
Definition: SkSVGTypes.h:235
SkSVGPaint(SkSVGPaint &&)=default
Type
Definition: SkSVGTypes.h:226
const SkSVGColor & color() const
Definition: SkSVGTypes.h:249
SkSVGPaint(SkSVGColor c)
Definition: SkSVGTypes.h:234
const SkSVGIRI & iri() const
Definition: SkSVGTypes.h:253
bool operator!=(const SkSVGPaint &other) const
Definition: SkSVGTypes.h:246
Type type() const
Definition: SkSVGTypes.h:248
SkSVGPaint(const SkSVGPaint &)=default
SkSVGPaint & operator=(const SkSVGPaint &)=default
bool operator==(const SkSVGPaint &other) const
Definition: SkSVGTypes.h:243
Definition: SkSVGTypes.h:40
SkSVGProperty(const T &value)
Definition: SkSVGTypes.h:48
constexpr bool isInheritable() const
Definition: SkSVGTypes.h:62
SkSVGProperty()
Definition: SkSVGTypes.h:44
void set(const T &value)
Definition: SkSVGTypes.h:77
const T * operator->() const
Definition: SkSVGTypes.h:93
T ValueT
Definition: SkSVGTypes.h:42
T * operator->()
Definition: SkSVGTypes.h:87
SkSVGProperty(SkSVGPropertyState state)
Definition: SkSVGTypes.h:46
bool isValue() const
Definition: SkSVGTypes.h:64
T & operator*()
Definition: SkSVGTypes.h:99
const T & operator*() const
Definition: SkSVGTypes.h:105
void set(T &&value)
Definition: SkSVGTypes.h:82
void set(SkSVGPropertyState state)
Definition: SkSVGTypes.h:70
SkSVGProperty(T &&value)
Definition: SkSVGTypes.h:52
void init(Args &&... args)
Definition: SkSVGTypes.h:57
T * getMaybeNull() const
Definition: SkSVGTypes.h:66
Definition: SkSVGTypes.h:318
constexpr SkSVGSpreadMethod()
Definition: SkSVGTypes.h:327
Type
Definition: SkSVGTypes.h:321
constexpr SkSVGSpreadMethod(Type t)
Definition: SkSVGTypes.h:328
SkSVGSpreadMethod & operator=(const SkSVGSpreadMethod &)=default
bool operator!=(const SkSVGSpreadMethod &other) const
Definition: SkSVGTypes.h:334
Type type() const
Definition: SkSVGTypes.h:336
SkSVGSpreadMethod(const SkSVGSpreadMethod &)=default
bool operator==(const SkSVGSpreadMethod &other) const
Definition: SkSVGTypes.h:333
Definition: SkSVGTypes.h:425
Type type() const
Definition: SkSVGTypes.h:446
SkSVGStopColor(Type t)
Definition: SkSVGTypes.h:435
bool operator==(const SkSVGStopColor &other) const
Definition: SkSVGTypes.h:441
SkSVGStopColor()
Definition: SkSVGTypes.h:434
Type
Definition: SkSVGTypes.h:427
SkSVGStopColor(const SkSVGColorType &c)
Definition: SkSVGTypes.h:436
SkSVGStopColor(const SkSVGStopColor &)=default
const SkSVGColorType & color() const
Definition: SkSVGTypes.h:447
SkSVGStopColor & operator=(const SkSVGStopColor &)=default
bool operator!=(const SkSVGStopColor &other) const
Definition: SkSVGTypes.h:444
Definition: SkSVGTypes.h:611
SkSVGTextAnchor()
Definition: SkSVGTypes.h:620
SkSVGTextAnchor(Type t)
Definition: SkSVGTypes.h:621
Type type() const
Definition: SkSVGTypes.h:628
Type
Definition: SkSVGTypes.h:613
bool operator==(const SkSVGTextAnchor &other) const
Definition: SkSVGTypes.h:623
bool operator!=(const SkSVGTextAnchor &other) const
Definition: SkSVGTypes.h:626
Definition: SkSVGTypes.h:370
Type type() const
Definition: SkSVGTypes.h:388
bool operator!=(const SkSVGVisibility &other) const
Definition: SkSVGTypes.h:386
bool operator==(const SkSVGVisibility &other) const
Definition: SkSVGTypes.h:385
SkSVGVisibility & operator=(const SkSVGVisibility &)=default
constexpr SkSVGVisibility()
Definition: SkSVGTypes.h:379
Type
Definition: SkSVGTypes.h:372
constexpr SkSVGVisibility(Type t)
Definition: SkSVGTypes.h:380
SkSVGVisibility(const SkSVGVisibility &)=default
Light weight class for managing strings.
Definition: SkString.h:118
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582
Definition: SkSVGTypes.h:702
Type
Definition: SkSVGTypes.h:703
@ kTurbulence
Definition: SkSVGTypes.h:705
@ kFractalNoise
Definition: SkSVGTypes.h:704
SkSVGFeTurbulenceType(Type type)
Definition: SkSVGTypes.h:711
Type fType
Definition: SkSVGTypes.h:708
SkSVGFeTurbulenceType()
Definition: SkSVGTypes.h:710
Definition: SkSVGTypes.h:585
Align
Definition: SkSVGTypes.h:586
Scale
Definition: SkSVGTypes.h:602
@ kMeet
Definition: SkSVGTypes.h:603
@ kSlice
Definition: SkSVGTypes.h:604