@@ -45,6 +45,7 @@ from The Open Group.
45
45
#include "gcstruct.h"
46
46
#include "input.h"
47
47
#include "mipointer.h"
48
+ #include "micmap.h"
48
49
#include <sys/types.h>
49
50
#ifdef HAS_MMAP
50
51
#include <sys/mman.h>
@@ -64,7 +65,6 @@ from The Open Group.
64
65
#endif /* HAS_SHM */
65
66
#include "dix.h"
66
67
#include "miline.h"
67
- #include "mfb.h"
68
68
69
69
#define VFB_DEFAULT_WIDTH 1280
70
70
#define VFB_DEFAULT_HEIGHT 1024
@@ -442,60 +442,6 @@ GetTimeInMillis()
442
442
}
443
443
#endif
444
444
445
-
446
- static Bool
447
- vfbMultiDepthCreateGC (GCPtr pGC )
448
- {
449
- switch (vfbBitsPerPixel (pGC -> depth ))
450
- {
451
- case 1 : return mfbCreateGC (pGC );
452
- case 8 :
453
- case 16 :
454
- case 32 : return fbCreateGC (pGC );
455
- default : return FALSE;
456
- }
457
- }
458
-
459
- static void
460
- vfbMultiDepthGetSpans (
461
- DrawablePtr pDrawable , /* drawable from which to get bits */
462
- int wMax , /* largest value of all *pwidths */
463
- register DDXPointPtr ppt , /* points to start copying from */
464
- int * pwidth , /* list of number of bits to copy */
465
- int nspans , /* number of scanlines to copy */
466
- char * pdstStart ) /* where to put the bits */
467
- {
468
- switch (pDrawable -> bitsPerPixel ) {
469
- case 1 :
470
- mfbGetSpans (pDrawable , wMax , ppt , pwidth , nspans , pdstStart );
471
- break ;
472
- case 8 :
473
- case 16 :
474
- case 32 :
475
- fbGetSpans (pDrawable , wMax , ppt , pwidth , nspans , pdstStart );
476
- break ;
477
- }
478
- return ;
479
- }
480
-
481
- static void
482
- vfbMultiDepthGetImage (DrawablePtr pDrawable , int sx , int sy , int w , int h ,
483
- unsigned int format , unsigned long planeMask ,
484
- char * pdstLine )
485
- {
486
- switch (pDrawable -> bitsPerPixel )
487
- {
488
- case 1 :
489
- mfbGetImage (pDrawable , sx , sy , w , h , format , planeMask , pdstLine );
490
- break ;
491
- case 8 :
492
- case 16 :
493
- case 32 :
494
- fbGetImage (pDrawable , sx , sy , w , h , format , planeMask , pdstLine );
495
- break ;
496
- }
497
- }
498
-
499
445
static ColormapPtr InstalledMaps [MAXSCREENS ];
500
446
501
447
static int
@@ -922,39 +868,38 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
922
868
pbits = vfbAllocateFramebufferMemory (pvfb );
923
869
if (!pbits ) return FALSE;
924
870
925
- /* miSetPixmapDepths ();*/
871
+ miSetPixmapDepths ();
926
872
927
- switch (pvfb -> bitsPerPixel )
928
- {
929
- case 1 :
930
- ret = mfbScreenInit (pScreen , pbits , pvfb -> width , pvfb -> height ,
931
- dpix , dpiy , pvfb -> paddedWidth );
873
+ switch (pvfb -> depth ) {
874
+ case 15 :
875
+ miSetVisualTypesAndMasks (15 , (1 << TrueColor ), 8 , TrueColor ,
876
+ 0x7c00 , 0x03e0 , 0x001f );
932
877
break ;
933
- case 8 :
934
878
case 16 :
935
- case 32 :
936
- ret = fbScreenInit (pScreen , pbits , pvfb -> width , pvfb -> height ,
937
- dpix , dpiy , pvfb -> paddedWidth ,pvfb -> bitsPerPixel );
938
- #ifdef RENDER
939
- if (ret && Render )
940
- fbPictureInit (pScreen , 0 , 0 );
941
- #endif
879
+ miSetVisualTypesAndMasks (16 , (1 << TrueColor ), 8 , TrueColor ,
880
+ 0xf800 , 0x07e0 , 0x001f );
881
+ break ;
882
+ case 24 :
883
+ miSetVisualTypesAndMasks (24 , (1 << TrueColor ), 8 , TrueColor ,
884
+ 0xff0000 , 0x00ff00 , 0x0000ff );
942
885
break ;
943
- default :
944
- return FALSE;
945
886
}
887
+
888
+ ret = fbScreenInit (pScreen , pbits , pvfb -> width , pvfb -> height ,
889
+ dpix , dpiy , pvfb -> paddedWidth ,pvfb -> bitsPerPixel );
890
+ #ifdef RENDER
891
+ if (ret && Render )
892
+ fbPictureInit (pScreen , 0 , 0 );
893
+ #endif
946
894
947
895
if (!ret ) return FALSE;
948
896
949
- miInitializeBackingStore (pScreen );
897
+ /* miInitializeBackingStore(pScreen); */
950
898
951
899
/*
952
900
* Circumvent the backing store that was just initialised. This amounts
953
901
* to a truely bizarre way of initialising SaveDoomedAreas and friends.
954
902
*/
955
- pScreen -> CreateGC = vfbMultiDepthCreateGC ;
956
- pScreen -> GetImage = vfbMultiDepthGetImage ;
957
- pScreen -> GetSpans = vfbMultiDepthGetSpans ;
958
903
959
904
pScreen -> InstallColormap = vfbInstallColormap ;
960
905
pScreen -> UninstallColormap = vfbUninstallColormap ;
@@ -970,14 +915,7 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
970
915
pScreen -> blackPixel = pvfb -> blackPixel ;
971
916
pScreen -> whitePixel = pvfb -> whitePixel ;
972
917
973
- if (pvfb -> bitsPerPixel == 1 )
974
- {
975
- ret = mfbCreateDefColormap (pScreen );
976
- }
977
- else
978
- {
979
- ret = fbCreateDefColormap (pScreen );
980
- }
918
+ ret = fbCreateDefColormap (pScreen );
981
919
982
920
miSetZeroLineBias (pScreen , pvfb -> lineBias );
983
921
@@ -1008,7 +946,7 @@ InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
1008
946
vfbPixmapDepths [1 ] = TRUE;
1009
947
vfbPixmapDepths [4 ] = TRUE;
1010
948
vfbPixmapDepths [8 ] = TRUE;
1011
- vfbPixmapDepths [15 ] = TRUE;
949
+ /* vfbPixmapDepths[15] = TRUE; */
1012
950
vfbPixmapDepths [16 ] = TRUE;
1013
951
vfbPixmapDepths [24 ] = TRUE;
1014
952
vfbPixmapDepths [32 ] = TRUE;
0 commit comments