Go to most recent revision | Details | 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; |
||
26 | |||
27 | |||
28 | (height == 0) || (height > 2048)|| |
||
29 | (format != PICT_a8r8g8b8)) |
||
30 | return NULL; |
||
31 | |||
32 | |||
33 | |||
34 | |||
35 | { |
||
36 | void *raw; |
||
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) ) |
||
46 | { |
||
47 | ioctl_t io; |
||
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 | |||
55 | |||
56 | return pixmap; |
||
57 | else |
||
58 | { |
||
59 | free_pixmap(pixmap) ; |
||
60 | return NULL; |
||
61 | } |
||
62 | } |
||
63 | else |
||
64 | { |
||
65 | /* |
||
66 | Only system memory |
||
67 | */ |
||
68 | pixmap->flags &= ~PX_MEM_MASK; |
||
69 | |||
70 | |||
71 | raw = UserAlloc(pitch * height); |
||
72 | |||
73 | |||
74 | { |
||
75 | free_pixmap(pixmap); |
||
76 | return NULL; |
||
77 | }; |
||
78 | pixmap->pitch = pitch; |
||
79 | pixmap->mapped = raw; |
||
80 | }; |
||
81 | return pixmap; |
||
82 | }; |
||
83 | return NULL; |
||
84 | }; |
||
85 | |||
86 | |||
87 | { |
||
88 | int retval = ERR_OK; |
||
89 | |||
90 | |||
91 | return ERR_PARAM; |
||
92 | |||
93 | |||
94 | ( (pixmap->flags & PX_MEM_MASK)==PX_MEM_LOCAL) ) |
||
95 | { |
||
96 | int retval; |
||
97 | |||
98 | |||
99 | io.handle = srv_hw2d; |
||
100 | io.io_code = PX_DESTROY; |
||
101 | io.input = pixmap; |
||
102 | io.inp_size = 7; |
||
103 | io.output = NULL; |
||
104 | io.out_size = 0; |
||
105 | |||
106 | |||
107 | } |
||
108 | else |
||
109 | { |
||
110 | UserFree(pixmap->mapped); |
||
111 | |||
112 | |||
113 | pixmap->mapped = 0; |
||
114 | pixmap->handle = 0; |
||
115 | }; |
||
116 | free_pixmap(pixmap); |
||
117 | |||
118 | |||
119 | }; |
||
120 | |||
121 | |||
122 | { |
||
123 | if(pixmap == (pixmap_t*)-1) |
||
124 | return scrn_pixmap.mapped; |
||
125 | else |
||
126 | return pixmap->mapped; |
||
127 | } |
||
128 | |||
129 | |||
130 | { |
||
131 | return ERR_OK; |
||
132 | }; |
||
133 | |||
134 | |||
135 | { |
||
136 | if(pixmap == (pixmap_t*)-1) |
||
137 | return scrn_pixmap.pitch; |
||
138 | else |
||
139 | return pixmap->pitch; |
||
140 | }; |
||
141 |