MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / parsePattern

Function parsePattern

rEFIt_UEFI/libeg/nanosvg.cpp:3209–3232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3207}
3208
3209static void parsePattern(NSVGparser* p, const char** dict)
3210{
3211 NSVGattrib* attr = nsvg__getAttr(p);
3212 int i;
3213 float w = 0.f, h=0.f;
3214 NSVGpattern *pt;
3215
3216 for (i = 0; dict[i]; i += 2) {
3217 if (strcmp(dict[i], "width") == 0) {
3218 w = nsvg__parseCoordinate(p, dict[i+1], 0.0f, nsvg__actualWidth(p));
3219 } else if (strcmp(dict[i], "height") == 0) {
3220 h = nsvg__parseCoordinate(p, dict[i+1], 0.0f, nsvg__actualHeight(p));
3221 } else {
3222 nsvg__parseAttr(p, dict[i], dict[i + 1]);
3223 }
3224 }
3225
3226 pt = (__typeof__(pt))AllocateZeroPool(sizeof(NSVGpattern));
3227 AsciiStrCpyS(pt->id, 64, attr->id);
3228 pt->width = w;
3229 pt->height = h;
3230 pt->next = p->patterns;
3231 p->patterns = pt;
3232}
3233
3234static void nsvg__parseSVG(NSVGparser* p, const char** attr)
3235{

Callers 1

nsvg__startElementFunction · 0.85

Calls 8

nsvg__getAttrFunction · 0.85
nsvg__parseCoordinateFunction · 0.85
nsvg__actualWidthFunction · 0.85
nsvg__actualHeightFunction · 0.85
nsvg__parseAttrFunction · 0.85
AsciiStrCpySFunction · 0.85
strcmpFunction · 0.50
AllocateZeroPoolFunction · 0.50

Tested by

no test coverage detected