Make UEFI boot-platform build again
[haiku.git] / src / servers / app / OffscreenWindow.cpp
blob1e8eaffc3f4745f127013dcd2edead64da5922da
1 /*
2 * Copyright 2005-2008, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Author:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
10 #include "OffscreenWindow.h"
12 #include <new>
13 #include <stdio.h>
15 #include <Debug.h>
17 #include <WindowPrivate.h>
19 #include "BitmapHWInterface.h"
20 #include "DrawingEngine.h"
21 #include "ServerBitmap.h"
23 using std::nothrow;
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()),
31 fBitmap(bitmap),
32 fHWInterface(new (nothrow) BitmapHWInterface(fBitmap))
34 if (!fHWInterface || !GetDrawingEngine())
35 return;
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);
53 if (fHWInterface) {
54 fHWInterface->LockExclusiveAccess();
55 fHWInterface->Shutdown();
56 fHWInterface->UnlockExclusiveAccess();
57 delete fHWInterface;