2 * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
12 #include "accelerant.h"
18 uint32
* Data() { return &opcode
; }
23 QueueCommands(ring_buffer
&ring
);
26 void Put(struct command
&command
, size_t size
);
28 void PutWaitFor(uint32 event
);
29 void PutOverlayFlip(uint32 code
, bool updateCoefficients
);
31 void MakeSpace(uint32 size
);
32 void Write(uint32 data
);
35 ring_buffer
&fRingBuffer
;
41 struct xy_command
: command
{
42 uint16 dest_bytes_per_row
;
43 uint8 raster_operation
;
51 xy_command(uint32 command
, uint16 rop
)
54 switch (gInfo
->shared_info
->bits_per_pixel
) {
56 mode
= COMMAND_MODE_CMAP8
;
59 mode
= COMMAND_MODE_RGB15
;
62 mode
= COMMAND_MODE_RGB16
;
65 mode
= COMMAND_MODE_RGB32
;
66 opcode
|= COMMAND_BLIT_RGBA
;
70 dest_bytes_per_row
= gInfo
->shared_info
->bytes_per_row
;
71 dest_base
= gInfo
->shared_info
->frame_buffer_offset
;
72 raster_operation
= rop
;
76 struct xy_source_blit_command
: xy_command
{
79 uint16 source_bytes_per_row
;
83 xy_source_blit_command()
84 : xy_command(XY_COMMAND_SOURCE_BLIT
, 0xcc)
86 source_bytes_per_row
= dest_bytes_per_row
;
87 source_base
= dest_base
;
92 struct xy_color_blit_command
: xy_command
{
95 xy_color_blit_command(bool invert
)
96 : xy_command(XY_COMMAND_COLOR_BLIT
, invert
? 0x55 : 0xf0)
101 struct xy_setup_mono_pattern_command
: xy_command
{
102 uint32 background_color
;
103 uint32 foreground_color
;
106 xy_setup_mono_pattern_command()
107 : xy_command(XY_COMMAND_SETUP_MONO_PATTERN
, 0xf0)
109 mode
|= COMMAND_MODE_SOLID_PATTERN
;
111 // this defines the clipping window (but clipping is disabled)
119 struct xy_scanline_blit_command
: command
{
125 xy_scanline_blit_command()
127 opcode
= XY_COMMAND_SCANLINE_BLIT
;