summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-05-10 12:48:13 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2018-05-11 00:16:39 +0200
commita909afbc21e8cdd03a7f27db798f830c76aa91d2 (patch)
tree540641dd83ebf9f51556306022026600e567fb1c /vcl/win
parente37135d4139f7c614c46fff6f82d519a05f1d9f8 (diff)
Fold CommonSalLayout into GenericSalLayout
Now the crazy constructors of CommonSalLayout are gone, we can merge the two and drop one level of indirection. Change-Id: I166e4ed2c9d22c1ce75246d486f7526c4928f652 Reviewed-on: https://gerrit.libreoffice.org/54077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/DWriteTextRenderer.cxx5
-rw-r--r--vcl/win/gdi/winlayout.cxx23
2 files changed, 13 insertions, 15 deletions
diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx
index 8006d3f7d0d5..27f24a9332d6 100644
--- a/vcl/win/gdi/DWriteTextRenderer.cxx
+++ b/vcl/win/gdi/DWriteTextRenderer.cxx
@@ -25,7 +25,6 @@
#include <sft.hxx>
#include <sallayout.hxx>
-#include <CommonSalLayout.hxx>
#include <shlwapi.h>
#include <winver.h>
@@ -233,7 +232,7 @@ HRESULT D2DWriteTextOutRenderer::BindDC(HDC hDC, tools::Rectangle const & rRect)
return CHECKHR(mpRT->BindDC(hDC, &rc));
}
-bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const & rLayout, SalGraphics& rGraphics, HDC hDC)
+bool D2DWriteTextOutRenderer::operator ()(GenericSalLayout const & rLayout, SalGraphics& rGraphics, HDC hDC)
{
bool bRetry = false;
bool bResult = false;
@@ -247,7 +246,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const & rLayout, SalGr
return bResult;
}
-bool D2DWriteTextOutRenderer::performRender(CommonSalLayout const & rLayout, SalGraphics& rGraphics, HDC hDC, bool& bRetry)
+bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, SalGraphics& rGraphics, HDC hDC, bool& bRetry)
{
if (!Ready())
return false;
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 3b7b6c044083..95034c97372b 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -35,7 +35,6 @@
#include <sft.hxx>
#include <sallayout.hxx>
-#include <CommonSalLayout.hxx>
#include <win/ScopedHDC.hxx>
#include <cstdio>
@@ -226,7 +225,7 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite)
}
-bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
+bool ExTextOutRenderer::operator ()(GenericSalLayout const &rLayout,
SalGraphics & /*rGraphics*/,
HDC hDC)
{
@@ -234,7 +233,7 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
HFONT hAltFont = nullptr;
bool bUseAltFont = false;
bool bShift = false;
- if (rLayout.getFont().GetFontSelectPattern().mbVertical)
+ if (rLayout.GetFont().GetFontSelectPattern().mbVertical)
{
LOGFONTW aLogFont;
GetObjectW(hFont, sizeof(aLogFont), &aLogFont);
@@ -291,7 +290,7 @@ std::unique_ptr<SalLayout> WinSalGraphics::GetTextLayout(ImplLayoutArgs& /*rArgs
assert(mpWinFontEntry[nFallbackLevel]->GetFontFace());
mpWinFontEntry[nFallbackLevel]->SetHDC(getHDC());
- CommonSalLayout *aLayout = new CommonSalLayout(*mpWinFontEntry[nFallbackLevel]);
+ GenericSalLayout *aLayout = new GenericSalLayout(*mpWinFontEntry[nFallbackLevel]);
return std::unique_ptr<SalLayout>(aLayout);
}
@@ -381,14 +380,14 @@ void WinFontInstance::SetHDC(const HDC hDC)
m_hDC = hDC;
}
-bool WinSalGraphics::CacheGlyphs(const CommonSalLayout& rLayout)
+bool WinSalGraphics::CacheGlyphs(const GenericSalLayout& rLayout)
{
static bool bDoGlyphCaching = (std::getenv("SAL_DISABLE_GLYPH_CACHING") == nullptr);
if (!bDoGlyphCaching)
return false;
HDC hDC = getHDC();
- WinFontInstance& rFont = *static_cast<WinFontInstance*>(&rLayout.getFont());
+ WinFontInstance& rFont = *static_cast<WinFontInstance*>(&rLayout.GetFont());
int nStart = 0;
Point aPos(0, 0);
@@ -405,7 +404,7 @@ bool WinSalGraphics::CacheGlyphs(const CommonSalLayout& rLayout)
return true;
}
-bool WinSalGraphics::DrawCachedGlyphs(const CommonSalLayout& rLayout)
+bool WinSalGraphics::DrawCachedGlyphs(const GenericSalLayout& rLayout)
{
HDC hDC = getHDC();
@@ -419,7 +418,7 @@ bool WinSalGraphics::DrawCachedGlyphs(const CommonSalLayout& rLayout)
if (!pImpl)
return false;
- WinFontInstance& rFont = *static_cast<WinFontInstance*>(&rLayout.getFont());
+ WinFontInstance& rFont = *static_cast<WinFontInstance*>(&rLayout.GetFont());
int nStart = 0;
Point aPos(0, 0);
@@ -444,22 +443,22 @@ bool WinSalGraphics::DrawCachedGlyphs(const CommonSalLayout& rLayout)
return true;
}
-void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout, HDC hDC, bool bUseDWrite)
+void WinSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout, HDC hDC, bool bUseDWrite)
{
TextOutRenderer &render = TextOutRenderer::get(bUseDWrite);
render(rLayout, *this, hDC);
}
-void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout)
+void WinSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
{
HDC hDC = getHDC();
- HFONT hFont = static_cast<const WinFontInstance*>(&rLayout.getFont())->GetHFONT();
+ HFONT hFont = static_cast<const WinFontInstance*>(&rLayout.GetFont())->GetHFONT();
HGDIOBJ hOrigFont = SelectObject(hDC, hFont);
// Our DirectWrite renderer is incomplete, skip it for non-horizontal or
// stretched text.
- bool bForceGDI = rLayout.GetOrientation() || static_cast<const WinFontInstance*>(&rLayout.getFont())->hasHScale();
+ bool bForceGDI = rLayout.GetOrientation() || static_cast<const WinFontInstance*>(&rLayout.GetFont())->hasHScale();
bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter;
if (!bUseOpenGL)