diff options
-rw-r--r-- | vcl/inc/win/saldata.hxx | 4 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index c38cc56a71bf..698e923f7b03 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -123,7 +123,9 @@ public: std::map< UINT,sal_uInt16 > maVKMap; // map some dynamic VK_* entries // must be deleted before exit(), so delete it in DeInitSalData() - std::unique_ptr<TextOutRenderer> m_pTextOutRenderer; + std::unique_ptr<TextOutRenderer> m_pD2DWriteTextOutRenderer; + // tdf#107205 need 2 instances because D2DWrite can't rotate text + std::unique_ptr<TextOutRenderer> m_pExTextOutRenderer; std::unique_ptr<GlobalGlyphCache> m_pGlobalGlyphCache; std::unique_ptr<TheTextureCache> m_pTextureCache; }; diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 8bea277c8dde..de1b852fed5f 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -258,18 +258,24 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite) abort(); } - if (!pSalData->m_pTextOutRenderer) + if (bUseDWrite) { - if (bUseDWrite && D2DWriteTextOutRenderer::InitModules()) + static bool const bSuccess(D2DWriteTextOutRenderer::InitModules()); + if (bSuccess && !pSalData->m_pD2DWriteTextOutRenderer) { - pSalData->m_pTextOutRenderer.reset(new D2DWriteTextOutRenderer()); + pSalData->m_pD2DWriteTextOutRenderer.reset(new D2DWriteTextOutRenderer()); } - else + if (pSalData->m_pD2DWriteTextOutRenderer) { - pSalData->m_pTextOutRenderer.reset(new ExTextOutRenderer); + return *pSalData->m_pD2DWriteTextOutRenderer; } + // else: fall back to GDI } - return *pSalData->m_pTextOutRenderer; + if (!pSalData->m_pExTextOutRenderer) + { + pSalData->m_pExTextOutRenderer.reset(new ExTextOutRenderer); + } + return *pSalData->m_pExTextOutRenderer; } |