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

Function testSVG

rEFIt_UEFI/libeg/VectorGraphics.cpp:541–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541VOID testSVG()
542{
543 do {
544
545 EFI_STATUS Status;
546 UINT8 *FileData = NULL;
547 UINTN FileDataLength = 0;
548
549 INTN Width = 400, Height = 400;
550
551#if TEST_MATH
552 //Test mathematique
553//#define fabsf(x) ((x >= 0.0f)?x:(-x))
554#define pr(x) (int)fabsf(x), (int)fabsf((x - (int)x) * 1000000.0f)
555 int i;
556 float x, y1, y2;
557 // CHAR8 Str[128];
558 DBG("Test float: -%d.%06d\n", pr(-0.7612f));
559 for (i=0; i<15; i++) {
560 x=(PI)/30.0f*i;
561 y1=SinF(x);
562 y2=CosF(x);
563
564 DBG("x=%d: %d.%06d ", i*6, pr(x));
565 DBG(" sinx=%c%d.%06d", (y1<0)?'-':' ', pr(y1));
566 DBG(" cosx=%c%d.%06d\n", (y2<0)?'-':' ',pr(y2));
567 y1 = Atan2F(y1, y2);
568 DBG(" atan2x=%c%d.%06d", (y1<0)?'-':' ',pr(y1));
569 y1 = AcosF(y2);
570 DBG(" acos=%c%d.%06d", (y1<0)?'-':' ',pr(y1));
571 y1 = SqrtF(x);
572 DBG(" sqrt=%d.%06d", pr(y1));
573 y1 = CeilF(x);
574 DBG(" ceil=%c%d.%06d\n", (y1<0)?'-':' ',pr(y1));
575 }
576#undef pr
577#endif
578 NSVGparser* p;
579#if TEST_DITHER
580 {
581 EG_IMAGE *RndImage = egCreateImage(256, 256, FALSE);
582 INTN i,j;
583 EG_PIXEL pixel = WhitePixel;
584 for (i=0; i<256; i++) {
585 for (j=0; j<256; j++) {
586 pixel.b = 0x40 + (dither((float)j / 32.0f, 1) * 8);
587 pixel.r = 0x0;
588 pixel.g = 0x0;
589// if (i==1) {
590// DBG("r=%X g=%X\n", pixel.r, pixel.g);
591// }
592 RndImage->PixelData[i * 256 + j] = pixel;
593 }
594 }
595
596 BltImageAlpha(RndImage,
597 20,
598 20,

Callers

nothing calls this directly

Calls 15

SinFFunction · 0.85
CosFFunction · 0.85
Atan2FFunction · 0.85
AcosFFunction · 0.85
SqrtFFunction · 0.85
CeilFFunction · 0.85
egCreateImageFunction · 0.85
ditherFunction · 0.85
nsvgCreateRasterizerFunction · 0.85
egLoadFileFunction · 0.85
nsvgParseFunction · 0.85
nsvgRasterizeFunction · 0.85

Tested by

no test coverage detected