diff options
author | Herbert Dürr <hdu@apache.org> | 2013-12-16 16:07:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-06 14:32:30 +0000 |
commit | a16aacd6474f02307341646ec08f9e1608a8615d (patch) | |
tree | 23d5a086d982d77329f2de6196c97c3139d9bdbf /vcl/headless | |
parent | 8723bf714b6156396f30ac71c0268e5a51c76337 (diff) |
Resolves: #i123840# add and use the sal_GlyphId type
Using the central definition adds consistency and cleans up many ad hoc
declarations. The type sal_GlyphId will become a class in the future so
that its bitfield operations etc. can then be isolated into nice methods.
(cherry picked from commit c0a84ad10964fb7a65b6239cbe1cef8698b5d17b)
Conflicts:
vcl/aqua/source/gdi/salatslayout.cxx
vcl/aqua/source/gdi/salgdi.cxx
vcl/generic/glyphs/gcach_ftyp.cxx
vcl/generic/print/genpspgraphics.cxx
vcl/generic/print/glyphset.cxx
vcl/generic/print/glyphset.hxx
vcl/headless/svptext.cxx
vcl/inc/generic/genpspgraphics.h
vcl/inc/generic/glyphcache.hxx
vcl/inc/os2/salgdi.h
vcl/inc/quartz/salgdi.h
vcl/inc/salgdi.hxx
vcl/inc/sallayout.hxx
vcl/inc/unx/salgdi.h
vcl/inc/vcl/fontmanager.hxx
vcl/inc/win/salgdi.h
vcl/os2/source/gdi/os2layout.cxx
vcl/os2/source/gdi/salgdi3.cxx
vcl/source/gdi/pdfwriter_impl.cxx
vcl/source/gdi/sallayout.cxx
vcl/source/glyphs/gcach_ftyp.hxx
vcl/source/glyphs/gcach_layout.cxx
vcl/source/glyphs/glyphcache.cxx
vcl/source/glyphs/graphite_layout.cxx
vcl/unx/generic/fontmanager/fontmanager.cxx
vcl/unx/generic/gdi/gcach_xpeer.cxx
vcl/unx/generic/gdi/gcach_xpeer.hxx
vcl/unx/generic/gdi/salgdi3.cxx
vcl/unx/generic/gdi/xrender_peer.hxx
vcl/unx/headless/svpgdi.hxx
vcl/unx/headless/svppspgraphics.cxx
vcl/unx/headless/svppspgraphics.hxx
vcl/win/source/gdi/salgdi3.cxx
vcl/win/source/gdi/winlayout.cxx
Change-Id: Ic629131950360e2df4c15db30d6a5362193c6330
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svptext.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 9b47c41c8621..a634922e71cc 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -49,7 +49,7 @@ class SvpGlyphPeer public: SvpGlyphPeer() {} - BitmapDeviceSharedPtr GetGlyphBmp( ServerFont&, int nGlyphIndex, + BitmapDeviceSharedPtr GetGlyphBmp( ServerFont&, sal_GlyphId, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ); protected: @@ -114,9 +114,9 @@ SvpGlyphCache& SvpGlyphCache::GetInstance() BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, - int nGlyphIndex, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ) + sal_GlyphId aGlyphId, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ) { - GlyphData& rGlyphData = rServerFont.GetGlyphData( nGlyphIndex ); + GlyphData& rGlyphData = rServerFont.GetGlyphData( aGlyphId ); if( rGlyphData.ExtDataRef().meInfo != nBmpFormat ) { @@ -131,10 +131,10 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, switch( nBmpFormat ) { case FORMAT_ONE_BIT_LSB_GREY: - bFound = rServerFont.GetGlyphBitmap1( nGlyphIndex, pGcpHelper->maRawBitmap ); + bFound = rServerFont.GetGlyphBitmap1( aGlyphId, pGcpHelper->maRawBitmap ); break; case FORMAT_EIGHT_BIT_GREY: - bFound = rServerFont.GetGlyphBitmap8( nGlyphIndex, pGcpHelper->maRawBitmap ); + bFound = rServerFont.GetGlyphBitmap8( aGlyphId, pGcpHelper->maRawBitmap ); break; default: OSL_FAIL( "SVP GCP::GetGlyphBmp(): illegal scanline format"); @@ -145,7 +145,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, } // return .notdef glyph if needed - if( !bFound && (nGlyphIndex != 0) ) + if( !bFound && (aGlyphId != 0) ) { if( bNew ) delete pGcpHelper; @@ -305,7 +305,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*, sal_Bool SvpSalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, @@ -323,7 +323,7 @@ sal_Bool SvpSalGraphics::CreateFontSubset( bool bSuccess = rMgr.createFontSubset( rInfo, aFont, rToFile, - pGlyphIDs, + pGlyphIds, pEncoding, pWidths, nGlyphCount ); @@ -381,35 +381,35 @@ void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, } -sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) +bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); + aGlyphId &= GF_IDXMASK; + const GlyphMetric& rGM = pSF->GetGlyphMetric( aGlyphId ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return sal_True; + return true; } -sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly ) +bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, B2DPolyPolygon& rPolyPoly ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; const ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) + aGlyphId &= GF_IDXMASK; + if( pSF->GetGlyphOutline( aGlyphId, rPolyPoly ) ) return sal_True; return sal_False; @@ -431,21 +431,21 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) { // iterate over all glyphs in the layout Point aPos; - sal_GlyphId nGlyphIndex; + sal_GlyphId aGlyphId; SvpGlyphPeer& rGlyphPeer = SvpGlyphCache::GetInstance().GetPeer(); - for( int nStart = 0; rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart ); ) + for( int nStart = 0; rSalLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + int nLevel = aGlyphId >> GF_FONTSHIFT; DBG_ASSERT( nLevel < MAX_FALLBACK, "SvpGDI: invalid glyph fallback level" ); ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) continue; // get the glyph's alpha mask and adjust the drawing position - nGlyphIndex &= GF_IDXMASK; + aGlyphId &= GF_IDXMASK; B2IPoint aDstPoint( aPos.X(), aPos.Y() ); BitmapDeviceSharedPtr aAlphaMask - = rGlyphPeer.GetGlyphBmp( *pSF, nGlyphIndex, m_eTextFmt, aDstPoint ); + = rGlyphPeer.GetGlyphBmp( *pSF, aGlyphId, m_eTextFmt, aDstPoint ); if( !aAlphaMask ) // ignore empty glyphs continue; |