Rev 882 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
882 | serge | 1 | |
2 | { |
||
3 | if( px_slab.available ) |
||
4 | { |
||
5 | pixmap_t *pixmap; |
||
6 | |||
7 | |||
8 | pixmap = (pixmap_t*)px_slab.nextavail; |
||
9 | px_slab.nextavail = *(void**)pixmap; |
||
10 | |||
11 | |||
12 | } |
||
13 | return NULL; |
||
14 | }; |
||
15 | |||
16 | |||
17 | { |
||
18 | *(void**)pixmap = px_slab.nextavail; |
||
19 | px_slab.nextavail = pixmap; |
||
20 | px_slab.available++; |
||
21 | }; |
||
22 | |||
23 | |||
24 | { |
||
25 | pixmap_t *pixmap; |
||
1002 | serge | 26 | |
882 | serge | 27 | |
1002 | serge | 28 | (height == 0) || (height > 2048)|| |
29 | (format != PICT_a8r8g8b8)) |
||
30 | return NULL; |
||
882 | serge | 31 | |
32 | |||
1002 | serge | 33 | |
882 | serge | 34 | |
1002 | serge | 35 | { |
36 | void *raw; |
||
882 | serge | 37 | int pitch; |
38 | |||
39 | |||
40 | pixmap->height = height; |
||
41 | pixmap->format = format; |
||
42 | pixmap->flags = flags; |
||
43 | |||
44 | |||
45 | ( (flags & PX_MEM_MASK)==PX_MEM_LOCAL) ) |
||
1002 | serge | 46 | { |
882 | serge | 47 | ioctl_t io; |
1002 | serge | 48 | io.handle = srv_hw2d; |
49 | io.io_code = PX_CREATE; |
||
50 | io.input = pixmap; |
||
51 | io.inp_size = 7; |
||
52 | io.output = NULL; |
||
53 | io.out_size = 0; |
||
54 | |||
882 | serge | 55 | |
1002 | serge | 56 | return pixmap; |
57 | else{ |
||
58 | free_pixmap(pixmap) ; |
||
59 | return NULL; |
||
60 | } |
||
61 | } |
||
882 | serge | 62 | else |
63 | { |
||
1002 | serge | 64 | /* |
882 | serge | 65 | Only system memory |
66 | */ |
||
67 | pixmap->flags &= ~PX_MEM_MASK; |
||
1002 | serge | 68 | |
882 | serge | 69 | |
1002 | serge | 70 | raw = UserAlloc(pitch * height); |
71 | |||
882 | serge | 72 | |
1002 | serge | 73 | free_pixmap(pixmap); |
74 | return NULL; |
||
75 | }; |
||
76 | pixmap->pitch = pitch; |
||
77 | pixmap->mapped = raw; |
||
78 | }; |
||
882 | serge | 79 | return pixmap; |
1002 | serge | 80 | }; |
81 | return NULL; |
||
82 | }; |
||
882 | serge | 83 | |
84 | |||
85 | { |
||
86 | int retval = ERR_OK; |
||
87 | |||
88 | |||
89 | return ERR_PARAM; |
||
90 | |||
91 | |||
92 | ( (pixmap->flags & PX_MEM_MASK)==PX_MEM_LOCAL) ) |
||
93 | { |
||
94 | int retval; |
||
95 | |||
96 | |||
97 | io.handle = srv_hw2d; |
||
98 | io.io_code = PX_DESTROY; |
||
99 | io.input = pixmap; |
||
100 | io.inp_size = 7; |
||
101 | io.output = NULL; |
||
102 | io.out_size = 0; |
||
103 | |||
104 | |||
105 | } |
||
106 | else |
||
107 | { |
||
108 | UserFree(pixmap->mapped); |
||
109 | |||
110 | |||
111 | pixmap->mapped = 0; |
||
112 | pixmap->handle = 0; |
||
113 | }; |
||
114 | free_pixmap(pixmap); |
||
115 | |||
116 | |||
117 | }; |
||
118 | |||
119 | |||
120 | { |
||
121 | if(pixmap == (pixmap_t*)-1) |
||
122 | return scrn_pixmap.mapped; |
||
123 | else |
||
124 | return pixmap->mapped; |
||
125 | } |
||
126 | |||
127 | |||
128 | { |
||
129 | return ERR_OK; |
||
130 | }; |
||
131 | |||
132 | |||
133 | { |
||
134 | if(pixmap == (pixmap_t*)-1) |
||
135 | return scrn_pixmap.pitch; |
||
136 | else |
||
137 | return pixmap->pitch; |
||
138 | }; |
||
139 |