Deleted Added
full compact
bitmap.c (66834) bitmap.c (70991)
1/*-
2 * Copyright (c) 1991-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1991-1997 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/lib/libvgl/bitmap.c 66834 2000-10-08 21:34:00Z phk $
28 * $FreeBSD: head/lib/libvgl/bitmap.c 70991 2001-01-13 11:30:17Z nsouch $
29 */
30
31#include <sys/types.h>
32#include <signal.h>
33#include <sys/fbio.h>
34#include "vgl.h"
35
36#define min(x, y) (((x) < (y)) ? (x) : (y))

--- 101 unchanged lines hidden (view full) ---

138 offset = VGLSetSegment(pos);
139 i = min(VGLAdpInfo.va_window_size - offset, width);
140 bcopy(line, dst->Bitmap + offset, i);
141 line += i;
142 pos += i;
143 width -= i;
144 }
145 break;
29 */
30
31#include <sys/types.h>
32#include <signal.h>
33#include <sys/fbio.h>
34#include "vgl.h"
35
36#define min(x, y) (((x) < (y)) ? (x) : (y))

--- 101 unchanged lines hidden (view full) ---

138 offset = VGLSetSegment(pos);
139 i = min(VGLAdpInfo.va_window_size - offset, width);
140 bcopy(line, dst->Bitmap + offset, i);
141 line += i;
142 pos += i;
143 width -= i;
144 }
145 break;
146 case VIDBUF16S:
147 case VIDBUF24S:
148 case VIDBUF32S:
149 width = width * dst->PixelBytes;
150 pos = (dst->VXsize * y + x) * dst->PixelBytes;
151 while (width > 0) {
152 offset = VGLSetSegment(pos);
153 i = min(VGLAdpInfo.va_window_size - offset, width);
154 bcopy(line, dst->Bitmap + offset, i);
155 line += i;
156 pos += i;
157 width -= i;
158 }
159 break;
146 case VIDBUF8:
147 case MEMBUF:
148 address = dst->Bitmap + dst->VXsize * y + x;
149 bcopy(line, address, width);
150 break;
160 case VIDBUF8:
161 case MEMBUF:
162 address = dst->Bitmap + dst->VXsize * y + x;
163 bcopy(line, address, width);
164 break;
151
165 case VIDBUF16:
166 case VIDBUF24:
167 case VIDBUF32:
168 address = dst->Bitmap + (dst->VXsize * y + x) * dst->PixelBytes;
169 bcopy(line, address, width * dst->PixelBytes);
170 break;
152 default:
153 }
154}
155
156static void
157ReadVerticalLine(VGLBitmap *src, int x, int y, int width, byte *line)
158{
159 int i, bit, pos, count, planepos, start_offset, end_offset, offset;

--- 73 unchanged lines hidden (view full) ---

233 offset = VGLSetSegment(pos);
234 i = min(VGLAdpInfo.va_window_size - offset, width);
235 bcopy(src->Bitmap + offset, line, i);
236 line += i;
237 pos += i;
238 width -= i;
239 }
240 break;
171 default:
172 }
173}
174
175static void
176ReadVerticalLine(VGLBitmap *src, int x, int y, int width, byte *line)
177{
178 int i, bit, pos, count, planepos, start_offset, end_offset, offset;

--- 73 unchanged lines hidden (view full) ---

252 offset = VGLSetSegment(pos);
253 i = min(VGLAdpInfo.va_window_size - offset, width);
254 bcopy(src->Bitmap + offset, line, i);
255 line += i;
256 pos += i;
257 width -= i;
258 }
259 break;
260 case VIDBUF16S:
261 case VIDBUF24S:
262 case VIDBUF32S:
263 width = width * src->PixelBytes;
264 pos = (src->VXsize * y + x) * src->PixelBytes;
265 while (width > 0) {
266 offset = VGLSetSegment(pos);
267 i = min(VGLAdpInfo.va_window_size - offset, width);
268 bcopy(src->Bitmap + offset, line, i);
269 line += i;
270 pos += i;
271 width -= i;
272 }
273 break;
241 case VIDBUF8:
242 case MEMBUF:
243 address = src->Bitmap + src->VXsize * y + x;
244 bcopy(address, line, width);
245 break;
274 case VIDBUF8:
275 case MEMBUF:
276 address = src->Bitmap + src->VXsize * y + x;
277 bcopy(address, line, width);
278 break;
279 case VIDBUF16:
280 case VIDBUF24:
281 case VIDBUF32:
282 address = src->Bitmap + (src->VXsize * y + x) * src->PixelBytes;
283 bcopy(address, line, width * src->PixelBytes);
284 break;
246 default:
247 }
248}
249
250int
251__VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
252 VGLBitmap *dst, int dstx, int dsty, int width, int hight)
253{

--- 111 unchanged lines hidden ---
285 default:
286 }
287}
288
289int
290__VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy,
291 VGLBitmap *dst, int dstx, int dsty, int width, int hight)
292{

--- 111 unchanged lines hidden ---