Implemented screen to screen blit and cleaned up header.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12067 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2005-03-27 05:29:56 +00:00
parent 65369afd6d
commit 6109122c9b
2 changed files with 86 additions and 60 deletions

View File

@ -193,6 +193,7 @@ AccelerantDriver::Initialize()
accSetCursorShape = (set_cursor_shape)accelerant_hook(B_SET_CURSOR_SHAPE,NULL);
accMoveCursor = (move_cursor)accelerant_hook(B_MOVE_CURSOR,NULL);
accShowCursor = (show_cursor)accelerant_hook(B_SHOW_CURSOR,NULL);
accScreenBlit = (screen_to_screen_blit)accelerant_hook(B_SCREEN_TO_SCREEN_BLIT, NULL);
#ifdef DRAW_TEST
// Commented out to remove a couple warnings
@ -1229,6 +1230,27 @@ AccelerantDriver::GetDepthFromColorspace(int space)
void
AccelerantDriver::Blit(const BRect &src, const BRect &dest, const DrawData *d)
{
#ifndef DISABLE_HARDWARE_ACCELERATION
if (accScreenBlit && AcquireEngine) {
if (AcquireEngine(0, 0, NULL, &mEngineToken) == B_OK) {
blit_params blitParams;
blitParams.src_left = (uint16)src.left;
blitParams.src_top = (uint16)src.top;
blitParams.dest_left = (uint16)dest.left;
blitParams.dest_top = (uint16)dest.top;
blitParams.width = (int16)src.Width() - 1;
blitParams.height = (int16)src.Height() - 1;
accScreenBlit(mEngineToken, &blitParams, 1);
if (ReleaseEngine)
ReleaseEngine(mEngineToken, NULL);
Unlock();
return;
}
}
#endif
}
void

View File

@ -39,14 +39,13 @@
class ServerBitmap;
class ServerCursor;
class AccelerantDriver : public DisplayDriverImpl
{
class AccelerantDriver : public DisplayDriverImpl {
public:
AccelerantDriver();
~AccelerantDriver();
bool Initialize();
void Shutdown();
virtual bool Initialize();
virtual void Shutdown();
/*
virtual bool Lock(bigtime_t timeout = B_INFINITE_TIMEOUT);
@ -97,20 +96,25 @@ protected:
virtual void CopyBitmap(ServerBitmap *bitmap, const BRect &source, const BRect &dest, const DrawData *d);
virtual void CopyToBitmap(ServerBitmap *target, const BRect &source);
ServerCursor *cursor, *under_cursor;
ServerCursor *cursor;
ServerCursor *under_cursor;
BRect cursorframe;
int card_fd;
image_id accelerant_image;
GetAccelerantHook accelerant_hook;
engine_token *mEngineToken;
acquire_engine AcquireEngine;
release_engine ReleaseEngine;
// accelerant hooks
fill_rectangle accFillRect;
invert_rectangle accInvertRect;
set_cursor_shape accSetCursorShape;
move_cursor accMoveCursor;
show_cursor accShowCursor;
screen_to_screen_blit accScreenBlit;
frame_buffer_config mFrameBufferConfig;
int mode_count;
display_mode *mode_list;