From 209e859c3e78d5818df3e3f84669aaa2a3810c01 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Apr 2023 13:46:00 +0200 Subject: 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 --- vcl/inc/win/saldata.hxx | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'vcl/inc/win/saldata.hxx') 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 +#include #include #include @@ -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 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 ); -- cgit