DisplayDriverPainter should now use the new AccelerantHWInterface when compiled for Haiku, added locking to the rest of the functions which access HWInterface instance
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12135 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -28,7 +28,12 @@
|
|||||||
|
|
||||||
#include "Painter.h"
|
#include "Painter.h"
|
||||||
#include "RenderingBuffer.h"
|
#include "RenderingBuffer.h"
|
||||||
#include "ViewHWInterface.h"
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#include "AccelerantHWInterface.h"
|
||||||
|
#else
|
||||||
|
#include "ViewHWInterface.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "DisplayDriverPainter.h"
|
#include "DisplayDriverPainter.h"
|
||||||
|
|
||||||
@@ -41,7 +46,11 @@
|
|||||||
DisplayDriverPainter::DisplayDriverPainter()
|
DisplayDriverPainter::DisplayDriverPainter()
|
||||||
: DisplayDriver(),
|
: DisplayDriver(),
|
||||||
fPainter(new Painter()),
|
fPainter(new Painter()),
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
fGraphicsCard(new AccelerantHWInterface())
|
||||||
|
#else
|
||||||
fGraphicsCard(new ViewHWInterface())
|
fGraphicsCard(new ViewHWInterface())
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +510,7 @@ DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const R
|
|||||||
fPainter->SetDrawingMode(B_OP_COPY);
|
fPainter->SetDrawingMode(B_OP_COPY);
|
||||||
fPainter->StrokeLine(start, end, B_SOLID_HIGH);
|
fPainter->StrokeLine(start, end, B_SOLID_HIGH);
|
||||||
|
|
||||||
BRect r(start, end);
|
BRect r(start, end + BPoint(1.0, 1.0));
|
||||||
fGraphicsCard->Invalidate(r);
|
fGraphicsCard->Invalidate(r);
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
@@ -910,42 +919,48 @@ DisplayDriverPainter::SetDPMSMode(const uint32 &state)
|
|||||||
uint32
|
uint32
|
||||||
DisplayDriverPainter::DPMSMode() const
|
DisplayDriverPainter::DPMSMode() const
|
||||||
{
|
{
|
||||||
/* uint32 mode = 0;
|
uint32 mode = 0;
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
mode = fGraphicsCard->DPMSMode();
|
mode = fGraphicsCard->DPMSMode();
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
return mode;*/
|
return mode;
|
||||||
return fGraphicsCard->DPMSMode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DPMSCapabilities
|
// DPMSCapabilities
|
||||||
uint32
|
uint32
|
||||||
DisplayDriverPainter::DPMSCapabilities() const
|
DisplayDriverPainter::DPMSCapabilities() const
|
||||||
{
|
{
|
||||||
/* uint32 caps = 0;
|
uint32 caps = 0;
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
caps = fGraphicsCard->DPMSMode();
|
caps = fGraphicsCard->DPMSMode();
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
return caps;*/
|
return caps;
|
||||||
return fGraphicsCard->DPMSMode();;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDeviceInfo
|
// GetDeviceInfo
|
||||||
status_t
|
status_t
|
||||||
DisplayDriverPainter::GetDeviceInfo(accelerant_device_info *info)
|
DisplayDriverPainter::GetDeviceInfo(accelerant_device_info *info)
|
||||||
{
|
{
|
||||||
// TODO: locking?
|
status_t ret = B_ERROR;
|
||||||
return fGraphicsCard->GetDeviceInfo(info);
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->GetDeviceInfo(info);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetModeList
|
// GetModeList
|
||||||
status_t
|
status_t
|
||||||
DisplayDriverPainter::GetModeList(display_mode **mode_list, uint32 *count)
|
DisplayDriverPainter::GetModeList(display_mode **mode_list, uint32 *count)
|
||||||
{
|
{
|
||||||
// TODO: locking?
|
status_t ret = B_ERROR;
|
||||||
return fGraphicsCard->GetModeList(mode_list, count);
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->GetModeList(mode_list, count);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPixelClockLimits
|
// GetPixelClockLimits
|
||||||
@@ -953,16 +968,24 @@ status_t DisplayDriverPainter::GetPixelClockLimits(display_mode *mode,
|
|||||||
uint32 *low,
|
uint32 *low,
|
||||||
uint32 *high)
|
uint32 *high)
|
||||||
{
|
{
|
||||||
// TODO: locking?
|
status_t ret = B_ERROR;
|
||||||
return fGraphicsCard->GetPixelClockLimits(mode, low, high);
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->GetPixelClockLimits(mode, low, high);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTimingConstraints
|
// GetTimingConstraints
|
||||||
status_t
|
status_t
|
||||||
DisplayDriverPainter::GetTimingConstraints(display_timing_constraints *dtc)
|
DisplayDriverPainter::GetTimingConstraints(display_timing_constraints *dtc)
|
||||||
{
|
{
|
||||||
// TODO: locking?
|
status_t ret = B_ERROR;
|
||||||
return fGraphicsCard->GetTimingConstraints(dtc);
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->GetTimingConstraints(dtc);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProposeMode
|
// ProposeMode
|
||||||
@@ -971,15 +994,24 @@ DisplayDriverPainter::ProposeMode(display_mode *candidate,
|
|||||||
const display_mode *low,
|
const display_mode *low,
|
||||||
const display_mode *high)
|
const display_mode *high)
|
||||||
{
|
{
|
||||||
// TODO: locking?
|
status_t ret = B_ERROR;
|
||||||
return fGraphicsCard->ProposeMode(candidate, low, high);
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->ProposeMode(candidate, low, high);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WaitForRetrace
|
// WaitForRetrace
|
||||||
status_t
|
status_t
|
||||||
DisplayDriverPainter::WaitForRetrace(bigtime_t timeout)
|
DisplayDriverPainter::WaitForRetrace(bigtime_t timeout)
|
||||||
{
|
{
|
||||||
return fGraphicsCard->WaitForRetrace(timeout);
|
status_t ret = B_ERROR;
|
||||||
|
if (Lock()) {
|
||||||
|
ret = fGraphicsCard->WaitForRetrace(timeout);
|
||||||
|
Unlock();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CopyBitmap
|
// CopyBitmap
|
||||||
@@ -999,12 +1031,7 @@ void DisplayDriverPainter::CopyToBitmap(ServerBitmap *target,
|
|||||||
// Invalidate
|
// Invalidate
|
||||||
void DisplayDriverPainter::Invalidate(const BRect &r)
|
void DisplayDriverPainter::Invalidate(const BRect &r)
|
||||||
{
|
{
|
||||||
// the CursorHandler uses this, but we don't need right now, and it clutters debug output
|
// nothing to be done here
|
||||||
// if (Lock()) {
|
|
||||||
// ?!? Does this implementation need this?
|
|
||||||
// fGraphicsCard->Invalidate(r);
|
|
||||||
// Unlock();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConstrainClippingRegion
|
// ConstrainClippingRegion
|
||||||
|
|||||||
Reference in New Issue
Block a user