revert ventura, cleanup

Signed-off-by: Slice <sergey.slice@gmail.com>
This commit is contained in:
Slice 2023-07-20 20:25:33 +03:00
parent 5fb19df839
commit ee2b479b19
2 changed files with 11 additions and 64 deletions

View File

@ -2806,18 +2806,6 @@ Created="December 2018"/>
.syvol3{fill:#FFFFFF;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;} .syvol3{fill:#FFFFFF;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;}
.st409{fill:#F70606;stroke:none} .st409{fill:#F70606;stroke:none}
.st201v{fill:url(#SVGIDv_2_);}
.st202v{clip-path:url(#SVGIDv_4_);fill:url(#SVGIDv_5_);}
.st203v{clip-path:url(#SVGIDv_4_);}
.st204v{clip-path:url(#SVGIDv_8_);fill:url(#SVGIDv_9_);}
.st205v{clip-path:url(#SVGIDv_8_);fill:url(#SVGIDv_10_);}
.st206v{clip-path:url(#SVGIDv_8_);fill:url(#SVGIDv_11_);}
.st207v{clip-path:url(#SVGIDv_8_);fill:url(#SVGIDv_12_);}
.st208v{clip-path:url(#SVGIDv_4_);fill:url(#SVGIDv_13_);}
.st209v{clip-path:url(#SVGIDv_4_);fill:url(#SVGIDv_14_);}
.st210v{clip-path:url(#SVGIDv_4_);fill:url(#SVGIDv_15_);stroke:#FB8C3B;stroke-width:0.25;stroke-miterlimit:10;}
.st211v{clip-path:url(#SVGIDv_4_);fill:url(#SVGIDv_16_);}
</style> </style>
<font horiz-adv-x="2048"> <font horiz-adv-x="2048">
@ -3568,7 +3556,7 @@ d="M503 939l-34 -741q0 -1 -3 -1h-88q-3 0 -3 1l-37 741l-6 664q0 1 3 1h170q3 0 3 -
</g> </g>
</g> </g>
<g id="os_lion" transform="translate(1220, 800)"> <g id="os_ventura" transform="translate(1220, 800)">
<rect <rect
height="160" height="160"
width="160" width="160"
@ -3583,7 +3571,6 @@ d="M503 939l-34 -741q0 -1 -3 -1h-88q-3 0 -3 1l-37 741l-6 664q0 1 3 1h170q3 0 3 -
x="-72.5" x="-72.5"
y="-72.5" y="-72.5"
style="overflow:visible" style="overflow:visible"
id="use880" transform="matrix(1.0241 0 0 1.023 0 0)" /> id="use880" transform="matrix(1.0241 0 0 1.023 0 0)" />
<g id="vent1" transform="matrix(0.446 0 0 0.446 -95 -83)"> <g id="vent1" transform="matrix(0.446 0 0 0.446 -95 -83)">
@ -3631,7 +3618,6 @@ d="M503 939l-34 -741q0 -1 -3 -1h-88q-3 0 -3 1l-37 741l-6 664q0 1 3 1h170q3 0 3 -
id="stop896" /> id="stop896" />
</radialGradient> </radialGradient>
<circle <circle
class="st201v"
cx="215.39999" cx="215.39999"
cy="186.60001" cy="186.60001"
r="146" r="146"

Before

Width:  |  Height:  |  Size: 375 KiB

After

Width:  |  Height:  |  Size: 375 KiB

View File

@ -61,10 +61,10 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage*
NSVGimage *SVGimage; NSVGimage *SVGimage;
NSVGparser *p = (NSVGparser *)SVGParser; NSVGparser *p = (NSVGparser *)SVGParser;
NSVGrasterizer* rast = nsvgCreateRasterizer(); NSVGrasterizer* rast = nsvgCreateRasterizer();
SVGimage = p->image; // полное изображение темы SVGimage = p->image; // full theme SVG image
NSVGshape *shape; NSVGshape *shape;
NSVGgroup *group; NSVGgroup *group;
NSVGimage *IconImage; // отдельная иконка, которую нужно выделить из общей кучи NSVGimage *IconImage; // separate SVG image
NSVGshape *shapeNext, *shapesTail = NULL, *shapePrev; NSVGshape *shapeNext, *shapesTail = NULL, *shapePrev;
NSVGparser* p2 = nsvg__createParser(); NSVGparser* p2 = nsvg__createParser();
@ -72,7 +72,7 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage*
IconImage->clip.count = 0; IconImage->clip.count = 0;
shape = SVGimage->shapes; shape = SVGimage->shapes;
shapePrev = NULL; shapePrev = NULL;
// int ClipCount = 0;
while (shape) { while (shape) {
group = shape->group; group = shape->group;
shapeNext = shape->next; shapeNext = shape->next;
@ -98,7 +98,6 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage*
IconImage->clip.count++; IconImage->clip.count++;
} }
if (BootCampStyle && IconNameX.contains("selection_big")) { if (BootCampStyle && IconNameX.contains("selection_big")) {
shape->opacity = 0.f; shape->opacity = 0.f;
} }
@ -129,8 +128,6 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage*
} }
shape = shapeNext; shape = shapeNext;
continue; //while(shape) it is BoundingRect shape continue; //while(shape) it is BoundingRect shape
// shape->opacity = 0.3f;
} }
shape->flags = NSVG_VIS_VISIBLE; shape->flags = NSVG_VIS_VISIBLE;
// Add to tail // Add to tail
@ -146,42 +143,16 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage*
else { else {
SVGimage->shapes = shapeNext; SVGimage->shapes = shapeNext;
} }
// shapePrev->next = shapeNext; //already done or null pointer
} //the shape in the group } //the shape in the group
else { else {
shapePrev = shape; shapePrev = shape;
} }
// ClipCount += shape->clip.count;
shape = shapeNext; shape = shapeNext;
} //while shape } //while shape
shapesTail->next = NULL; shapesTail->next = NULL;
//add clipPaths //xxx
// NSVGclipPath* clipPaths = SVGimage->clipPaths;
// NSVGclipPath* clipNext = NULL;
// while (clipPaths) {
// ClipCount += clipPaths->shapes->clip.count;
// if (!clipPaths->shapes) {
// break;
// }
// group = clipPaths->shapes->group;
// clipNext = clipPaths->next;
// while (group) {
// if (IconNameX == XString8().takeValueFrom(group->id)) {
// break;
// }
// group = group->parent;
// }
// if (group) {
// DBG("found clipPath for %s\n", IconNameX.c_str());
// IconImage->clipPaths = (NSVGclipPath*)AllocateCopyPool(sizeof(NSVGclipPath), SVGimage->clipPaths);
// break;
// }
// clipPaths = clipNext;
// }
// DBG("found %d clips for %s\n", IconImage->clip.count, IconNameX.c_str());
// if (IconImage->clip.count) { //Id == BUILTIN_ICON_BANNER) {
IconImage->clipPaths = SVGimage->clipPaths; IconImage->clipPaths = SVGimage->clipPaths;
// }
float bounds[4]; float bounds[4];
nsvg__imageBounds(IconImage, bounds); nsvg__imageBounds(IconImage, bounds);
@ -466,8 +437,7 @@ INTN renderSVGtext(XImage* TextBufferXY_ptr, INTN posX, INTN posY, INTN textType
{ {
XImage& TextBufferXY = *TextBufferXY_ptr; XImage& TextBufferXY = *TextBufferXY_ptr;
INTN Width; INTN Width;
// UINTN i;
// UINTN len;
NSVGparser* p; NSVGparser* p;
NSVGrasterizer* rast; NSVGrasterizer* rast;
if (!textFace[textType].valid) { if (!textFace[textType].valid) {
@ -625,16 +595,7 @@ void testSVG()
p = nsvgParse((CHAR8*)FileData, 72, 1.f); p = nsvgParse((CHAR8*)FileData, 72, 1.f);
SVGimage = p->image; SVGimage = p->image;
DBG("Test image width=%d heigth=%d\n", (int)(SVGimage->width), (int)(SVGimage->height)); DBG("Test image width=%d heigth=%d\n", (int)(SVGimage->width), (int)(SVGimage->height));
// FreePool(FileData);
/*
if (p->patterns && p->patterns->image) {
BltImageAlpha((EG_IMAGE*)(p->patterns->image),
40,
40,
&MenuBackgroundPixel,
16);
}
*/
// Rasterize // Rasterize
XImage NewImage(Width, Height); XImage NewImage(Width, Height);
if (SVGimage->width <= 0) SVGimage->width = (float)Width; if (SVGimage->width <= 0) SVGimage->width = (float)Width;
@ -672,7 +633,7 @@ void testSVG()
DBG("font not parsed\n"); DBG("font not parsed\n");
break; break;
} }
// NSVGfont* fontSVG = p->font;
textFace[3].font = p->font; textFace[3].font = p->font;
textFace[3].color = NSVG_RGBA(0x80, 0xFF, 0, 255); textFace[3].color = NSVG_RGBA(0x80, 0xFF, 0, 255);
textFace[3].size = Height; textFace[3].size = Height;