xref: /haiku/src/servers/app/drawing/interface/local/AccelerantBuffer.h (revision 268f99dd7dc4bd7474a8bd2742d3f1ec1de6752a)
1 /*
2  * Copyright 2005 Michael Lotz <mmlr@mlotz.ch>
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef ACCELERANT_BUFFER_H
6 #define ACCELERANT_BUFFER_H
7 
8 #include <Accelerant.h>
9 #include "RenderingBuffer.h"
10 
11 class AccelerantBuffer : public RenderingBuffer {
12 public:
13 								AccelerantBuffer();
14 								AccelerantBuffer(const display_mode& mode,
15 									const frame_buffer_config& config);
16 								AccelerantBuffer(const AccelerantBuffer& other,
17 									bool offscreenBuffer = false);
18 	virtual						~AccelerantBuffer();
19 
20 	virtual	status_t			InitCheck() const;
IsGraphicsMemory()21 	virtual	bool				IsGraphicsMemory() const { return true; /* TODO! */ }
22 
23 	virtual	color_space			ColorSpace() const;
24 	virtual	void*				Bits() const;
25 	virtual	uint32				BytesPerRow() const;
26 	virtual	uint32				Width() const;
27 	virtual	uint32				Height() const;
28 
29 			void				SetDisplayMode(const display_mode& mode);
30 			void				SetFrameBufferConfig(
31 									const frame_buffer_config& config);
32 			void				SetOffscreenBuffer(bool offscreenBuffer);
33 
34 private:
35 			display_mode		fDisplayMode;
36 			frame_buffer_config	fFrameBufferConfig;
37 
38 			bool				fDisplayModeSet : 1;
39 			bool				fFrameBufferConfigSet : 1;
40 			bool				fIsOffscreenBuffer : 1;
41 };
42 
43 #endif // ACCELERANT_BUFFER_H
44