#include <SkSVGAttributeParser.h>
Definition at line 17 of file SkSVGAttributeParser.h.
◆ ParseResult
◆ SkSVGAttributeParser()
SkSVGAttributeParser::SkSVGAttributeParser |
( |
const char |
attributeString[] | ) |
|
Definition at line 43 of file SkSVGAttributeParser.cpp.
45 : fCurPos(attributeString), fEndPos(fCurPos + strlen(attributeString)) {}
◆ parse() [1/38]
static ParseResult< T > SkSVGAttributeParser::parse |
( |
const char * |
expectedName, |
|
|
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
|
inlinestatic |
Definition at line 41 of file SkSVGAttributeParser.h.
43 {
44 if (!strcmp(
name, expectedName)) {
45 return parse<T>(
value);
46 }
47
48 return ParseResult<T>();
49 }
DEF_SWITCHES_START aot vmservice shared library name
◆ parse() [2/38]
static ParseResult< T > SkSVGAttributeParser::parse |
( |
const char * |
value | ) |
|
|
inlinestatic |
Definition at line 31 of file SkSVGAttributeParser.h.
31 {
35 result.set(std::move(parsedValue));
36 }
38 }
SkSVGAttributeParser(const char[])
bool parse(SkSVGIntegerType *v)
◆ parse() [3/38]
template<>
bool SkSVGAttributeParser::parse |
( |
SkPath * |
path | ) |
|
|
static |
Definition at line 23 of file SkSVGPath.cpp.
23 {
25}
static bool FromSVGString(const char str[], SkPath *)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
◆ parse() [4/38]
template<>
bool SkSVGAttributeParser::parse |
( |
SkSVGColor * |
color | ) |
|
Definition at line 446 of file SkSVGAttributeParser.cpp.
446 {
447 this->parseWSToken();
449 return false;
450 }
451 this->parseWSToken();
452 return this->parseEOSToken();
453}
std::vector< SkString > Vars
◆ parse() [5/38]
Definition at line 1144 of file SkSVGAttributeParser.cpp.
1144 {
1145 static constexpr std::tuple<const char*, SkSVGColorspace> gColorspaceMap[] = {
1149 };
1150
1151 return this->parseEnumMap(gColorspaceMap, colorspace) && this->parseEOSToken();
1152}
◆ parse() [6/38]
Definition at line 398 of file SkSVGAttributeParser.cpp.
398 {
399 this->parseWSToken();
400 if (!this->parseSVGColorType(
color)) {
401 return false;
402 }
403 this->parseWSToken();
404 return this->parseEOSToken();
405}
◆ parse() [7/38]
Definition at line 931 of file SkSVGAttributeParser.cpp.
931 {
932 bool parsedValue = false;
933 if (this->parseExpectedStringToken("none")) {
935 parsedValue = true;
936 } else if (this->parseExpectedStringToken("inherit")) {
938 parsedValue = true;
939 } else {
940 std::vector<SkSVGLength> dashes;
941 for (;;) {
943
944 if (!this->
parse(&dash)) {
945 break;
946 }
947
948 dashes.push_back(dash);
949 parsedValue = true;
950 }
951
952 if (parsedValue) {
954 }
955 }
956
957 return parsedValue && this->parseEOSToken();
958}
◆ parse() [8/38]
Definition at line 1156 of file SkSVGAttributeParser.cpp.
1156 {
1157 static const struct {
1160 } gDisplayInfo[] = {
1163 };
1164
1165 bool parsedValue = false;
1166 for (const auto& parseInfo : gDisplayInfo) {
1167 if (this->parseExpectedStringToken(parseInfo.fName)) {
1169 parsedValue = true;
1170 break;
1171 }
1172 }
1173
1174 return parsedValue && this->parseEOSToken();
1175}
◆ parse() [9/38]
Definition at line 100 of file SkSVGFeColorMatrix.cpp.
100 {
101 static constexpr std::tuple<const char*, SkSVGFeColorMatrixType> gTypeMap[] = {
106 };
107
108 return this->parseEnumMap(gTypeMap,
type) && this->parseEOSToken();
109}
◆ parse() [10/38]
Definition at line 63 of file SkSVGFeComposite.cpp.
63 {
64 static constexpr std::tuple<const char*, SkSVGFeCompositeOperator> gOpMap[] = {
71 };
72
73 return this->parseEnumMap(gOpMap, op) && this->parseEOSToken();
74}
◆ parse() [11/38]
Definition at line 162 of file SkSVGFeComponentTransfer.cpp.
162 {
163 static constexpr std::tuple<const char*, SkSVGFeFuncType> gTypeMap[] = {
169 };
170
171 return this->parseEnumMap(gTypeMap,
type) && this->parseEOSToken();
172}
◆ parse() [12/38]
Definition at line 103 of file SkSVGFe.cpp.
103 {
104 static constexpr std::tuple<const char*, SkSVGFeInputType::Type> gTypeMap[] = {
111 };
112
115 bool parsedValue = false;
116 if (this->parseEnumMap(gTypeMap, &t)) {
118 parsedValue = true;
119 }
else if (
parse(&resultId)) {
121 parsedValue = true;
122 }
123
124 return parsedValue && this->parseEOSToken();
125}
◆ parse() [13/38]
Definition at line 28 of file SkSVGFeTurbulence.cpp.
29 {
31 if (!this->
parse(&freqX)) {
32 return false;
33 }
34
36 this->parseCommaWspToken();
37 if (this->
parse(&freqY)) {
39 } else {
41 }
42
43 return this->parseEOSToken();
44}
◆ parse() [14/38]
Definition at line 47 of file SkSVGFeTurbulence.cpp.
47 {
48 bool parsedValue = false;
49
50 if (this->parseExpectedStringToken("fractalNoise")) {
52 parsedValue = true;
53 } else if (this->parseExpectedStringToken("turbulence")) {
55 parsedValue = true;
56 }
57
58 return parsedValue && this->parseEOSToken();
59}
◆ parse() [15/38]
Definition at line 882 of file SkSVGAttributeParser.cpp.
882 {
883 static const struct {
886 } gFillRuleInfo[] = {
890 };
891
892 bool parsedValue = false;
894 if (this->parseExpectedStringToken(gFillRuleInfo[
i].
fName)) {
896 parsedValue = true;
897 break;
898 }
899 }
900
901 return parsedValue && this->parseEOSToken();
902}
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
◆ parse() [16/38]
Definition at line 962 of file SkSVGAttributeParser.cpp.
962 {
963 bool parsedValue = false;
964 if (this->parseExpectedStringToken("inherit")) {
966 parsedValue = true;
967 } else {
968
969
970 const auto* comma = strchr(fCurPos, ',');
971 auto family_name = comma ?
SkString(fCurPos, comma - fCurPos)
974 fCurPos += strlen(fCurPos);
975 parsedValue = true;
976 }
977
978 return parsedValue && this->parseEOSToken();
979}
◆ parse() [17/38]
Definition at line 983 of file SkSVGAttributeParser.cpp.
983 {
984 bool parsedValue = false;
985 if (this->parseExpectedStringToken("inherit")) {
987 parsedValue = true;
988 } else {
990 if (this->
parse(&length)) {
992 parsedValue = true;
993 }
994 }
995
996 return parsedValue && this->parseEOSToken();
997}
◆ parse() [18/38]
Definition at line 1001 of file SkSVGAttributeParser.cpp.
1001 {
1002 static constexpr std::tuple<const char*, SkSVGFontStyle::Type> gStyleMap[] = {
1007 };
1008
1009 bool parsedValue = false;
1011
1012 if (this->parseEnumMap(gStyleMap, &
type)) {
1014 parsedValue = true;
1015 }
1016
1017 return parsedValue && this->parseEOSToken();
1018}
◆ parse() [19/38]
Definition at line 1022 of file SkSVGAttributeParser.cpp.
1022 {
1023 static constexpr std::tuple<const char*, SkSVGFontWeight::Type> gWeightMap[] = {
1038 };
1039
1040 bool parsedValue = false;
1042
1043 if (this->parseEnumMap(gWeightMap, &
type)) {
1045 parsedValue = true;
1046 }
1047
1048 return parsedValue && this->parseEOSToken();
1049}
◆ parse() [20/38]
Definition at line 752 of file SkSVGAttributeParser.cpp.
752 {
754 bool parsedValue = false;
755
756 if (this->parseExpectedStringToken("none")) {
758 parsedValue = true;
759 } else if (this->parseFuncIRI(firi)) {
760 parsedValue = true;
761 }
762
763 return parsedValue && this->parseEOSToken();
764}
◆ parse() [21/38]
◆ parse() [22/38]
template<>
bool SkSVGAttributeParser::parse |
( |
SkSVGIRI * |
iri | ) |
|
Definition at line 457 of file SkSVGAttributeParser.cpp.
457 {
458
459 this->parseWSToken();
460
462 if (this->parseExpectedStringToken("#")) {
464 } else if (this->matchStringToken("data:")) {
466 } else {
468 }
469
470 const auto*
start = fCurPos;
471 if (!this->advanceWhile([](char c) -> bool { return c != ')'; })) {
472 return false;
473 }
475 return true;
476}
◆ parse() [23/38]
template<>
bool SkSVGAttributeParser::parse |
( |
SkSVGLength * |
length | ) |
|
Definition at line 538 of file SkSVGAttributeParser.cpp.
538 {
541
542 if (this->parseScalarToken(&
s) &&
543 (this->parseLengthUnitToken(&u) || this->parseSepToken() || this->parseEOSToken())) {
545
546 this->parseSepToken();
547 return true;
548 }
549
550 return false;
551}
◆ parse() [24/38]
Definition at line 768 of file SkSVGAttributeParser.cpp.
768 {
769 static const struct {
772 } gCapInfo[] = {
776 };
777
778 bool parsedValue = false;
780 if (this->parseExpectedStringToken(gCapInfo[
i].
fName)) {
782 parsedValue = true;
783 break;
784 }
785 }
786
787 return parsedValue && this->parseEOSToken();
788}
◆ parse() [25/38]
Definition at line 792 of file SkSVGAttributeParser.cpp.
792 {
793 static const struct {
796 } gJoinInfo[] = {
801 };
802
803 bool parsedValue = false;
805 if (this->parseExpectedStringToken(gJoinInfo[
i].
fName)) {
807 parsedValue = true;
808 break;
809 }
810 }
811
812 return parsedValue && this->parseEOSToken();
813}
static SkString join(const CommandLineFlags::StringArray &)
◆ parse() [26/38]
Definition at line 502 of file SkSVGAttributeParser.cpp.
502 {
503
504 this->parseWSToken();
505
507 if (this->parseScalarToken(&
s)) {
509
510 this->parseSepToken();
511 return true;
512 }
513
514 return false;
515}
◆ parse() [27/38]
Definition at line 817 of file SkSVGAttributeParser.cpp.
817 {
818 bool parsedValue = false;
819 if (this->parseExpectedStringToken("userSpaceOnUse")) {
820 *objectBoundingBoxUnits =
822 parsedValue = true;
823 } else if (this->parseExpectedStringToken("objectBoundingBox")) {
824 *objectBoundingBoxUnits =
826 parsedValue = true;
827 }
828 return parsedValue && this->parseEOSToken();
829}
◆ parse() [28/38]
template<>
bool SkSVGAttributeParser::parse |
( |
SkSVGPaint * |
paint | ) |
|
Definition at line 725 of file SkSVGAttributeParser.cpp.
725 {
728 bool parsedValue = false;
729
730 this->parseWSToken();
733 parsedValue = true;
734 } else if (this->parseExpectedStringToken("none")) {
736 parsedValue = true;
737 } else if (this->parseFuncIRI(&iri)) {
738
739 this->parseWSToken();
742 parsedValue = true;
743 }
744 this->parseWSToken();
745 return parsedValue && this->parseEOSToken();
746}
const SkSVGIRI & iri() const
◆ parse() [29/38]
Definition at line 833 of file SkSVGAttributeParser.cpp.
833 {
835
836
837
838
839 this->advanceWhile(
is_ws);
840
841 bool parsedValue = false;
842 for (;;) {
843
844
845
846
847 if (parsedValue && !this->parseCommaWspToken()) {
848 break;
849 }
850
852 if (!this->parseScalarToken(&
x)) {
853 break;
854 }
855
856
857
858
859
860 if (!this->parseCommaWspToken() && !this->parseEOSToken() && *fCurPos != '-') {
861 break;
862 }
863
864 if (!this->parseScalarToken(&
y)) {
865 break;
866 }
867
869 parsedValue = true;
870 }
871
872 if (parsedValue && this->parseEOSToken()) {
874 return true;
875 }
876
877 return false;
878}
static const int points[]
std::vector< SkPoint > SkSVGPointsType
static constexpr SkPoint Make(float x, float y)
◆ parse() [30/38]
◆ parse() [31/38]
Definition at line 98 of file SkSVGGradient.cpp.
98 {
99 static const struct {
102 } gSpreadInfo[] = {
106 };
107
108 bool parsedValue = false;
110 if (this->parseExpectedStringToken(gSpreadInfo[
i].
fName)) {
112 parsedValue = true;
113 break;
114 }
115 }
116
117 return parsedValue && this->parseEOSToken();
118}
◆ parse() [32/38]
Definition at line 491 of file SkSVGAttributeParser.cpp.
491 {
492 if (this->parseEOSToken()) {
493 return false;
494 }
496 fCurPos +=
result->size();
497 return this->parseEOSToken();
498}
◆ parse() [33/38]
Definition at line 1053 of file SkSVGAttributeParser.cpp.
1053 {
1054 static constexpr std::tuple<const char*, SkSVGTextAnchor::Type> gAnchorMap[] = {
1059 };
1060
1061 bool parsedValue = false;
1063
1064 if (this->parseEnumMap(gAnchorMap, &
type)) {
1066 parsedValue = true;
1067 }
1068
1069 return parsedValue && this->parseEOSToken();
1070}
◆ parse() [34/38]
Definition at line 692 of file SkSVGAttributeParser.cpp.
692 {
694
695 bool parsed = false;
696 while (true) {
698
699 if (!( this->parseMatrixToken(&
m)
700 || this->parseTranslateToken(&
m)
701 || this->parseScaleToken(&
m)
702 || this->parseRotateToken(&
m)
703 || this->parseSkewXToken(&
m)
704 || this->parseSkewYToken(&
m))) {
705 break;
706 }
707
709 parsed = true;
710
711 this->parseCommaWspToken();
712 }
713
714 this->parseWSToken();
715 if (!parsed || !this->parseEOSToken()) {
716 return false;
717 }
718
720 return true;
721}
SkMatrix SkSVGTransformType
static const SkMatrix & I()
unsigned useCenter Optional< SkMatrix > matrix
◆ parse() [35/38]
Definition at line 906 of file SkSVGAttributeParser.cpp.
906 {
907 static const struct {
910 } gVisibilityInfo[] = {
915 };
916
917 bool parsedValue = false;
918 for (const auto& parseInfo : gVisibilityInfo) {
919 if (this->parseExpectedStringToken(parseInfo.fName)) {
921 parsedValue = true;
922 break;
923 }
924 }
925
926 return parsedValue && this->parseEOSToken();
927}
◆ parse() [36/38]
Definition at line 575 of file SkSVGText.cpp.
575 {
576 static constexpr std::tuple<const char*, SkSVGXmlSpace> gXmlSpaceMap[] = {
579 };
580
581 return this->parseEnumMap(gXmlSpaceMap, xs) && this->parseEOSToken();
582}
◆ parse() [37/38]
template<>
bool SkSVGAttributeParser::parse |
( |
std::vector< SkSVGLength > * |
lengths | ) |
|
◆ parse() [38/38]
template<>
bool SkSVGAttributeParser::parse |
( |
std::vector< SkSVGNumberType > * |
numbers | ) |
|
◆ parseInteger()
Definition at line 518 of file SkSVGAttributeParser.cpp.
518 {
519
520 this->parseWSToken();
521
522
523 this->parseExpectedStringToken("+");
524
526 if (this->parseInt32Token(&
i)) {
528
529 this->parseSepToken();
530 return true;
531 }
532
533 return false;
534}
◆ parsePreserveAspectRatio()
Definition at line 1073 of file SkSVGAttributeParser.cpp.
1073 {
1074 static constexpr std::tuple<const char*, SkSVGPreserveAspectRatio::Align> gAlignMap[] = {
1085 };
1086
1087 static constexpr std::tuple<const char*, SkSVGPreserveAspectRatio::Scale> gScaleMap[] = {
1090 };
1091
1092 bool parsedValue = false;
1093
1094
1095 this->parseExpectedStringToken("defer");
1096 this->parseWSToken();
1097
1098 if (this->parseEnumMap(gAlignMap, &par->
fAlign)) {
1099 parsedValue = true;
1100
1101
1102 this->parseWSToken();
1103 this->parseEnumMap(gScaleMap, &par->
fScale);
1104 }
1105
1106 return parsedValue && this->parseEOSToken();
1107}
◆ parseProperty()
template<typename PropertyT >
static ParseResult< PropertyT > SkSVGAttributeParser::parseProperty |
( |
const char * |
expectedName, |
|
|
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
|
inlinestatic |
Definition at line 52 of file SkSVGAttributeParser.h.
54 {
55 if (strcmp(
name, expectedName) != 0) {
56 return ParseResult<PropertyT>();
57 }
58
59 if (!strcmp(
value,
"inherit")) {
61 return ParseResult<PropertyT>(&
result);
62 }
63
64 auto pr = parse<typename PropertyT::ValueT>(
value);
65 if (pr.isValid()) {
67 return ParseResult<PropertyT>(&
result);
68 }
69
70 return ParseResult<PropertyT>();
71 }
◆ parseViewBox()
Definition at line 554 of file SkSVGAttributeParser.cpp.
554 {
556 this->parseWSToken();
557
558 bool parsedValue = false;
559 if (this->parseScalarToken(&
x) && this->parseSepToken() &&
560 this->parseScalarToken(&
y) && this->parseSepToken() &&
561 this->parseScalarToken(&
w) && this->parseSepToken() &&
562 this->parseScalarToken(&
h)) {
563
565 parsedValue = true;
566
567 this->parseWSToken();
568 }
569 return parsedValue && this->parseEOSToken();
570}
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
The documentation for this class was generated from the following files: