* Implemented B_FILL_SPAN - I am not sure if it's used at all, though, so

I am also not sure if it's working correctly.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17425 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-05-11 16:10:09 +00:00
parent efeb77268d
commit d906e6a03e
4 changed files with 69 additions and 7 deletions

View File

@ -250,9 +250,17 @@ struct intel_free_graphics_memory {
// 2D acceleration
#define XY_COMMAND_SOURCE_BLIT 0x54c00006
#define XY_COMMAND_COLOR_BLIT 0x54000004
#define XY_COMMAND_SETUP_MONO_PATTERN 0x44400007
#define XY_COMMAND_SCANLINE_BLIT 0x49400001
#define COMMAND_COLOR_BLIT 0x50000003
#define COMMAND_BLIT_RGBA 0x00300000
#define COMMAND_MODE_SOLID_PATTERN 0x80
#define COMMAND_MODE_CMAP8 0x00
#define COMMAND_MODE_RGB15 0x02
#define COMMAND_MODE_RGB16 0x01
#define COMMAND_MODE_RGB32 0x03
// overlay
#define INTEL_OVERLAY_UPDATE 0x30000

View File

@ -41,7 +41,7 @@ class QueueCommands {
struct xy_command : command {
uint16 dest_bytes_per_row;
uint8 raster_operation;
uint8 flags;
uint8 mode;
uint16 dest_left;
uint16 dest_top;
uint16 dest_right;
@ -53,16 +53,16 @@ struct xy_command : command {
opcode = command;
switch (gInfo->shared_info->bits_per_pixel) {
case 8:
flags = 0;
mode = COMMAND_MODE_CMAP8;
break;
case 15:
flags = 2;
mode = COMMAND_MODE_RGB15;
break;
case 16:
flags = 1;
mode = COMMAND_MODE_RGB16;
break;
case 32:
flags = 3;
mode = COMMAND_MODE_RGB32;
opcode |= COMMAND_BLIT_RGBA;
break;
}
@ -98,4 +98,34 @@ struct xy_color_blit_command : xy_command {
}
};
struct xy_setup_mono_pattern_command : xy_command {
uint32 background_color;
uint32 foreground_color;
uint64 pattern;
xy_setup_mono_pattern_command()
: xy_command(XY_COMMAND_SETUP_MONO_PATTERN, 0xf0)
{
mode |= COMMAND_MODE_SOLID_PATTERN;
// this defines the clipping window (but clipping is disabled)
dest_left = 0;
dest_top = 0;
dest_right = 0;
dest_bottom = 0;
}
};
struct xy_scanline_blit_command : command {
uint16 dest_left;
uint16 dest_top;
uint16 dest_right;
uint16 dest_bottom;
xy_scanline_blit_command()
{
opcode = XY_COMMAND_SCANLINE_BLIT;
}
};
#endif // COMMANDS_H

View File

@ -274,3 +274,28 @@ intel_invert_rectangle(engine_token *token, fill_rect_params *params, uint32 cou
}
}
void
intel_fill_span(engine_token *token, uint32 color, uint16* _params, uint32 count)
{
struct params {
uint16 top;
uint16 left;
uint16 right;
} *params = (struct params *)_params;
QueueCommands queue(gInfo->shared_info->primary_ring_buffer);
xy_setup_mono_pattern_command setup;
setup.background_color = color;
setup.pattern = 0;
queue.Put(setup, sizeof(setup));
for (uint32 i = 0; i < count; i++) {
xy_scanline_blit_command blit;
blit.dest_left = params[i].left;
blit.dest_top = params[i].top;
blit.dest_right = params[i].right;
blit.dest_bottom = params[i].top;
}
}

View File

@ -89,10 +89,9 @@ get_accelerant_hook(uint32 feature, void *data)
return intel_fill_rectangle;
case B_INVERT_RECTANGLE:
return intel_invert_rectangle;
/*
case B_FILL_SPAN:
return intel_fill_span;
*/
// overlay
case B_OVERLAY_COUNT:
return intel_overlay_supported_spaces;