diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2017-03-04 05:40:39 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2017-03-04 14:21:21 +0200 |
commit | 7453cb58df4ce434a1252567f961cfe497064aca (patch) | |
tree | 059372f3c8bb28a472de6d099d8bd7364424945b /vcl | |
parent | 073d920ef5914b5dfe491dbaf7fb18ba56293b85 (diff) |
pPos and pGetNextGlypInfo always have the same value
Change-Id: Iec46e0aefff71cbeb2face4f55e5c3a4d6698995
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/win/winlayout.hxx | 9 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 27 |
2 files changed, 17 insertions, 19 deletions
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 2c6cc269fc3b..bc1890b0ee11 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -179,8 +179,7 @@ public: virtual bool operator ()(CommonSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC, - Point* pPos, int* pGetNextGlypInfo) = 0; + HDC hDC) = 0; }; class ExTextOutRenderer : public TextOutRenderer @@ -193,8 +192,7 @@ public: bool operator ()(CommonSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC, - Point* pPos, int* pGetNextGlypInfo) override; + HDC hDC) override; }; class D2DWriteTextOutRenderer : public TextOutRenderer @@ -217,8 +215,7 @@ public: bool operator ()(CommonSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC, - Point* pPos, int* pGetNextGlypInfo) override; + HDC hDC) override; inline bool BindDC(HDC hDC, Rectangle const & rRect = Rectangle(0, 0, 0, 0)) { RECT const rc = { rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() }; diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 21116d375fb4..cf555de5fe00 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -264,10 +264,8 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite) bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout, SalGraphics & /*rGraphics*/, - HDC hDC, - Point* pPos, int* pGetNextGlypInfo) + HDC hDC) { - const GlyphItem* pGlyph; HFONT hFont = static_cast<HFONT>(GetCurrentObject( hDC, OBJ_FONT )); HFONT hAltFont = nullptr; bool bUseAltFont = false; @@ -282,7 +280,11 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout, hAltFont = CreateFontIndirectW(&aLogFont); } } - while (rLayout.GetNextGlyphs(1, &pGlyph, *pPos, *pGetNextGlypInfo)) + + int nStart = 0; + Point aPos(0, 0); + const GlyphItem* pGlyph; + while (rLayout.GetNextGlyphs(1, &pGlyph, aPos, nStart)) { WORD glyphWStr[] = { pGlyph->maGlyphId }; if (hAltFont && pGlyph->IsVertical() == bUseAltFont) @@ -290,7 +292,7 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout, bUseAltFont = !bUseAltFont; SelectFont(hDC, bUseAltFont ? hAltFont : hFont); } - ExtTextOutW(hDC, pPos->X(), pPos->Y(), ETO_GLYPH_INDEX, nullptr, LPCWSTR(&glyphWStr), 1, nullptr); + ExtTextOutW(hDC, aPos.X(), aPos.Y(), ETO_GLYPH_INDEX, nullptr, LPCWSTR(&glyphWStr), 1, nullptr); } if (hAltFont) { @@ -340,8 +342,7 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer() bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC, - Point* pPos, int* pGetNextGlypInfo) + HDC hDC) { if (!Ready()) return false; @@ -349,7 +350,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout, if (!BindFont(hDC)) { // If for any reason we can't bind fallback to legacy APIs. - return ExTextOutRenderer()(rLayout, rGraphics, hDC, pPos, pGetNextGlypInfo); + return ExTextOutRenderer()(rLayout, rGraphics, hDC); } Rectangle bounds; @@ -365,13 +366,15 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout, { mpRT->BeginDraw(); + int nStart = 0; + Point aPos(0, 0); const GlyphItem* pGlyph; - while (rLayout.GetNextGlyphs(1, &pGlyph, *pPos, *pGetNextGlypInfo)) + while (rLayout.GetNextGlyphs(1, &pGlyph, aPos, nStart)) { UINT16 glyphIndices[] = { pGlyph->maGlyphId }; FLOAT glyphAdvances[] = { pGlyph->mnNewWidth }; DWRITE_GLYPH_OFFSET glyphOffsets[] = { { 0.0f, 0.0f }, }; - D2D1_POINT_2F baseline = { pPos->X() - bounds.Left(), pPos->Y() - bounds.Top() }; + D2D1_POINT_2F baseline = { aPos.X() - bounds.Left(), aPos.Y() - bounds.Top() }; DWRITE_GLYPH_RUN glyphs = { mpFontFace, mlfEmHeight, @@ -600,10 +603,8 @@ bool WinSalGraphics::DrawCachedGlyphs(const CommonSalLayout& rLayout) void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout, HDC hDC, bool bUseDWrite) { - Point aPos(0, 0); - int nGlyphCount(0); TextOutRenderer &render = TextOutRenderer::get(bUseDWrite); - bool result = render(rLayout, *this, hDC, &aPos, &nGlyphCount); + bool result = render(rLayout, *this, hDC); assert(result); } |