haiku/src/servers/app/OffscreenWindowLayer.cpp
Stephan Aßmus 2cfe93e780 * renamed HWInterface locking to LockParallelAccess() and
LockExclusiveAccess() (meaning more or less access to the
  frame buffer)
* extracted the AGGTextRenderer to be a global instance used
  by each Painter instance (currently, it is thread safe because
  of the global font lock, so there is some work left in this
  regard)
* gave every ServerWindow it's own DrawingEngine instance, this
  is work in progress. So far, there doesn't seem to be a regression,
  but less fighting over the exclusive access to the frame buffer, now
  each ServerWindow thread can draw in parallel. There is room for
  improvement, plus I think I'm leaking the DrawingEngine...
* changed the locking for the software cursor. ShowSoftwareCursor()
  can only be called if HideSoftwareCursor(BRect) returned true, or
  if you called the generic HideSoftwareCursor(), since it needs
  to keep the cursor lock and unlocks in Show...!
* some clean up and renaming in Decorator and friends
* moved PatternHandler.h to live along with the .cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19427 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-12-04 22:25:17 +00:00

50 lines
1.1 KiB
C++

/*
* Copyright 2005, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Author:
* Stephan Aßmus <superstippi@gmx.de>
*/
#include "BitmapHWInterface.h"
#include "DrawingEngine.h"
#include "OffscreenWindowLayer.h"
#include "ServerBitmap.h"
#include <Debug.h>
#include "DebugInfoManager.h"
#include <stdio.h>
OffscreenWindowLayer::OffscreenWindowLayer(ServerBitmap* bitmap,
const char* name, ::ServerWindow* window)
: WindowLayer(bitmap->Bounds(), name,
B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
0, 0, window, new DrawingEngine()),
fBitmap(bitmap),
fHWInterface(new BitmapHWInterface(fBitmap))
{
fHWInterface->Initialize();
GetDrawingEngine()->SetHWInterface(fHWInterface);
fVisibleRegion.Set(fFrame);
fVisibleContentRegion.Set(fFrame);
fVisibleContentRegionValid = true;
fContentRegion.Set(fFrame);
fContentRegionValid = true;
}
OffscreenWindowLayer::~OffscreenWindowLayer()
{
fHWInterface->LockExclusiveAccess();
// Unlike normal Layers, we own the DrawingEngine instance
delete GetDrawingEngine();
fHWInterface->Shutdown();
fHWInterface->UnlockExclusiveAccess();
delete fHWInterface;
}