12#if defined(BI_MULTI_THREAD_RTL)
16#if defined(__BORLANDC__)
40 enum {MaxEntries = 16};
52#if defined(BI_MULTI_THREAD_RTL)
57 TEntry Entries[MaxEntries];
63static TMemDCCache& GetMemDCCache()
65#if defined(BI_MULTI_THREAD_RTL)
82#if defined(BI_MULTI_THREAD_RTL)
91TMemDCCache::TMemDCCache()
94 for (
int i = 0;
i < MaxEntries;
i++) {
95 Entries[
i].Handle =
nullptr;
96 Entries[
i].Busy =
false;
103TMemDCCache::~TMemDCCache()
106 for (
int i = 0;
i < MaxEntries && Entries[
i].Handle;
i++) {
108 static_cast<void*
>(Entries[
i].Handle) <<
_T(
" in MemDCCache at destruction"));
121 for (
int i = 0;
i < MaxEntries;
i++) {
122 if (!Entries[
i].Handle) {
130 if (!Entries[
i].Busy) {
131 Entries[
i].Busy =
true;
132 return Entries[
i].Handle;
142TMemDCCache::Release(
HDC hDC)
145 for (
int i = 0;
i < MaxEntries && Entries[
i].Handle;
i++) {
146 if (Entries[
i].Handle ==
hDC) {
147 WARNX(
OwlGDI, !Entries[
i].Busy, 0,
"Releasing non-busy DC " <<
148 static_cast<void*
>(Entries[
i].Handle) <<
" in MemDCCache");
149 Entries[
i].Busy =
false;
213#if defined(OWL5_COMPAT)
244 Handle = GetMemDCCache().Get();
260 GetMemDCCache().Release(
GetHDC());
#define WARNX(group, condition, level, message)
#define DIAG_DECLARE_GROUP(group)
TBitmap is the GDI bitmap class derived from TGdiObject.
An abstract TDC class, TCreatedDC serves as the base for DCs that are created and deleted.
TDC is the root class for GDI DC wrappers.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
void CheckValid(uint resId=IDS_GDIFAILURE)
bool ShouldDelete
< The handle of this DC. Uses the base class's handle (TGdiBase::Handle.)
HANDLE Handle
< make this function available to derivatives
HDC GetHDC() const
Return the handle of the device context.
TMemoryDC()
Constructs a screen-compatible memory DC.
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Object Windows Library (OWLNext Core)