2 * Copyright 2005-2008, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
6 * Stephan Aßmus <superstippi@gmx.de>
10 #include "OffscreenWindow.h"
17 #include <WindowPrivate.h>
19 #include "BitmapHWInterface.h"
20 #include "DrawingEngine.h"
21 #include "ServerBitmap.h"
26 OffscreenWindow::OffscreenWindow(ServerBitmap
* bitmap
,
27 const char* name
, ::ServerWindow
* window
)
28 : Window(bitmap
->Bounds(), name
,
29 B_NO_BORDER_WINDOW_LOOK
, kOffscreenWindowFeel
,
30 0, 0, window
, new (nothrow
) DrawingEngine()),
32 fHWInterface(new (nothrow
) BitmapHWInterface(fBitmap
))
34 if (!fHWInterface
|| !GetDrawingEngine())
37 fHWInterface
->Initialize();
38 GetDrawingEngine()->SetHWInterface(fHWInterface
);
40 fVisibleRegion
.Set(fFrame
);
41 fVisibleContentRegion
.Set(fFrame
);
42 fVisibleContentRegionValid
= true;
43 fContentRegion
.Set(fFrame
);
44 fContentRegionValid
= true;
48 OffscreenWindow::~OffscreenWindow()
50 if (GetDrawingEngine())
51 GetDrawingEngine()->SetHWInterface(NULL
);
54 fHWInterface
->LockExclusiveAccess();
55 fHWInterface
->Shutdown();
56 fHWInterface
->UnlockExclusiveAccess();