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:
parent
65369afd6d
commit
6109122c9b
@ -193,7 +193,8 @@ AccelerantDriver::Initialize()
|
|||||||
accSetCursorShape = (set_cursor_shape)accelerant_hook(B_SET_CURSOR_SHAPE,NULL);
|
accSetCursorShape = (set_cursor_shape)accelerant_hook(B_SET_CURSOR_SHAPE,NULL);
|
||||||
accMoveCursor = (move_cursor)accelerant_hook(B_MOVE_CURSOR,NULL);
|
accMoveCursor = (move_cursor)accelerant_hook(B_MOVE_CURSOR,NULL);
|
||||||
accShowCursor = (show_cursor)accelerant_hook(B_SHOW_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
|
#ifdef DRAW_TEST
|
||||||
// Commented out to remove a couple warnings
|
// Commented out to remove a couple warnings
|
||||||
// RGBColor red(255,0,0,0);
|
// RGBColor red(255,0,0,0);
|
||||||
@ -1229,6 +1230,27 @@ AccelerantDriver::GetDepthFromColorspace(int space)
|
|||||||
void
|
void
|
||||||
AccelerantDriver::Blit(const BRect &src, const BRect &dest, const DrawData *d)
|
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
|
void
|
||||||
|
@ -39,82 +39,86 @@
|
|||||||
class ServerBitmap;
|
class ServerBitmap;
|
||||||
class ServerCursor;
|
class ServerCursor;
|
||||||
|
|
||||||
class AccelerantDriver : public DisplayDriverImpl
|
class AccelerantDriver : public DisplayDriverImpl {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
AccelerantDriver();
|
AccelerantDriver();
|
||||||
~AccelerantDriver();
|
~AccelerantDriver();
|
||||||
|
|
||||||
bool Initialize();
|
virtual bool Initialize();
|
||||||
void Shutdown();
|
virtual void Shutdown();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
virtual bool Lock(bigtime_t timeout = B_INFINITE_TIMEOUT);
|
virtual bool Lock(bigtime_t timeout = B_INFINITE_TIMEOUT);
|
||||||
virtual void Unlock(void);
|
virtual void Unlock(void);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void SetMode(const int32 &mode);
|
virtual void SetMode(const int32 &mode);
|
||||||
virtual void SetMode(const display_mode &mode);
|
virtual void SetMode(const display_mode &mode);
|
||||||
|
|
||||||
virtual bool DumpToFile(const char *path);
|
virtual bool DumpToFile(const char *path);
|
||||||
virtual void InvertRect(const BRect &r);
|
virtual void InvertRect(const BRect &r);
|
||||||
virtual void StrokeLineArray(const int32 &numlines, const LineArrayData *linedata,const DrawData *d);
|
virtual void StrokeLineArray(const int32 &numlines, const LineArrayData *linedata,const DrawData *d);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
virtual status_t SetDPMSMode(const uint32 &state);
|
virtual status_t SetDPMSMode(const uint32 &state);
|
||||||
virtual uint32 DPMSMode() const;
|
virtual uint32 DPMSMode() const;
|
||||||
virtual uint32 DPMSCapabilities() const;
|
virtual uint32 DPMSCapabilities() const;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual status_t GetDeviceInfo(accelerant_device_info *info);
|
virtual status_t GetDeviceInfo(accelerant_device_info *info);
|
||||||
virtual status_t GetModeList(display_mode **mode_list, uint32 *count);
|
virtual status_t GetModeList(display_mode **mode_list, uint32 *count);
|
||||||
virtual status_t GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *high);
|
virtual status_t GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *high);
|
||||||
virtual status_t GetTimingConstraints(display_timing_constraints *dtc);
|
virtual status_t GetTimingConstraints(display_timing_constraints *dtc);
|
||||||
virtual status_t ProposeMode(display_mode *candidate, const display_mode *low, const display_mode *high);
|
virtual status_t ProposeMode(display_mode *candidate, const display_mode *low, const display_mode *high);
|
||||||
virtual status_t WaitForRetrace(bigtime_t timeout=B_INFINITE_TIMEOUT);
|
virtual status_t WaitForRetrace(bigtime_t timeout=B_INFINITE_TIMEOUT);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool AcquireBuffer(FBBitmap *bmp);
|
virtual bool AcquireBuffer(FBBitmap *bmp);
|
||||||
virtual void ReleaseBuffer(void);
|
virtual void ReleaseBuffer(void);
|
||||||
|
|
||||||
void BlitBitmap(ServerBitmap *sourcebmp, BRect sourcerect, BRect destrect, drawing_mode mode=B_OP_COPY);
|
void BlitBitmap(ServerBitmap *sourcebmp, BRect sourcerect, BRect destrect, drawing_mode mode=B_OP_COPY);
|
||||||
void ExtractToBitmap(ServerBitmap *destbmp, BRect destrect, BRect sourcerect);
|
void ExtractToBitmap(ServerBitmap *destbmp, BRect destrect, BRect sourcerect);
|
||||||
rgb_color GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high=true);
|
rgb_color GetBlitColor(rgb_color src, rgb_color dest, LayerData *d, bool use_high=true);
|
||||||
int OpenGraphicsDevice(int deviceNumber);
|
int OpenGraphicsDevice(int deviceNumber);
|
||||||
int GetModeFromResolution(int width, int height, int space);
|
int GetModeFromResolution(int width, int height, int space);
|
||||||
int GetWidthFromMode(int mode);
|
int GetWidthFromMode(int mode);
|
||||||
int GetHeightFromMode(int mode);
|
int GetHeightFromMode(int mode);
|
||||||
int GetDepthFromMode(int mode);
|
int GetDepthFromMode(int mode);
|
||||||
int GetDepthFromColorspace(int space);
|
int GetDepthFromColorspace(int space);
|
||||||
|
|
||||||
// Support functions for the rest of the driver
|
// Support functions for the rest of the driver
|
||||||
virtual void Blit(const BRect &src, const BRect &dest, const DrawData *d);
|
virtual void Blit(const BRect &src, const BRect &dest, const DrawData *d);
|
||||||
virtual void FillSolidRect(const BRect &rect, const RGBColor &color);
|
virtual void FillSolidRect(const BRect &rect, const RGBColor &color);
|
||||||
virtual void FillPatternRect(const BRect &rect, const DrawData *d);
|
virtual void FillPatternRect(const BRect &rect, const DrawData *d);
|
||||||
virtual void StrokeSolidLine(int32 x1, int32 y1, int32 x2, int32 y2, const RGBColor &color);
|
virtual void StrokeSolidLine(int32 x1, int32 y1, int32 x2, int32 y2, const RGBColor &color);
|
||||||
virtual void StrokePatternLine(int32 x1, int32 y1, int32 x2, int32 y2, const DrawData *d);
|
virtual void StrokePatternLine(int32 x1, int32 y1, int32 x2, int32 y2, const DrawData *d);
|
||||||
virtual void StrokeSolidRect(const BRect &rect, const RGBColor &color);
|
virtual void StrokeSolidRect(const BRect &rect, const RGBColor &color);
|
||||||
virtual void CopyBitmap(ServerBitmap *bitmap, const BRect &source, const BRect &dest, const DrawData *d);
|
virtual void CopyBitmap(ServerBitmap *bitmap, const BRect &source, const BRect &dest, const DrawData *d);
|
||||||
virtual void CopyToBitmap(ServerBitmap *target, const BRect &source);
|
virtual void CopyToBitmap(ServerBitmap *target, const BRect &source);
|
||||||
|
|
||||||
ServerCursor *cursor, *under_cursor;
|
|
||||||
|
|
||||||
BRect cursorframe;
|
ServerCursor *cursor;
|
||||||
int card_fd;
|
ServerCursor *under_cursor;
|
||||||
image_id accelerant_image;
|
BRect cursorframe;
|
||||||
GetAccelerantHook accelerant_hook;
|
|
||||||
engine_token *mEngineToken;
|
int card_fd;
|
||||||
acquire_engine AcquireEngine;
|
image_id accelerant_image;
|
||||||
release_engine ReleaseEngine;
|
GetAccelerantHook accelerant_hook;
|
||||||
fill_rectangle accFillRect;
|
engine_token *mEngineToken;
|
||||||
invert_rectangle accInvertRect;
|
acquire_engine AcquireEngine;
|
||||||
set_cursor_shape accSetCursorShape;
|
release_engine ReleaseEngine;
|
||||||
move_cursor accMoveCursor;
|
|
||||||
show_cursor accShowCursor;
|
// accelerant hooks
|
||||||
frame_buffer_config mFrameBufferConfig;
|
fill_rectangle accFillRect;
|
||||||
int mode_count;
|
invert_rectangle accInvertRect;
|
||||||
display_mode *mode_list;
|
set_cursor_shape accSetCursorShape;
|
||||||
display_mode R5DisplayMode; // This should go away once we stop running under r5
|
move_cursor accMoveCursor;
|
||||||
|
show_cursor accShowCursor;
|
||||||
|
screen_to_screen_blit accScreenBlit;
|
||||||
|
|
||||||
|
frame_buffer_config mFrameBufferConfig;
|
||||||
|
int mode_count;
|
||||||
|
display_mode *mode_list;
|
||||||
|
display_mode R5DisplayMode; // This should go away once we stop running under r5
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user