@@ -27,6 +27,9 @@ TestTextToGraphics32Reversed
2727TestTextToGraphics32Mirrored
2828TestTextToGraphics32Flipped
2929TestTextToGraphics32Clipping
30+ TestGraphicsToGraphics32ViewClip
31+ TestGraphicsToGraphics32WindowNoScale
32+ TestGraphicsToGraphics32SourceViewClip
3033
3134TestTextToGraphics8Basic
3235TestTextToGraphics8Mirrored
@@ -135,6 +138,18 @@ SUB PrepareGraphicsDestination32 (img AS LONG)
135138 _DEST oldDest
136139END SUB
137140
141+ SUB PrepareGraphicsSource32 (img AS LONG )
142+ DIM oldDest AS LONG : oldDest = _DEST
143+
144+ _DEST img
145+ CLS , _RGB32 (0 , 0 , 0 )
146+ LINE (0 , 0 )-(_WIDTH (img ) - 1 , _HEIGHT (img ) - 1 ), _RGB32 (255 , 64 , 32 ), BF
147+ LINE (8 , 8 )-(_WIDTH (img ) - 9 , _HEIGHT (img ) - 9 ), _RGB32 (32 , 192 , 255 ), BF
148+ LINE (16 , 16 )-(_WIDTH (img ) - 17 , _HEIGHT (img ) - 17 ), _RGB32 (255 , 255 , 64 ), BF
149+
150+ _DEST oldDest
151+ END SUB
152+
138153SUB PrepareGraphicsDestinationIndexed (img AS LONG )
139154 DIM oldDest AS LONG
140155 oldDest = _DEST
@@ -536,6 +551,80 @@ SUB TestTextToGraphics32Clipping
536551 _FREEIMAGE dst
537552END SUB
538553
554+ SUB TestGraphicsToGraphics32ViewClip
555+ DIM src AS LONG : src = _NEWIMAGE (80 , 80 , 32 )
556+ PrepareGraphicsSource32 src
557+ DIM dst AS LONG : dst = _NEWIMAGE (320 , 200 , 32 )
558+ PrepareGraphicsDestination32 dst
559+
560+ _DEST dst
561+ VIEW (40 , 40 )-(99 , 99 )
562+ _PUTIMAGE (0 , 0 ), src , dst
563+ VIEW
564+ ' _SAVEIMAGE "TestGraphicsToGraphics32ViewClip", dst
565+
566+ DIM ok AS _BYTE : ok = _TRUE
567+ IF CountNonBlack32 (dst , 40 , 40 , 99 , 99 ) <= 0 THEN ok = _FALSE
568+ IF CountNonBlackOutsideRect32 (dst , 40 , 40 , 99 , 99 ) <> 0 THEN ok = _FALSE
569+ IF Pixel32 (dst , 40 , 40 ) <> _RGB32 (255 , 64 , 32 ) THEN ok = _FALSE
570+ IF Pixel32 (dst , 48 , 48 ) <> _RGB32 (32 , 192 , 255 ) THEN ok = _FALSE
571+ IF Pixel32 (dst , 56 , 56 ) <> _RGB32 (255 , 255 , 64 ) THEN ok = _FALSE
572+ IF Pixel32 (dst , 99 , 99 ) <> _RGB32 (255 , 255 , 64 ) THEN ok = _FALSE
573+
574+ ReportCheck " graphics->graphics 32bpp VIEW clip" , ok
575+ _FREEIMAGE dst
576+ _FREEIMAGE src
577+ END SUB
578+
579+ SUB TestGraphicsToGraphics32WindowNoScale
580+ DIM src AS LONG : src = _NEWIMAGE (80 , 80 , 32 )
581+ PrepareGraphicsSource32 src
582+ DIM dst AS LONG : dst = _NEWIMAGE (320 , 200 , 32 )
583+ PrepareGraphicsDestination32 dst
584+ DIM ref AS LONG : ref = _NEWIMAGE (320 , 200 , 32 )
585+ PrepareGraphicsDestination32 ref
586+
587+ _PUTIMAGE (80 , 80 ), src , ref
588+
589+ _DEST dst
590+ VIEW (40 , 40 )-(199 , 199 )
591+ WINDOW SCREEN (0 , 0 )-(159 , 159 )
592+ _PUTIMAGE (40 , 40 ), src , dst
593+ WINDOW
594+ VIEW
595+ ' _SAVEIMAGE "TestGraphicsToGraphics32WindowNoScale", dst
596+
597+ DIM ok AS _BYTE : ok = _TRUE
598+ IF RegionsEqual32 (ref , 80 , 80 , dst , 80 , 80 , 80 , 80 , 1 , 1 ) = _FALSE THEN ok = _FALSE
599+ IF CountNonBlackOutsideRect32 (dst , 80 , 80 , 159 , 159 ) <> 0 THEN ok = _FALSE
600+
601+ ReportCheck " graphics->graphics 32bpp WINDOW" , ok
602+ _FREEIMAGE ref
603+ _FREEIMAGE dst
604+ _FREEIMAGE src
605+ END SUB
606+
607+ SUB TestGraphicsToGraphics32SourceViewClip
608+ DIM src AS LONG : src = _NEWIMAGE (80 , 80 , 32 )
609+ PrepareGraphicsSource32 src
610+ DIM dst AS LONG : dst = _NEWIMAGE (320 , 200 , 32 )
611+ PrepareGraphicsDestination32 dst
612+
613+ _DEST src
614+ VIEW (20 , 20 )-(59 , 59 )
615+ _PUTIMAGE (30 , 30 ), src , dst
616+ VIEW
617+ ' _SAVEIMAGE "TestGraphicsToGraphics32SourceViewClip", dst
618+
619+ DIM ok AS _BYTE : ok = _TRUE
620+ IF CountNonBlack32 (dst , 50 , 50 , 89 , 89 ) <= 0 THEN ok = _FALSE
621+ IF CountNonBlackOutsideRect32 (dst , 50 , 50 , 89 , 89 ) <> 0 THEN ok = _FALSE
622+
623+ ReportCheck " graphics->graphics 32bpp source VIEW" , ok
624+ _FREEIMAGE dst
625+ _FREEIMAGE src
626+ END SUB
627+
539628SUB TestTextToGraphics8Basic
540629 DIM dst AS LONG : dst = _NEWIMAGE (320 , 200 , 256 )
541630 PrepareGraphicsDestinationIndexed dst
0 commit comments