haiku/headers/private/servers/app/RenderingBuffer.h
Stephan Aßmus 359c905c57 offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 16:17:16 +00:00

34 lines
777 B
C++

// RenderingBuffer.h
#ifndef RENDERING_BUFFER_H
#define RENDERING_BUFFER_H
#include <GraphicsDefs.h>
#include <Rect.h>
class RenderingBuffer {
public:
RenderingBuffer() {}
virtual ~RenderingBuffer() {}
virtual status_t InitCheck() const = 0;
virtual color_space ColorSpace() const = 0;
virtual void* Bits() const = 0;
virtual uint32 BytesPerRow() const = 0;
// the *count* of the pixels per line
virtual uint32 Width() const = 0;
// the *count* of lines
virtual uint32 Height() const = 0;
inline uint32 BitsLength() const
{ return Height() * BytesPerRow(); }
inline BRect Bounds() const
{ return BRect(0.0, 0.0,
Width() - 1,
Height() - 1); }
};
#endif // RENDERING_BUFFER_H