Added some direct-buffer acces functions to DisplayDriver

Slight ServerFont tweak


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6476 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2004-02-03 00:51:23 +00:00
parent f856b083a7
commit 871efa51a3
2 changed files with 41 additions and 12 deletions
+29 -1
View File
@@ -42,9 +42,11 @@
#include <Region.h>
#include "PatternHandler.h"
#include "LayerData.h"
#include "ServerBitmap.h"
#include <ft2build.h>
#include FT_FREETYPE_H
class ServerCursor;
class ServerBitmap;
#ifndef ROUND
#define ROUND(a) ( (long)(a+.5) )
@@ -116,6 +118,22 @@ private:
float maxy;
};
/*!
\class FBBitmap DisplayDriver.h
\brief Class used for easily passing around information about the framebuffer
*/
class FBBitmap : public ServerBitmap
{
public:
FBBitmap(void) : ServerBitmap(BRect(0,0,0,0),B_NO_COLOR_SPACE,0) { }
~FBBitmap(void) { }
void SetBytesPerRow(const int32 &bpr) { _bytesperrow=bpr; }
void SetSpace(const color_space &space) { _space=space; }
void SetSize(const int32 &w, const int32 &h) { _width=w; _height=h; }
void SetBuffer(void *ptr) { _buffer=(uint8*)ptr; }
void SetBitsPerPixel(color_space space,int32 bytesperline) { _HandleSpace(space,bytesperline); }
};
/*!
\class DisplayDriver DisplayDriver.h
\brief Mostly abstract class which handles all graphics output for the server.
@@ -248,6 +266,16 @@ protected:
// virtual void FillPatternRect(int32 left, int32 top, int32 right, int32 bottom);
virtual void SetThickPatternPixel(int x, int y);
// Blit functions specific to FreeType2 glyph copying. These probably could be replaced with
// more generic functions, but these are written and can be replaced later.
void BlitMono2RGB32(FT_Bitmap *src, const BPoint &pt, const DrawData *d);
void BlitGray2RGB32(FT_Bitmap *src, const BPoint &pt, const DrawData *d);
// Two functions for gaining direct access to the framebuffer of a child class. This removes the need
// for a set of glyph-blitting virtual functions for each driver.
virtual bool AcquireBuffer(FBBitmap *bmp);
virtual void ReleaseBuffer(void);
void FillArc(const BRect &r, const float &angle, const float &span, DisplayDriver*, SetHorizontalLineFuncType setLine);
void FillBezier(BPoint *pts, DisplayDriver* driver, SetHorizontalLineFuncType setLine);
void FillEllipse(const BRect &r, DisplayDriver* driver, SetHorizontalLineFuncType setLine);