diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-10 14:01:53 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-11 12:51:50 +0200 |
commit | 9bbecbaea359350c2e0d78ebe4dcd10d16dccbee (patch) | |
tree | d52f4e73ce4f868415c01e6ff4586c37cf75f678 /vcl/inc/win | |
parent | fd7afc0a660992cb99650e3ea26cafd226899093 (diff) |
Use COMReference in D2DWriteTextOutRenderer
... and simplify the related code.
Change-Id: Idaef7c9d725273e202948158e45ded7e7a2f85a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165985
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/inc/win')
-rw-r--r-- | vcl/inc/win/DWriteTextRenderer.hxx | 8 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 7 |
2 files changed, 6 insertions, 9 deletions
diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx index b822a6bca488..1cdf67d04a39 100644 --- a/vcl/inc/win/DWriteTextRenderer.hxx +++ b/vcl/inc/win/DWriteTextRenderer.hxx @@ -23,6 +23,8 @@ #include <d2d1.h> #include <dwrite.h> +#include <systools/win32/comtools.hxx> + #include <win/winlayout.hxx> enum class D2DTextAntiAliasMode @@ -37,7 +39,6 @@ class D2DWriteTextOutRenderer : public TextOutRenderer { public: explicit D2DWriteTextOutRenderer(bool bRenderingModeNatural); - virtual ~D2DWriteTextOutRenderer() override; bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, @@ -62,9 +63,8 @@ private: IDWriteFontFace* GetDWriteFace(const WinFontInstance& rWinFont, float * lfSize) const; bool performRender(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool& bRetry, bool bRenderingModeNatural); - ID2D1Factory * mpD2DFactory; - IDWriteFactory * mpDWriteFactory; - ID2D1DCRenderTarget * mpRT; + sal::systools::COMReference<ID2D1Factory> mpD2DFactory; + sal::systools::COMReference<ID2D1DCRenderTarget> mpRT; const D2D1_RENDER_TARGET_PROPERTIES mRTProps; bool mbRenderingModeNatural; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 80fafdeba56f..19edee0f4440 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -166,10 +166,6 @@ private: RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data int mnPenWidth; // line width - inline static sal::systools::COMReference<IDWriteFactory> mxDWriteFactory; - inline static sal::systools::COMReference<IDWriteGdiInterop> mxDWriteGdiInterop; - inline static bool bDWriteDone = false; - // just call both from setHDC! void InitGraphics(); void DeInitGraphics(); @@ -198,7 +194,8 @@ public: SCREEN }; - static void getDWriteFactory(IDWriteFactory** pFactory, IDWriteGdiInterop** pInterop = nullptr); + static IDWriteFactory* getDWriteFactory(); + static IDWriteGdiInterop* getDWriteGdiInterop(); public: |