1/*
2 * Copyright 2001-2009, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		DarkWyrm <bpmagic@columbus.rr.com>
7 */
8#ifndef BITMAP_MANAGER_H
9#define BITMAP_MANAGER_H
10
11
12#include <GraphicsDefs.h>
13#include <List.h>
14#include <Locker.h>
15#include <OS.h>
16#include <Rect.h>
17
18
19class ClientMemoryAllocator;
20class HWInterface;
21class ServerBitmap;
22
23
24class BitmapManager {
25public:
26								BitmapManager();
27	virtual						~BitmapManager();
28
29			ServerBitmap*		CreateBitmap(ClientMemoryAllocator* allocator,
30									HWInterface& hwInterface, BRect bounds,
31									color_space space, uint32 flags,
32									int32 bytesPerRow = -1,
33									int32 screen = B_MAIN_SCREEN_ID.id,
34									uint8* _allocationFlags = NULL);
35
36			ServerBitmap*		CloneFromClient(area_id clientArea,
37									int32 areaOffset, BRect bounds,
38									color_space space, uint32 flags,
39									int32 bytesPerRow = -1);
40
41			void				BitmapRemoved(ServerBitmap* bitmap);
42
43			void				SuspendOverlays();
44			void				ResumeOverlays();
45
46protected:
47			BList				fBitmapList;
48			BList				fOverlays;
49			BLocker				fLock;
50};
51
52extern BitmapManager* gBitmapManager;
53
54#endif	/* BITMAP_MANAGER_H */
55