diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-30 14:00:54 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-25 17:35:05 +0200 |
commit | 134447e78f00d7378406d0a3fa5a4c5d3a02032e (patch) | |
tree | ce9651e90cf291b8be43fd7459f80348a7d9ae1a /vcl/win | |
parent | 094e7b6a1028620c2b1503de8b51dc6a2482e290 (diff) |
Move GlyphItem into its own header
Actually GlyphItem should be VCL internal, but this requires a
transparent SalLayoutGlyphs (i.e. via pImpl), which I'm too lazy
to implement currently.
This seperation makes the affected source files more obvious and
later migration of vcl/glyphitem.hxx easier.
While at it apply the coding style and add '_' to member prefix.
Change-Id: I61497af5c628c40f51597ce0ef286c47321acbc2
Reviewed-on: https://gerrit.libreoffice.org/62358
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/DWriteTextRenderer.cxx | 4 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 14 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx index 7662bcc0aff4..f8aa907180eb 100644 --- a/vcl/win/gdi/DWriteTextRenderer.cxx +++ b/vcl/win/gdi/DWriteTextRenderer.cxx @@ -296,8 +296,8 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa const GlyphItem* pGlyph; while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) { - UINT16 glyphIndices[] = { pGlyph->maGlyphId }; - FLOAT glyphAdvances[] = { static_cast<FLOAT>(pGlyph->mnNewWidth) }; + UINT16 glyphIndices[] = { pGlyph->m_aGlyphId }; + FLOAT glyphAdvances[] = { static_cast<FLOAT>(pGlyph->m_nNewWidth) }; DWRITE_GLYPH_OFFSET glyphOffsets[] = { { 0.0f, 0.0f }, }; D2D1_POINT_2F baseline = { static_cast<FLOAT>(aPos.X() - bounds.Left()), static_cast<FLOAT>(aPos.Y() - bounds.Top()) }; DWRITE_GLYPH_RUN glyphs = { diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index a93141ff83e5..8ee9c60e2537 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1328,10 +1328,10 @@ void WinSalGraphics::ClearDevFontCache() bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect) { - rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.mnFallbackLevel]; + rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.m_nFallbackLevel]; assert(pFont.is()); - if (pFont.is() && pFont->GetCachedGlyphBoundRect(rGlyph.maGlyphId, rRect)) + if (pFont.is() && pFont->GetCachedGlyphBoundRect(rGlyph.m_aGlyphId, rRect)) return true; HDC hDC = getHDC(); @@ -1355,7 +1355,7 @@ bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle GLYPHMETRICS aGM; aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0; aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0; - DWORD nSize = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId, nGGOFlags, &aGM, 0, nullptr, &aMat); + DWORD nSize = ::GetGlyphOutlineW(hDC, rGlyph.m_aGlyphId, nGGOFlags, &aGM, 0, nullptr, &aMat); if (pFont.is() && hFont != pFont->GetHFONT()) SelectObject(hDC, hFont); if( nSize == GDI_ERROR ) @@ -1368,7 +1368,7 @@ bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle rRect.SetTop(static_cast<int>( fFontScale * rRect.Top() )); rRect.SetBottom(static_cast<int>( fFontScale * rRect.Bottom() ) + 1); - pFont->CacheGlyphBoundRect(rGlyph.maGlyphId, rRect); + pFont->CacheGlyphBoundRect(rGlyph.m_aGlyphId, rRect); return true; } @@ -1389,14 +1389,14 @@ bool WinSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, nGGOFlags |= GGO_GLYPH_INDEX; GLYPHMETRICS aGlyphMetrics; - const DWORD nSize1 = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId, nGGOFlags, &aGlyphMetrics, 0, nullptr, &aMat); + const DWORD nSize1 = ::GetGlyphOutlineW(hDC, rGlyph.m_aGlyphId, nGGOFlags, &aGlyphMetrics, 0, nullptr, &aMat); if( !nSize1 ) // blank glyphs are ok return true; else if( nSize1 == GDI_ERROR ) return false; BYTE* pData = new BYTE[ nSize1 ]; - const DWORD nSize2 = ::GetGlyphOutlineW(hDC, rGlyph.maGlyphId, nGGOFlags, + const DWORD nSize2 = ::GetGlyphOutlineW(hDC, rGlyph.m_aGlyphId, nGGOFlags, &aGlyphMetrics, nSize1, pData, &aMat ); if( nSize1 != nSize2 ) @@ -1546,7 +1546,7 @@ bool WinSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph, // rescaling needed for the tools::PolyPolygon conversion if( rB2DPolyPoly.count() ) { - rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.mnFallbackLevel]; + rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.m_nFallbackLevel]; assert(pFont.is()); float fFontScale = pFont.is() ? pFont->GetScale() : 1.0; const double fFactor(fFontScale/256); diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index d7c9258473a3..e2b53261c9ef 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -274,7 +274,7 @@ bool ExTextOutRenderer::operator ()(GenericSalLayout const &rLayout, const GlyphItem* pGlyph; while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) { - WORD glyphWStr[] = { pGlyph->maGlyphId }; + WORD glyphWStr[] = { pGlyph->m_aGlyphId }; if (hAltFont && pGlyph->IsVertical() == bUseAltFont) { bUseAltFont = !bUseAltFont; @@ -415,9 +415,9 @@ bool WinSalGraphics::CacheGlyphs(const GenericSalLayout& rLayout) const GlyphItem* pGlyph; while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) { - if (!rFont.GetOpenGLGlyphCache().IsGlyphCached(pGlyph->maGlyphId)) + if (!rFont.GetOpenGLGlyphCache().IsGlyphCached(pGlyph->m_aGlyphId)) { - if (!rFont.CacheGlyphToAtlas(hDC, hFONT, pGlyph->maGlyphId, *this)) + if (!rFont.CacheGlyphToAtlas(hDC, hFONT, pGlyph->m_aGlyphId, *this)) return false; } } @@ -446,7 +446,7 @@ bool WinSalGraphics::DrawCachedGlyphs(const GenericSalLayout& rLayout) const GlyphItem* pGlyph; while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) { - OpenGLGlyphDrawElement& rElement(rFont.GetOpenGLGlyphCache().GetDrawElement(pGlyph->maGlyphId)); + OpenGLGlyphDrawElement& rElement(rFont.GetOpenGLGlyphCache().GetDrawElement(pGlyph->m_aGlyphId)); OpenGLTexture& rTexture = rElement.maTexture; if (!rTexture) |