[Libreoffice-commits] core.git: vcl/inc vcl/win
Michael Stahl
mstahl at redhat.com
Mon Apr 24 16:42:17 UTC 2017
vcl/inc/win/saldata.hxx | 4 +++-
vcl/win/gdi/winlayout.cxx | 18 ++++++++++++------
2 files changed, 15 insertions(+), 7 deletions(-)
New commits:
commit 2eb91035c2f60e9dc476336474d51b23b666bb04
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Apr 24 18:21:50 2017 +0200
tdf#107205 vcl: don't always use D2DWriteTextOutRenderer
... because it cannot rotate text.
(regression from commit df556aa47da22f96b3fcd356c12419d3035cba3c)
Change-Id: If9bc6e98b8979c5eb02f1a5cfc12b4d19bdc481b
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;
}
More information about the Libreoffice-commits
mailing list