cleanup the defines, move old DisplayDriver implementations out because they are currently unused and won't build

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12438 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-04-18 18:48:19 +00:00
parent 74b3612ac3
commit 3dea4bb659
19 changed files with 15 additions and 92 deletions

View File

@ -8,50 +8,16 @@
#define TEST_MODE 1
#endif
// The ViewDriver is a BView/BWindow combination. Plenty of functionality,
// but dog-slow.
#define VIEWDRIVER 0
// The ScreenDriver utilizes a BWindowScreen to directly access the video
// hardware.
#define SCREENDRIVER 1
// The SecondDriver allows the server to make use of a second video card while
// still running as a regular BeOS application. You could say it's training
// wheels for the HWDriver
#define SECONDDRIVER 2
// The HWDriver is the real thing - loads all the graphics hardware and
// literally takes over the system as the app_server is supposed to. This
// one can be used only when the app_server is running as *the* app_server
// and not in testing mode like the other drivers are for.
#define HWDRIVER 3
#define DIRECTDRIVER 4
// The Painter driver will be a complete app_server drawing backend based on
// the Anti-Grain Geometry 2D graphics engine. The Painter class encapsulates
// all AGG related functionality, while the DisplayDriverPainter class uses
// a Painter object to implement all app_server required drawing functions.
#define PAINTERDRIVER 5
// Display driver to be used by the server.
#ifndef DISPLAYDRIVER
# define DISPLAYDRIVER PAINTERDRIVER
//# define DISPLAYDRIVER VIEWDRIVER
#endif
// Uncomment this if the DisplayDriver should only rely on drawing functions implemented
// in software even though hardware-accelerated functions are available
// NOTE: everything is software right now (since DisplayDriverPainter)
//#define DISABLE_HARDWARE_ACCELERATION
// Define this for a quick hack to test some of the drawing functions
//#define DISPLAYDRIVER_TEST_HACK
// Define this if you want the display driver to emulate the input server.
// Comment this out if DISPLAYDRIVER is defined as HWDRIVER.
#if DISPLAYDRIVER != HWDRIVER
#if TEST_MODE
# define ENABLE_INPUT_SERVER_EMULATION
#endif

View File

