From a2d01f224f25e699b0056703f1124fdee5da78d5 Mon Sep 17 00:00:00 2001 From: shadow303 Date: Mon, 3 Nov 2003 01:55:14 +0000 Subject: [PATCH] Add GetColor15 to RGBColor Prep DisplayDriver for consolidated driver code git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5244 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/servers/app/DisplayDriver.h | 29 +++++++++++++++++++++ headers/private/servers/app/RGBColor.h | 4 ++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/headers/private/servers/app/DisplayDriver.h b/headers/private/servers/app/DisplayDriver.h index c00f22f2aa..b866f345bc 100644 --- a/headers/private/servers/app/DisplayDriver.h +++ b/headers/private/servers/app/DisplayDriver.h @@ -78,6 +78,31 @@ typedef struct #endif +class AccLineCalc +{ +public: + AccLineCalc(); + AccLineCalc(const BPoint &pta, const BPoint &ptb); + void SetPoints(const BPoint &pta, const BPoint &ptb); + float GetX(float y); + float GetY(float x); + float Slope(void) { return slope; } + float Offset(void) { return offset; } + float MinX(); + float MinY(); + float MaxX(); + float MaxY(); + void Swap(AccLineCalc &from); +private: + float slope; + float offset; + BPoint start, end; + float minx; + float miny; + float maxx; + float maxy; +}; + /*! \class DisplayDriver DisplayDriver.h \brief Mostly abstract class which handles all graphics output for the server. @@ -170,6 +195,10 @@ protected: void _SetDPMSCapabilities(uint32 caps); void _SetDPMSState(uint32 state); ServerCursor *_GetCursor(void); + virtual void HLine(int32 x1, int32 x2, int32 y, PatternHandler *pat); + virtual void HLineThick(int32 x1, int32 x2, int32 y, int32 thick, PatternHandler *pat); + virtual void SetPixel(int x, int y, RGBColor col); + virtual void SetThickPixel(int x, int y, int thick, PatternHandler *pat); private: BLocker *_locker; diff --git a/headers/private/servers/app/RGBColor.h b/headers/private/servers/app/RGBColor.h index 896584b578..777a5c3e01 100644 --- a/headers/private/servers/app/RGBColor.h +++ b/headers/private/servers/app/RGBColor.h @@ -52,6 +52,7 @@ public: void PrintToStream(void) const; uint8 GetColor8(void); + uint16 GetColor15(void); uint16 GetColor16(void); rgb_color GetColor32(void) const; @@ -71,8 +72,9 @@ public: protected: rgb_color color32; uint16 color16; + uint16 color15; uint8 color8; - bool update8,update16; + bool update8,update15,update16; }; #endif