vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / accelerants / via / Acceleration.c
blob246fbf6bf270090c3d6c8a075f962dcb3e04f605
1 /*
2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
5 Other authors:
6 Rudolf Cornelissen 9/2003.
7 */
9 #define MODULE_BIT 0x40000000
11 #include "acc_std.h"
13 void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) {
14 int i;
16 /* init acc engine for blit function */
17 eng_acc_setup_blit();
19 /* do each blit */
20 i=0;
21 while (count--)
23 eng_acc_blit
25 list[i].src_left,
26 list[i].src_top,
27 list[i].dest_left,
28 list[i].dest_top,
29 list[i].width,
30 list[i].height
32 i++;
36 void SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT(engine_token *et, scaled_blit_params *list, uint32 count) {
37 int i;
39 /* do each blit */
40 i=0;
41 while (count--)
43 eng_acc_video_blit
45 list[i].src_left,
46 list[i].src_top,
47 list[i].src_width,
48 list[i].src_height,
49 list[i].dest_left,
50 list[i].dest_top,
51 list[i].dest_width,
52 list[i].dest_height
54 i++;
58 void SCREEN_TO_SCREEN_TRANSPARENT_BLIT(engine_token *et, uint32 transparent_colour, blit_params *list, uint32 count) {
59 int i;
61 /* do each blit */
62 i=0;
63 while (count--)
65 eng_acc_transparent_blit
67 list[i].src_left,
68 list[i].src_top,
69 list[i].dest_left,
70 list[i].dest_top,
71 list[i].width,
72 list[i].height,
73 transparent_colour
75 i++;
79 void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) {
80 int i;
82 /* init acc engine for fill function */
83 eng_acc_setup_rectangle(colorIndex);
85 /* draw each rectangle */
86 i=0;
87 while (count--)
89 eng_acc_rectangle
91 list[i].left,
92 (list[i].right)+1,
93 list[i].top,
94 (list[i].bottom-list[i].top)+1
96 i++;
100 void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) {
101 int i;
103 /* init acc engine for invert function */
104 eng_acc_setup_rect_invert();
106 /* invert each rectangle */
107 i=0;
108 while (count--)
110 eng_acc_rectangle_invert
112 list[i].left,
113 (list[i].right)+1,
114 list[i].top,
115 (list[i].bottom-list[i].top)+1
117 i++;
121 void FILL_SPAN(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count) {
122 int i;
124 /* init acc engine for fill function */
125 eng_acc_setup_rectangle(colorIndex);
127 /* draw each span */
128 i=0;
129 while (count--)
131 eng_acc_rectangle
133 list[i+1],
134 list[i+2]+1,
135 list[i],
138 i+=3;