@ -31,6 +31,7 @@
#include "AppServer.h"
#include "Desktop.h"
#include "DisplayDriver.h"
#include "DisplayDriverPainter.h"
#include "Globals.h"
#include "Layer.h"
#include "RootLayer.h"
@ -41,17 +42,6 @@
#include "WinBorder.h"
#include "Workspace.h"
#if DISPLAYDRIVER == HWDRIVER
// #include "AccelerantDriver.h"
#include "DisplayDriverPainter.h"
#elif DISPLAYDRIVER == DIRECTDRIVER
#include "DirectDriver.h"
#elif DISPLAYDRIVER == PAINTERDRIVER
#include "DisplayDriverPainter.h"
#else
#include "ViewDriver.h"
#endif
//#define DEBUG_DESKTOP
#ifdef DEBUG_DESKTOP
@ -87,35 +77,17 @@ Desktop::Init(void)
{
DisplayDriver *driver = NULL;
#if DISPLAYDRIVER == HWDRIVER
// If we're using the AccelerantDriver for rendering, eventually we will loop through
// drivers until one can't initialize in order to support multiple monitors. For now,
// we'll just load one and be done with it.
// Eventually we will loop through drivers until
// one can't initialize in order to support multiple monitors.
// For now, we'll just load one and be done with it.
bool initDrivers = true;
while (initDrivers) {
// driver = new AccelerantDriver();
driver = new DisplayDriverPainter();
AddDriver(driver);
initDrivers = false;
}
#elif DISPLAYDRIVER == DIRECTDRIVER
// It would be nice to have this for the default testing driver. Someday....
driver = new DirectDriver();
AddDriver(driver);
#elif DISPLAYDRIVER == PAINTERDRIVER
// It would be nice to have this for the default testing driver. Someday....
driver = new DisplayDriverPainter();
AddDriver(driver);
#else
// It would be nice to not ever need this again....
driver = new ViewDriver();
AddDriver(driver);
#endif
if (fScreenList.CountItems() < 1) {
delete this;
return;
@ -137,7 +109,7 @@ Desktop::AddDriver(DisplayDriver *driver)
// Screen *sc = new Screen(driver, BPoint(640, 480), B_GRAY8, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_RGB15, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_RGB16, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(1024, 768), B_RGB32, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(800, 600), B_RGB32, fScreenList.CountItems()+1);
fScreenList.AddItem(sc);
} else {
driver->Shutdown();

View File

@ -16,14 +16,13 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) drawing ] ;
if ( $(TARGET_PLATFORM) = haiku ) {
# This overrides the definitions in private/servers/app/ServerConfig.h
defines = [ FDefines DISPLAYDRIVER=HWDRIVER TEST_MODE=0 ] ;
defines = [ FDefines TEST_MODE=0 ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
VIEW_DRIVER_SOURCES =
AccelerantBuffer.cpp
# AccelerantDriver.cpp
AccelerantHWInterface.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
@ -33,21 +32,14 @@ if ( $(TARGET_PLATFORM) = haiku ) {
} else {
VIEW_DRIVER_SOURCES =
fake_input_server.cpp
# AccelerantDriver.cpp
# BitmapDriver.cpp
# ViewDriver.cpp
# DirectDriver.cpp
# We'll just remove this from the build for a little while...
#ScreenDriver.cpp
# Painter based DisplayDriver Classes
BitmapBuffer.cpp
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
MallocBuffer.cpp
UpdateQueue.cpp
ViewHWInterface.cpp
AccelerantHWInterface.cpp
;
}
@ -57,7 +49,6 @@ SharedLibrary appserver :
BitmapManager.cpp
ColorSet.cpp
CursorData.cpp
CursorHandler.cpp
Decorator.cpp
FontFamily.cpp
GraphicsBuffer.cpp
@ -76,10 +67,7 @@ SharedLibrary appserver :
# drawing
PatternHandler.cpp
PixelRenderer.cpp
DisplayDriver.cpp
#DisplayDriverImpl.cpp
DisplaySupport.cpp
;
Server app_server :
@ -99,7 +87,6 @@ Server app_server :
# DisplayDriver Classes
$(VIEW_DRIVER_SOURCES)
# Clipper.cpp
DefaultDecorator.cpp
Layer.cpp
RootLayer.cpp

View File

@ -58,8 +58,6 @@
#define STRACE(a) /* nothing */
#endif
//#define DISPLAYDRIVER_TEST_HACK
RootLayer::RootLayer(const char *name, int32 workspaceCount,
Desktop *desktop, DisplayDriver *driver)
: Layer(BRect(0,0,0,0), name, 0, B_FOLLOW_ALL, B_WILL_DRAW, driver)
@ -1407,7 +1405,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
}
}
#else // DISPLAYDRIVER != HWDRIVER
#else // TEST_MODE
// F12
if(scancode>0x1 && scancode<0xe)
{
@ -1479,7 +1477,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
}
}
#endif // DISPLAYDRIVER != HWDRIVER
#endif // !TEST_MODE
// We got this far, so apparently it's safe to pass to the active
// window.
@ -1543,7 +1541,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
STRACE(("Key Up: 0x%lx\n",scancode));
#if DISPLAYDRIVER == HWDRIVER
#if !TEST_MODE
// Tab key
if(scancode==0x26 && (modifiers & B_CONTROL_KEY))
{
@ -1554,7 +1552,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
//}
}
#else // DISPLAYDRIVER != HWDRIVER
#else // TEST_MODE
if(scancode==0x26 && (modifiers & B_LEFT_SHIFT_KEY))
{
//ServerApp *deskbar=app_server->FindApp("application/x-vnd.Be-TSKB");
@ -1941,4 +1939,4 @@ void RootLayer::show_final_scene(WinBorder *exFocus, WinBorder *exActive)
fLastMouseMoved = LayerAt(fLastMousePossition);
if (fLastMouseMoved == NULL)
debugger("RootLayer::KeyboardEventHandler: 'fLastMouseMoved' can't be null.\n");
}
}

View File

@ -379,7 +379,7 @@ int32 ServerApp::MonitorApp(void *data)
// If we are using the real, accelerated version of the
// DisplayDriver, we do NOT want the user to be able shut down
// the server. The results would NOT be pretty
#if DISPLAYDRIVER != HWDRIVER
#if TEST_MODE
BMessage pleaseQuit(B_QUIT_REQUESTED);
app->SendMessageToClient(&pleaseQuit);
#endif