From ee2b479b197375e850a52fb8d259be0464c6b915 Mon Sep 17 00:00:00 2001 From: Slice Date: Thu, 20 Jul 2023 20:25:33 +0300 Subject: [PATCH] revert ventura, cleanup Signed-off-by: Slice --- .../CloverV2/themespkg/cesium/theme.svg | 18 +----- rEFIt_UEFI/libeg/VectorGraphics.cpp | 57 +++---------------- 2 files changed, 11 insertions(+), 64 deletions(-) diff --git a/CloverPackage/CloverV2/themespkg/cesium/theme.svg b/CloverPackage/CloverV2/themespkg/cesium/theme.svg index 0b4fd786cf..5bccc5eabb 100644 --- a/CloverPackage/CloverV2/themespkg/cesium/theme.svg +++ b/CloverPackage/CloverV2/themespkg/cesium/theme.svg @@ -2806,18 +2806,6 @@ Created="December 2018"/> .syvol3{fill:#FFFFFF;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;} .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_);} - @@ -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 - - + - + image; // полное изображение темы + SVGimage = p->image; // full theme SVG image NSVGshape *shape; NSVGgroup *group; - NSVGimage *IconImage; // отдельная иконка, которую нужно выделить из общей кучи + NSVGimage *IconImage; // separate SVG image NSVGshape *shapeNext, *shapesTail = NULL, *shapePrev; NSVGparser* p2 = nsvg__createParser(); @@ -72,7 +72,7 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage* IconImage->clip.count = 0; shape = SVGimage->shapes; shapePrev = NULL; -// int ClipCount = 0; + while (shape) { group = shape->group; shapeNext = shape->next; @@ -98,7 +98,6 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage* IconImage->clip.count++; } - if (BootCampStyle && IconNameX.contains("selection_big")) { shape->opacity = 0.f; } @@ -129,8 +128,6 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage* } shape = shapeNext; continue; //while(shape) it is BoundingRect shape - -// shape->opacity = 0.3f; } shape->flags = NSVG_VIS_VISIBLE; // Add to tail @@ -146,42 +143,16 @@ EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage* else { SVGimage->shapes = shapeNext; } -// shapePrev->next = shapeNext; //already done or null pointer } //the shape in the group else { shapePrev = shape; } -// ClipCount += shape->clip.count; shape = shapeNext; } //while shape 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]; nsvg__imageBounds(IconImage, bounds); @@ -466,8 +437,7 @@ INTN renderSVGtext(XImage* TextBufferXY_ptr, INTN posX, INTN posY, INTN textType { XImage& TextBufferXY = *TextBufferXY_ptr; INTN Width; -// UINTN i; -// UINTN len; + NSVGparser* p; NSVGrasterizer* rast; if (!textFace[textType].valid) { @@ -625,16 +595,7 @@ void testSVG() p = nsvgParse((CHAR8*)FileData, 72, 1.f); SVGimage = p->image; 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 XImage NewImage(Width, Height); if (SVGimage->width <= 0) SVGimage->width = (float)Width; @@ -672,7 +633,7 @@ void testSVG() DBG("font not parsed\n"); break; } -// NSVGfont* fontSVG = p->font; + textFace[3].font = p->font; textFace[3].color = NSVG_RGBA(0x80, 0xFF, 0, 255); textFace[3].size = Height;