summaryrefslogtreecommitdiff
path: root/vcl/inc/win/saldata.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@collabora.co.uk>2023-04-12 13:46:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-04-13 10:04:42 +0200
commit209e859c3e78d5818df3e3f84669aaa2a3810c01 (patch)
treee6ebfb69fd72263118802b1cdf0241256f1985c5 /vcl/inc/win/saldata.hxx
parent17367a67cd39109006060176b04bc2b174a17e48 (diff)
no need to allocate these separately
Change-Id: Icc24e0aaf1762e5b318b8364dd9fdb496edfb77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150279 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc/win/saldata.hxx')
-rw-r--r--vcl/inc/win/saldata.hxx33
1 files changed, 17 insertions, 16 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index c391086b30a1..b5740d5670a4 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -21,6 +21,7 @@
#include <config_features.h>
+#include <array>
#include <memory>
#include <osl/module.h>
@@ -53,6 +54,21 @@ class SkiaControlsCache;
#define MAX_STOCKBRUSH 4
#define SAL_CLIPRECT_COUNT 16
+#define CACHESIZE_HDC 3
+#define CACHED_HDC_1 0
+#define CACHED_HDC_2 1
+#define CACHED_HDC_DRAW 2
+#define CACHED_HDC_DEFEXT 64
+
+struct HDCCache
+{
+ HDC mhDC = 0;
+ HPALETTE mhDefPal = 0;
+ HBITMAP mhDefBmp = 0;
+ HBITMAP mhSelBmp = 0;
+ HBITMAP mhActBmp = 0;
+};
+
struct SalIcon
{
int nId;
@@ -96,7 +112,7 @@ public:
WinSalObject* mpFirstObject; // pointer of first object window
WinSalVirtualDevice* mpFirstVD; // first VirDev
WinSalPrinter* mpFirstPrinter; // first printing printer
- HDCCache* mpHDCCache; // Cache for three DC's
+ std::array<HDCCache, CACHESIZE_HDC> maHDCCache; // Cache for three DC's
HBITMAP mh50Bmp; // 50% Bitmap
HBRUSH mh50Brush; // 50% Brush
COLORREF maStockPenColorAry[MAX_STOCKPEN];
@@ -139,21 +155,6 @@ struct SalShlData
extern SalShlData aSalShlData;
-#define CACHESIZE_HDC 3
-#define CACHED_HDC_1 0
-#define CACHED_HDC_2 1
-#define CACHED_HDC_DRAW 2
-#define CACHED_HDC_DEFEXT 64
-
-struct HDCCache
-{
- HDC mhDC;
- HPALETTE mhDefPal;
- HBITMAP mhDefBmp;
- HBITMAP mhSelBmp;
- HBITMAP mhActBmp;
-};
-
void ImplClearHDCCache( SalData* pData );
HDC ImplGetCachedDC( sal_uLong nID, HBITMAP hBmp = nullptr );
void ImplReleaseCachedDC( sal_uLong nID );