first step of geting rid of abstract DisplayDriver base class for less development overhead, DisplayDriverPainter is renamed to DrawingEngine

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14694 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-11-04 15:23:54 +00:00
parent ec12c6fe6f
commit 58468dfed0
26 changed files with 147 additions and 133 deletions

View File

@ -19,7 +19,7 @@
#include "DrawState.h"
class DesktopSettings;
class DisplayDriver;
class DrawingEngine;
class ServerFont;
class BRegion;
@ -52,7 +52,7 @@ class Decorator {
virtual ~Decorator();
void SetColors(const ColorSet &cset);
void SetDriver(DisplayDriver *driver);
void SetDriver(DrawingEngine *driver);
void SetFlags(int32 wflags);
void SetFeel(int32 wfeel);
void SetFont(ServerFont *font);
@ -137,7 +137,7 @@ class Decorator {
virtual void _SetColors();
ColorSet* _colors;
DisplayDriver* _driver;
DrawingEngine* _driver;
DrawState fDrawState;
int32 _look;

View File

@ -7,19 +7,39 @@
* Gabe Yoder <gyoder@stny.rr.com>
* Stephan Aßmus <superstippi@gmx.de>
*/
#ifndef _DISPLAY_DRIVER_PAINTER_H_
#define _DISPLAY_DRIVER_PAINTER_H_
#ifndef _DISPLAY_DRIVER_H_
#define _DISPLAY_DRIVER_H_
#include "DisplayDriver.h"
#include <Accelerant.h>
#include <Font.h>
#include <Locker.h>
#include <Point.h>
class BPoint;
class BRect;
class BRegion;
class DrawState;
class HWInterface;
class Painter;
class RGBColor;
class ServerBitmap;
class ServerCursor;
class ServerFont;
typedef struct
{
BPoint pt1;
BPoint pt2;
rgb_color color;
class DisplayDriverPainter : public DisplayDriver {
} LineArrayData;
class DrawingEngine {
public:
DisplayDriverPainter(HWInterface* interface = NULL);
virtual ~DisplayDriverPainter();
DrawingEngine(HWInterface* interface = NULL);
virtual ~DrawingEngine();
// when implementing, be sure to call the inherited version
virtual status_t Initialize();

View File

@ -87,7 +87,7 @@ DecorInfo::Instantiate(Desktop* desktop, BRect rect, const char *title,
return NULL;
}
decorator->SetDriver(desktop->GetDisplayDriver());
decorator->SetDriver(desktop->GetDrawingEngine());
gGUIColorSet.Lock();
decorator->SetColors(gGUIColorSet);

View File

@ -14,7 +14,6 @@
#include <ObjectList.h>
#include "Decorator.h"
#include "DisplayDriver.h"
class DecorInfo;
class Desktop;

View File

@ -11,7 +11,7 @@
#include "ColorSet.h"
#include "Decorator.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include <Region.h>
@ -77,10 +77,10 @@ Decorator::SetColors(const ColorSet &cset)
/*!
\brief Assigns a display driver to the decorator
\param driver A valid DisplayDriver object
\param driver A valid DrawingEngine object
*/
void
Decorator::SetDriver(DisplayDriver *driver)
Decorator::SetDriver(DrawingEngine *driver)
{
_driver = driver;
// lots of subclasses will depend on the driver for text support, so call

View File

@ -14,7 +14,7 @@
#include "ColorUtils.h"
#include "DesktopSettings.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "DrawState.h"
#include "FontManager.h"
#include "PatternHandler.h"

View File

@ -104,7 +104,7 @@ Desktop::Init()
char name[32];
sprintf(name, "RootLayer %d", 1);
fRootLayer = new RootLayer(name, 4, this, GetDisplayDriver());
fRootLayer = new RootLayer(name, 4, this, GetDrawingEngine());
fRootLayer->RunThread();
// take care of setting the default cursor

View File

@ -27,7 +27,7 @@
class BMessage;
class DisplayDriver;
class DrawingEngine;
class HWInterface;
class Layer;
class RootLayer;
@ -64,8 +64,8 @@ class Desktop : public MessageLooper, public ScreenOwner {
virtual bool ReleaseScreen(Screen* screen) { return false; }
const ::VirtualScreen& VirtualScreen() const { return fVirtualScreen; }
inline DisplayDriver* GetDisplayDriver() const
{ return fVirtualScreen.DisplayDriver(); }
inline DrawingEngine* GetDrawingEngine() const
{ return fVirtualScreen.DrawingEngine(); }
inline HWInterface* GetHWInterface() const
{ return fVirtualScreen.HWInterface(); }

View File

@ -37,7 +37,7 @@
#include <View.h>
#include "DebugInfoManager.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "DrawState.h"
#include "PortLink.h"
#include "RootLayer.h"
@ -63,7 +63,7 @@
Layer::Layer(BRect frame, const char* name, int32 token,
uint32 resize, uint32 flags, DisplayDriver* driver)
uint32 resize, uint32 flags, DrawingEngine* driver)
:
fFrame(frame), // in parent coordinates
// fBoundsLeftTop(0.0, 0.0),
@ -128,7 +128,7 @@ CRITICAL(helper);
// NOTE: This flag is forwarded to a DrawState setting, even
// though it is actually not part of a "state". However,
// it is an important detail of a graphics context, and we
// have no other means to pass this setting on to the DisplayDriver
// have no other means to pass this setting on to the DrawingEngine
// other than through the DrawState. If we ever add a flag
// B_ANTI_ALIASING to the view flags, it would have to be passed
// in the same way. Though when breaking binary compatibility,
@ -1912,7 +1912,7 @@ Layer::do_CopyBits(BRect& src, BRect& dst, int32 xOffset, int32 yOffset) {
// move the region back for the actual operation
copyRegion.OffsetBy(-xOffset, -yOffset);
GetDisplayDriver()->CopyRegion(&copyRegion, xOffset, yOffset);
GetDrawingEngine()->CopyRegion(&copyRegion, xOffset, yOffset);
// trigger the redraw
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
@ -1939,7 +1939,7 @@ Layer::do_CopyBits(BRect& src, BRect& dst, int32 xOffset, int32 yOffset) {
// move the region back for the actual operation
copyRegion.OffsetBy(-xOffset, -yOffset);
GetDisplayDriver()->CopyRegion(&copyRegion, xOffset, yOffset);
GetDrawingEngine()->CopyRegion(&copyRegion, xOffset, yOffset);
// trigger the redraw
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
@ -2455,7 +2455,7 @@ void Layer::do_MoveBy(float dx, float dy)
// offset back and instruct the HW to do the actual copying.
oldFullVisible.OffsetBy(-dx, -dy);
GetDisplayDriver()->CopyRegion(&oldFullVisible, dx, dy);
GetDrawingEngine()->CopyRegion(&oldFullVisible, dx, dy);
// add redrawReg to our RootLayer's redraw region.
// GetRootLayer()->fRedrawReg.Include(&redrawReg);
@ -2489,7 +2489,7 @@ Layer::do_ScrollBy(float dx, float dy)
// compute the common region. we'll use HW acc to copy this to the new location.
invalid.IntersectWith(&fFullVisible2);
GetDisplayDriver()->CopyRegion(&invalid, -dx, -dy);
GetDrawingEngine()->CopyRegion(&invalid, -dx, -dy);
// common region goes back to its original location. then, by excluding
// it from curent fullVisible we'll obtain the region that needs to be redrawn.

View File

@ -48,7 +48,7 @@ enum {
class ServerApp;
class RootLayer;
class DisplayDriver;
class DrawingEngine;
class DrawState;
class ServerBitmap;
@ -70,7 +70,7 @@ class Layer {
public:
Layer(BRect frame, const char* name,
int32 token, uint32 resize,
uint32 flags, DisplayDriver* driver);
uint32 flags, DrawingEngine* driver);
virtual ~Layer();
void AddChild(Layer* child, ServerWindow* serverWin);
@ -179,7 +179,7 @@ class Layer {
BRegion ConvertFromTop(BRegion *reg);
DisplayDriver* GetDisplayDriver() const
DrawingEngine* GetDrawingEngine() const
{ return fDriver; }
ServerWindow* Window() const
@ -354,7 +354,7 @@ class Layer {
bool fIsTopLayer;
uint16 fAdFlags;
DisplayDriver* fDriver;
DrawingEngine* fDriver;
DrawState* fDrawState;
RootLayer* fRootLayer;

View File

@ -25,7 +25,7 @@ OffscreenWinBorder::OffscreenWinBorder(ServerBitmap* bitmap,
B_NO_BORDER_WINDOW_LOOK,
B_NORMAL_WINDOW_FEEL,
0, 0, window,
new DisplayDriverPainter()),
new DrawingEngine()),
fBitmap(bitmap),
fHWInterface(new BitmapHWInterface(fBitmap))
{
@ -42,7 +42,7 @@ OffscreenWinBorder::OffscreenWinBorder(ServerBitmap* bitmap,
OffscreenWinBorder::~OffscreenWinBorder()
{
fHWInterface->WriteLock();
// Unlike normal Layers, we own the DisplayDriver instance
// Unlike normal Layers, we own the DrawingEngine instance
fDriver->Shutdown();
delete fDriver;
fHWInterface->Shutdown();

View File

@ -23,7 +23,7 @@
#include <PortLink.h>
#include "Decorator.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "Globals.h"
#include "HWInterface.h"
#include "Layer.h"
@ -57,7 +57,7 @@ static RGBColor kDefaultWorkspaceColor = RGBColor(51, 102, 152);
static int32 kMaxWorkspaceCount = 32;
RootLayer::RootLayer(const char *name, int32 workspaceCount,
Desktop *desktop, DisplayDriver *driver)
Desktop *desktop, DrawingEngine *driver)
: Layer(BRect(0, 0, 0, 0), name, 0, B_FOLLOW_ALL, B_WILL_DRAW, driver),
fDesktop(desktop),
@ -1173,7 +1173,7 @@ RootLayer::KeyboardEventHandler(BMessage *msg)
| B_LEFT_SHIFT_KEY | B_LEFT_OPTION_KEY)) != 0)
#endif
{
// TODO: Set to Safe Mode in KeyboardEventHandler:B_KEY_DOWN. (DisplayDriver API change)
// TODO: Set to Safe Mode in KeyboardEventHandler:B_KEY_DOWN. (DrawingEngine API change)
STRACE(("Safe Video Mode invoked - code unimplemented\n"));
break;
}
@ -1224,7 +1224,7 @@ RootLayer::KeyboardEventHandler(BMessage *msg)
if (scancode == 0x7f)
#endif
{
if (GetDisplayDriver()) {
if (GetDrawingEngine()) {
char filename[128];
BEntry entry;
@ -1234,7 +1234,7 @@ RootLayer::KeyboardEventHandler(BMessage *msg)
entry.SetTo(filename);
} while(entry.Exists());
GetDisplayDriver()->DumpToFile(filename);
GetDrawingEngine()->DumpToFile(filename);
break;
}

View File

@ -38,7 +38,7 @@
#include "Layer.h"
#include "Workspace.h"
class DisplayDriver;
class DrawingEngine;
class HWInterface;
class RGBColor;
class Screen;
@ -67,7 +67,7 @@ class UtilityBitmap;
class RootLayer : public Layer {
public:
RootLayer(const char *name, int32 workspaceCount,
Desktop *desktop, DisplayDriver *driver);
Desktop *desktop, DrawingEngine *driver);
virtual ~RootLayer(void);
Desktop* GetDesktop() const { return fDesktop; }

View File

@ -14,7 +14,7 @@
class BMessage;
class DisplayDriver;
class DrawingEngine;
class HWInterface;
class Screen;

View File

@ -23,7 +23,7 @@
class AreaPool;
class BMessage;
class BList;
class DisplayDriver;
class DrawingEngine;
class ServerPicture;
class ServerCursor;
class ServerBitmap;

View File

@ -25,7 +25,7 @@
Screen::Screen(HWInterface *interface, int32 id)
: fID(id),
fDriver(interface ? new DisplayDriverPainter(interface) : NULL),
fDriver(interface ? new DrawingEngine(interface) : NULL),
fHWInterface(interface)
{
}
@ -71,7 +71,7 @@ Screen::SetMode(display_mode mode)
{
status_t ret = fHWInterface->SetMode(mode);
// the DisplayDriverPainter needs to adjust itself
// the DrawingEngine needs to adjust itself
if (ret >= B_OK)
fDriver->Update();

View File

@ -15,7 +15,7 @@
#include <Accelerant.h>
#include <Point.h>
class DisplayDriver;
class DrawingEngine;
class HWInterface;
class Screen {
@ -45,7 +45,7 @@ class Screen {
inline int32 ScreenNumber() const
{ return fID; }
inline DisplayDriver* GetDisplayDriver() const
inline DrawingEngine* GetDrawingEngine() const
{ return fDriver; }
inline HWInterface* GetHWInterface() const
{ return fHWInterface; }
@ -63,7 +63,7 @@ class Screen {
bool ignoreFrequency = false) const;
int32 fID;
DisplayDriver* fDriver;
DrawingEngine* fDriver;
HWInterface* fHWInterface;
};

View File

@ -39,7 +39,7 @@
#include "BGet++.h"
#include "DebugInfoManager.h"
#include "Desktop.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "HWInterface.h"
#include "Layer.h"
#include "MessagePrivate.h"
@ -482,10 +482,10 @@ ServerWindow::CreateLayerTree(BPrivate::LinkReceiver &link, Layer **_parent)
&& (fWinBorder->WindowFlags() & kWorkspacesWindowFlag) != 0) {
// this is a workspaces window!
newLayer = new (nothrow) WorkspacesLayer(frame, name, token, resizeMask,
flags, fWinBorder->GetDisplayDriver());
flags, fWinBorder->GetDrawingEngine());
} else {
newLayer = new (nothrow) Layer(frame, name, token, resizeMask, flags,
fWinBorder->GetDisplayDriver());
fWinBorder->GetDrawingEngine());
}
if (newLayer == NULL)
@ -1696,7 +1696,7 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
if (fWinBorder->InUpdate())
rreg.IntersectWith(&fWinBorder->RegionToBeUpdated());
DisplayDriver* driver = fWinBorder->GetDisplayDriver();
DrawingEngine* driver = fWinBorder->GetDrawingEngine();
if (!driver) {
// ?!?
DTRACE(("ServerWindow %s: no display driver!!\n", Title()));
@ -1726,7 +1726,7 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
fCurrentLayer->ConvertToTop(p2),
fCurrentLayer->CurrentState());
// We update the pen here because many DisplayDriver calls which do not update the
// We update the pen here because many DrawingEngine calls which do not update the
// pen position actually call StrokeLine
// TODO: Decide where to put this, for example, it cannot be done
@ -1990,7 +1990,7 @@ ServerWindow::_DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
delete[] rects;
// TODO: create support for clipping_rect usage for faster BRegion display.
// Tweaks to DisplayDriver are necessary along with conversion routines in Layer
// Tweaks to DrawingEngine are necessary along with conversion routines in Layer
break;
}
case AS_STROKE_LINEARRAY:
@ -2185,7 +2185,7 @@ ServerWindow::_CopyBits(RootLayer* rootLayer, Layer* layer,
// move the region back for the actual operation
copyRegion.OffsetBy(-xOffset, -yOffset);
layer->GetDisplayDriver()->CopyRegion(&copyRegion, xOffset, yOffset);
layer->GetDrawingEngine()->CopyRegion(&copyRegion, xOffset, yOffset);
// trigger the redraw
if (rootLayer) {
@ -2235,9 +2235,9 @@ ServerWindow::MakeWinBorder(BRect frame, const char* name,
uint32 look, uint32 feel, uint32 flags,
uint32 workspace)
{
// The non-offscreen ServerWindow uses the DisplayDriver instance from the desktop.
// The non-offscreen ServerWindow uses the DrawingEngine instance from the desktop.
return new(nothrow) WinBorder(frame, name, look, feel, flags,
workspace, this, fDesktop->GetDisplayDriver());
workspace, this, fDesktop->GetDrawingEngine());
}

View File

@ -19,7 +19,7 @@
VirtualScreen::VirtualScreen()
:
fScreenList(4, true),
fDisplayDriver(NULL),
fDrawingEngine(NULL),
fHWInterface(NULL)
{
}
@ -46,7 +46,7 @@ VirtualScreen::_Reset()
fSettings.MakeEmpty();
fFrame.Set(0, 0, 0, 0);
fDisplayDriver = NULL;
fDrawingEngine = NULL;
fHWInterface = NULL;
}
@ -103,7 +103,7 @@ VirtualScreen::AddScreen(Screen* screen)
}
// TODO: this works only for single screen configurations
fDisplayDriver = screen->GetDisplayDriver();
fDrawingEngine = screen->GetDrawingEngine();
fHWInterface = screen->GetHWInterface();
fFrame = screen->Frame();

View File

@ -14,7 +14,7 @@
#include <Message.h>
class Desktop;
class DisplayDriver;
class DrawingEngine;
class HWInterface;
@ -23,8 +23,8 @@ class VirtualScreen {
VirtualScreen();
~VirtualScreen();
::DisplayDriver* DisplayDriver() const
{ return fDisplayDriver; }
::DrawingEngine* DrawingEngine() const
{ return fDrawingEngine; }
// TODO: can we have a multiplexing HWInterface as well?
// If not, this would need to be hidden, and only made
// available for the Screen class
@ -60,7 +60,7 @@ class VirtualScreen {
BMessage fSettings;
BRect fFrame;
BObjectList<screen_item> fScreenList;
::DisplayDriver* fDisplayDriver;
::DrawingEngine* fDrawingEngine;
::HWInterface* fHWInterface;
};

View File

@ -66,7 +66,7 @@ WinBorder::WinBorder(const BRect &frame,
const uint32 flags,
const uint32 workspaces,
ServerWindow *window,
DisplayDriver *driver)
DrawingEngine *driver)
: Layer(frame, name, B_NULL_TOKEN, B_FOLLOW_NONE, 0UL, driver),
fDecorator(NULL),
fTopLayer(NULL),
@ -126,8 +126,10 @@ WinBorder::WinBorder(const BRect &frame,
uint16 width, height;
uint32 colorSpace;
float frequency;
GetRootLayer()->GetDesktop()->ScreenAt(0)->GetMode(width, height, colorSpace, frequency);
_ResizeBy(width - frame.Width(), height - frame.Height());
if (GetRootLayer()->GetDesktop()->ScreenAt(0)) {
GetRootLayer()->GetDesktop()->ScreenAt(0)->GetMode(width, height, colorSpace, frequency);
_ResizeBy(width - frame.Width(), height - frame.Height());
}
} else
_ResizeBy(0, 0);

View File

@ -30,7 +30,7 @@ enum {
class ServerWindow;
class Decorator;
class DisplayDriver;
class DrawingEngine;
class Desktop;
class WinBorder : public Layer {
@ -42,7 +42,7 @@ class WinBorder : public Layer {
const uint32 flags,
const uint32 workspaces,
ServerWindow *window,
DisplayDriver *driver);
DrawingEngine *driver);
virtual ~WinBorder();
virtual void Draw(const BRect &r);

View File

@ -10,7 +10,7 @@
#include "WorkspacesLayer.h"
#include "Workspace.h"
#include "RootLayer.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "AppServer.h"
#include "WinBorder.h"
@ -19,7 +19,7 @@
WorkspacesLayer::WorkspacesLayer(BRect frame, const char* name,
int32 token, uint32 resizeMode, uint32 flags, DisplayDriver* driver)
int32 token, uint32 resizeMode, uint32 flags, DrawingEngine* driver)
: Layer(frame, name, token, resizeMode, flags, driver)
{
}

View File

@ -17,7 +17,7 @@ class WinBorder;
class WorkspacesLayer : public Layer {
public:
WorkspacesLayer(BRect frame, const char* name, int32 token,
uint32 resize, uint32 flags, DisplayDriver* driver);
uint32 resize, uint32 flags, DrawingEngine* driver);
virtual ~WorkspacesLayer();
virtual void Draw(const BRect& updateRect);

View File

@ -6,9 +6,6 @@
* Stephan Aßmus <superstippi@gmx.de>
*/
/** Implementation of DisplayDriver based on top of Painter */
#include <stdio.h>
#include <algo.h>
#include <stack.h>
@ -78,32 +75,28 @@ class FontLocker {
// constructor
DisplayDriverPainter::DisplayDriverPainter(HWInterface* interface)
: DisplayDriver(),
fPainter(new Painter()),
DrawingEngine::DrawingEngine(HWInterface* interface)
: fPainter(new Painter()),
fGraphicsCard(interface),
fAvailableHWAccleration(0)
{
}
// destructor
DisplayDriverPainter::~DisplayDriverPainter()
DrawingEngine::~DrawingEngine()
{
delete fPainter;
}
// Initialize
status_t
DisplayDriverPainter::Initialize()
DrawingEngine::Initialize()
{
status_t err = B_ERROR;
if (WriteLock()) {
err = fGraphicsCard->Initialize();
if (err < B_OK)
fprintf(stderr, "HWInterface::Initialize() failed: %s\n", strerror(err));
if (err >= B_OK) {
err = DisplayDriver::Initialize();
}
WriteUnlock();
}
return err;
@ -111,14 +104,13 @@ DisplayDriverPainter::Initialize()
// Shutdown
void
DisplayDriverPainter::Shutdown()
DrawingEngine::Shutdown()
{
DisplayDriver::Shutdown();
}
// Update
void
DisplayDriverPainter::Update()
DrawingEngine::Update()
{
if (Lock()) {
fPainter->AttachToBuffer(fGraphicsCard->DrawingBuffer());
@ -130,13 +122,14 @@ DisplayDriverPainter::Update()
// SetHWInterface
void
DisplayDriverPainter::SetHWInterface(HWInterface* interface)
DrawingEngine::SetHWInterface(HWInterface* interface)
{
fGraphicsCard = interface;
}
// ConstrainClippingRegion
void DisplayDriverPainter::ConstrainClippingRegion(BRegion *region)
void
DrawingEngine::ConstrainClippingRegion(BRegion *region)
{
if (Lock()) {
if (!region) {
@ -265,7 +258,7 @@ is_above(const BRect& a, const BRect& b)
// CopyRegion
void
DisplayDriverPainter::CopyRegion(/*const*/ BRegion* region,
DrawingEngine::CopyRegion(/*const*/ BRegion* region,
int32 xOffset, int32 yOffset)
{
// NOTE: Write locking because we might use HW acceleration.
@ -395,7 +388,7 @@ DisplayDriverPainter::CopyRegion(/*const*/ BRegion* region,
// here. In any case, to copy overlapping regions in app_server doesn't
// make much sense to me.
void
DisplayDriverPainter::CopyRegionList(BList* list, BList* pList,
DrawingEngine::CopyRegionList(BList* list, BList* pList,
int32 rCount, BRegion* clipReg)
{
// NOTE: Write locking because we might use HW acceleration.
@ -415,7 +408,7 @@ DisplayDriverPainter::CopyRegionList(BList* list, BList* pList,
// InvertRect
void
DisplayDriverPainter::InvertRect(BRect r)
DrawingEngine::InvertRect(BRect r)
{
// NOTE: Write locking because we might use HW acceleration.
// This needs to be investigated, I'm doing this because of
@ -446,7 +439,7 @@ DisplayDriverPainter::InvertRect(BRect r)
// DrawBitmap
void
DisplayDriverPainter::DrawBitmap(ServerBitmap *bitmap,
DrawingEngine::DrawBitmap(ServerBitmap *bitmap,
const BRect &source, const BRect &dest,
const DrawState *d)
{
@ -468,7 +461,7 @@ DisplayDriverPainter::DrawBitmap(ServerBitmap *bitmap,
// FillArc
void
DisplayDriverPainter::FillArc(BRect r, const float &angle,
DrawingEngine::FillArc(BRect r, const float &angle,
const float &span, const DrawState *d)
{
if (Lock()) {
@ -496,7 +489,7 @@ DisplayDriverPainter::FillArc(BRect r, const float &angle,
// FillBezier
void
DisplayDriverPainter::FillBezier(BPoint *pts, const DrawState *d)
DrawingEngine::FillBezier(BPoint *pts, const DrawState *d)
{
if (Lock()) {
fGraphicsCard->HideSoftwareCursor();
@ -514,7 +507,7 @@ DisplayDriverPainter::FillBezier(BPoint *pts, const DrawState *d)
// FillEllipse
void
DisplayDriverPainter::FillEllipse(BRect r, const DrawState *d)
DrawingEngine::FillEllipse(BRect r, const DrawState *d)
{
if (Lock()) {
make_rect_valid(r);
@ -541,7 +534,7 @@ DisplayDriverPainter::FillEllipse(BRect r, const DrawState *d)
// FillPolygon
void
DisplayDriverPainter::FillPolygon(BPoint *ptlist, int32 numpts,
DrawingEngine::FillPolygon(BPoint *ptlist, int32 numpts,
BRect bounds, const DrawState *d)
{
if (Lock()) {
@ -563,7 +556,7 @@ DisplayDriverPainter::FillPolygon(BPoint *ptlist, int32 numpts,
// FillRect
void
DisplayDriverPainter::FillRect(BRect r, const RGBColor& color)
DrawingEngine::FillRect(BRect r, const RGBColor& color)
{
// NOTE: Write locking because we might use HW acceleration.
// This needs to be investigated, I'm doing this because of
@ -594,7 +587,7 @@ DisplayDriverPainter::FillRect(BRect r, const RGBColor& color)
// FillRect
void
DisplayDriverPainter::FillRect(BRect r, const DrawState *d)
DrawingEngine::FillRect(BRect r, const DrawState *d)
{
// NOTE: Write locking because we might use HW acceleration.
// This needs to be investigated, I'm doing this because of
@ -640,7 +633,7 @@ DisplayDriverPainter::FillRect(BRect r, const DrawState *d)
// FillRegion
void
DisplayDriverPainter::FillRegion(BRegion& r, const DrawState *d)
DrawingEngine::FillRegion(BRegion& r, const DrawState *d)
{
// NOTE: Write locking because we might use HW acceleration.
// This needs to be investigated, I'm doing this because of
@ -687,7 +680,7 @@ DisplayDriverPainter::FillRegion(BRegion& r, const DrawState *d)
// FillRoundRect
void
DisplayDriverPainter::FillRoundRect(BRect r,
DrawingEngine::FillRoundRect(BRect r,
const float &xrad, const float &yrad,
const DrawState *d)
{
@ -710,14 +703,14 @@ DisplayDriverPainter::FillRoundRect(BRect r,
// FillShape
void
DisplayDriverPainter::FillShape(const BRect &bounds,
DrawingEngine::FillShape(const BRect &bounds,
const int32 &opcount, const int32 *oplist,
const int32 &ptcount, const BPoint *ptlist,
const DrawState *d)
{
if (Lock()) {
printf("DisplayDriverPainter::FillShape() - what is this stuff that gets passed here?\n");
printf("DrawingEngine::FillShape() - what is this stuff that gets passed here?\n");
Unlock();
}
@ -725,7 +718,7 @@ printf("DisplayDriverPainter::FillShape() - what is this stuff that gets passed
// FillTriangle
void
DisplayDriverPainter::FillTriangle(BPoint *pts, BRect bounds,
DrawingEngine::FillTriangle(BPoint *pts, BRect bounds,
const DrawState *d)
{
if (Lock()) {
@ -746,7 +739,7 @@ DisplayDriverPainter::FillTriangle(BPoint *pts, BRect bounds,
// StrokeArc
void
DisplayDriverPainter::StrokeArc(BRect r, const float &angle,
DrawingEngine::StrokeArc(BRect r, const float &angle,
const float &span, const DrawState *d)
{
if (Lock()) {
@ -774,7 +767,7 @@ DisplayDriverPainter::StrokeArc(BRect r, const float &angle,
// StrokeBezier
void
DisplayDriverPainter::StrokeBezier(BPoint *pts, const DrawState *d)
DrawingEngine::StrokeBezier(BPoint *pts, const DrawState *d)
{
if (Lock()) {
fGraphicsCard->HideSoftwareCursor();
@ -791,7 +784,7 @@ DisplayDriverPainter::StrokeBezier(BPoint *pts, const DrawState *d)
// StrokeEllipse
void
DisplayDriverPainter::StrokeEllipse(BRect r, const DrawState *d)
DrawingEngine::StrokeEllipse(BRect r, const DrawState *d)
{
if (Lock()) {
make_rect_valid(r);
@ -823,7 +816,7 @@ DisplayDriverPainter::StrokeEllipse(BRect r, const DrawState *d)
// * this function is only used by Decorators
// * it assumes a one pixel wide line
void
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const RGBColor &color)
DrawingEngine::StrokeLine(const BPoint &start, const BPoint &end, const RGBColor &color)
{
if (Lock()) {
BRect touched(start, end);
@ -846,7 +839,7 @@ DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const R
// StrokeLine
void
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, DrawState* context)
DrawingEngine::StrokeLine(const BPoint &start, const BPoint &end, DrawState* context)
{
if (Lock()) {
BRect touched(start, end);
@ -868,7 +861,7 @@ DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, DrawSta
// StrokeLineArray
void
DisplayDriverPainter::StrokeLineArray(const int32 &numlines,
DrawingEngine::StrokeLineArray(const int32 &numlines,
const LineArrayData *linedata,
const DrawState *d)
{
@ -920,21 +913,21 @@ DisplayDriverPainter::StrokeLineArray(const int32 &numlines,
//
// * this function is only used by Decorators
void
DisplayDriverPainter::StrokePoint(const BPoint& pt, const RGBColor &color)
DrawingEngine::StrokePoint(const BPoint& pt, const RGBColor &color)
{
StrokeLine(pt, pt, color);
}
// StrokePoint
void
DisplayDriverPainter::StrokePoint(const BPoint& pt, DrawState *context)
DrawingEngine::StrokePoint(const BPoint& pt, DrawState *context)
{
StrokeLine(pt, pt, context);
}
// StrokePolygon
void
DisplayDriverPainter::StrokePolygon(BPoint* ptlist, int32 numpts,
DrawingEngine::StrokePolygon(BPoint* ptlist, int32 numpts,
BRect bounds, const DrawState* d,
bool closed)
{
@ -959,7 +952,7 @@ DisplayDriverPainter::StrokePolygon(BPoint* ptlist, int32 numpts,
//
// this function is used to draw a one pixel wide rect
void
DisplayDriverPainter::StrokeRect(BRect r, const RGBColor &color)
DrawingEngine::StrokeRect(BRect r, const RGBColor &color)
{
if (Lock()) {
make_rect_valid(r);
@ -987,7 +980,7 @@ DisplayDriverPainter::StrokeRect(BRect r, const RGBColor &color)
// StrokeRect
void
DisplayDriverPainter::StrokeRect(BRect r, const DrawState *d)
DrawingEngine::StrokeRect(BRect r, const DrawState *d)
{
if (Lock()) {
// support invalid rects
@ -1012,7 +1005,7 @@ DisplayDriverPainter::StrokeRect(BRect r, const DrawState *d)
// StrokeRegion
void
DisplayDriverPainter::StrokeRegion(BRegion& r, const DrawState *d)
DrawingEngine::StrokeRegion(BRegion& r, const DrawState *d)
{
if (Lock()) {
BRect clipped(r.Frame());
@ -1040,7 +1033,7 @@ DisplayDriverPainter::StrokeRegion(BRegion& r, const DrawState *d)
// StrokeRoundRect
void
DisplayDriverPainter::StrokeRoundRect(BRect r, const float &xrad,
DrawingEngine::StrokeRoundRect(BRect r, const float &xrad,
const float &yrad, const DrawState *d)
{
if (Lock()) {
@ -1064,13 +1057,13 @@ DisplayDriverPainter::StrokeRoundRect(BRect r, const float &xrad,
// StrokeShape
void
DisplayDriverPainter::StrokeShape(const BRect &bounds, const int32 &opcount,
DrawingEngine::StrokeShape(const BRect &bounds, const int32 &opcount,
const int32 *oplist, const int32 &ptcount,
const BPoint *ptlist, const DrawState *d)
{
if (Lock()) {
printf("DisplayDriverPainter::StrokeShape() - what is this stuff that gets passed here?\n");
printf("DrawingEngine::StrokeShape() - what is this stuff that gets passed here?\n");
Unlock();
}
@ -1078,7 +1071,7 @@ printf("DisplayDriverPainter::StrokeShape() - what is this stuff that gets passe
// StrokeTriangle
void
DisplayDriverPainter::StrokeTriangle(BPoint *pts, const BRect &bounds,
DrawingEngine::StrokeTriangle(BPoint *pts, const BRect &bounds,
const DrawState *d)
{
if (Lock()) {
@ -1101,7 +1094,7 @@ DisplayDriverPainter::StrokeTriangle(BPoint *pts, const BRect &bounds,
/*
// DrawString
void
DisplayDriverPainter::DrawString(const char *string, const int32 &length,
DrawingEngine::DrawString(const char *string, const int32 &length,
const BPoint &pt, const RGBColor &color,
escapement_delta *delta)
{
@ -1113,7 +1106,7 @@ DisplayDriverPainter::DrawString(const char *string, const int32 &length,
*/
// DrawString
void
DisplayDriverPainter::DrawString(const char* string, int32 length,
DrawingEngine::DrawString(const char* string, int32 length,
const BPoint& pt, DrawState* d,
escapement_delta* delta)
{
@ -1147,7 +1140,7 @@ DisplayDriverPainter::DrawString(const char* string, int32 length,
// StringWidth
float
DisplayDriverPainter::StringWidth(const char* string, int32 length,
DrawingEngine::StringWidth(const char* string, int32 length,
const DrawState* d,
escapement_delta* delta)
{
@ -1164,7 +1157,7 @@ DisplayDriverPainter::StringWidth(const char* string, int32 length,
// StringWidth
float
DisplayDriverPainter::StringWidth(const char* string, int32 length,
DrawingEngine::StringWidth(const char* string, int32 length,
const ServerFont& font,
escapement_delta* delta)
{
@ -1177,7 +1170,7 @@ DisplayDriverPainter::StringWidth(const char* string, int32 length,
// StringHeight
float
DisplayDriverPainter::StringHeight(const char *string, int32 length,
DrawingEngine::StringHeight(const char *string, int32 length,
const DrawState *d)
{
float height = 0.0;
@ -1193,35 +1186,35 @@ DisplayDriverPainter::StringHeight(const char *string, int32 length,
// Lock
bool
DisplayDriverPainter::Lock()
DrawingEngine::Lock()
{
return fGraphicsCard->WriteLock();
}
// Unlock
void
DisplayDriverPainter::Unlock()
DrawingEngine::Unlock()
{
fGraphicsCard->WriteUnlock();
}
// WriteLock
bool
DisplayDriverPainter::WriteLock()
DrawingEngine::WriteLock()
{
return fGraphicsCard->WriteLock();
}
// WriteUnlock
void
DisplayDriverPainter::WriteUnlock()
DrawingEngine::WriteUnlock()
{
fGraphicsCard->WriteUnlock();
}
// DumpToFile
bool
DisplayDriverPainter::DumpToFile(const char *path)
DrawingEngine::DumpToFile(const char *path)
{
if (Lock()) {
RenderingBuffer* buffer = fGraphicsCard->DrawingBuffer();
@ -1240,14 +1233,14 @@ DisplayDriverPainter::DumpToFile(const char *path)
// DumpToBitmap
ServerBitmap*
DisplayDriverPainter::DumpToBitmap()
DrawingEngine::DumpToBitmap()
{
return NULL;
}
// _CopyRect
BRect
DisplayDriverPainter::_CopyRect(BRect src, int32 xOffset, int32 yOffset) const
DrawingEngine::_CopyRect(BRect src, int32 xOffset, int32 yOffset) const
{
BRect dst;
RenderingBuffer* buffer = fGraphicsCard->DrawingBuffer();
@ -1288,7 +1281,7 @@ DisplayDriverPainter::_CopyRect(BRect src, int32 xOffset, int32 yOffset) const
// _CopyRect
void
DisplayDriverPainter::_CopyRect(uint8* src, uint32 width, uint32 height,
DrawingEngine::_CopyRect(uint8* src, uint32 width, uint32 height,
uint32 bpr, int32 xOffset, int32 yOffset) const
{
int32 xIncrement;

View File

@ -96,10 +96,10 @@ class HWInterface : public MultiLocker {
// BView::Draw() is called (if the cursor is within that views clipping region),
// then, after all drawing commands that triggered have been caried out,
// it shows the cursor again. This approach would have the adventage of
// the code not cluttering/slowing down DisplayDriverPainter.
// the code not cluttering/slowing down DrawingEngine.
// For now, we hide the cursor for any drawing operation that has
// a bounding box containing the cursor (in DisplayDriverPainter) so
// the cursor hiding is completely transparent from code using DisplayDriverPainter.
// a bounding box containing the cursor (in DrawingEngine) so
// the cursor hiding is completely transparent from code using DrawingEngine.
// ---
// NOTE: Investigate locking for these! The client code should already hold a
// ReadLock, but maybe these functions should acquire a WriteLock!