summaryrefslogtreecommitdiff
path: root/vcl/win/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-05 21:35:23 +0000
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-06 01:50:30 +0000
commit29d2f85e198d5b844d5a10562723a65173cf22ea (patch)
treeb8d8c9922fbb5d896eccaae2988b33bdafe6e3fb /vcl/win/gdi
parent98a03d9b0d13b8f811ccf8fc1a9b7f9469ed079c (diff)
Restore "pPos and pGetNextGlypInfo always have the same value"
and... "pEraseRect is always null" This reverts commit b398dacbb471913e573e9b0b4cd31d94a9109223. Change-Id: I5e7c07eefff0b6bd39d9ed7492134ea062e90fdf Reviewed-on: https://gerrit.libreoffice.org/34907 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/win/gdi')
-rw-r--r--vcl/win/gdi/winlayout.cxx38
1 files changed, 16 insertions, 22 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index c884c9ef6580..a8d71fc98b2f 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -264,12 +264,8 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite)
bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
SalGraphics & /*rGraphics*/,
- HDC hDC,
- const Rectangle* pRectToErase,
- Point* pPos, int* pGetNextGlypInfo)
+ HDC hDC)
{
- bool bGlyphs = false;
- const GlyphItem* pGlyph;
HFONT hFont = static_cast<HFONT>(GetCurrentObject( hDC, OBJ_FONT ));
HFONT hAltFont = nullptr;
bool bUseAltFont = false;
@@ -284,16 +280,19 @@ 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))
{
- bGlyphs = true;
WORD glyphWStr[] = { pGlyph->maGlyphId };
if (hAltFont && pGlyph->IsVertical() == bUseAltFont)
{
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)
{
@@ -302,7 +301,7 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
DeleteObject(hAltFont);
}
- return (pRectToErase && bGlyphs);
+ return true;
}
D2DWriteTextOutRenderer::D2DWriteTextOutRenderer()
@@ -343,9 +342,7 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer()
bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
SalGraphics &rGraphics,
- HDC hDC,
- const Rectangle* pRectToErase,
- Point* pPos, int* pGetNextGlypInfo)
+ HDC hDC)
{
if (!Ready())
return false;
@@ -353,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, pRectToErase, pPos, pGetNextGlypInfo);
+ return ExTextOutRenderer()(rLayout, rGraphics, hDC);
}
Rectangle bounds;
@@ -365,19 +362,19 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
succeeded &= SUCCEEDED(mpRT->CreateSolidColorBrush(D2D1::ColorF(GetRValue(bgrTextColor) / 255.0f, GetGValue(bgrTextColor) / 255.0f, GetBValue(bgrTextColor) / 255.0f), &pBrush));
HRESULT hr = S_OK;
- bool bGlyphs = false;
if (succeeded)
{
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))
{
- bGlyphs = true;
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,
@@ -403,7 +400,7 @@ bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
if (hr == D2DERR_RECREATE_TARGET)
CreateRenderTarget();
- return (succeeded && bGlyphs && pRectToErase);
+ return succeeded;
}
bool D2DWriteTextOutRenderer::BindFont(HDC hDC)
@@ -606,11 +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, nullptr, &aPos, &nGlyphCount);
- assert(!result);
+ render(rLayout, *this, hDC);
}
void WinSalGraphics::DrawTextLayout(const CommonSalLayout& rLayout)