summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-10-27 10:14:42 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-10-30 21:20:33 +0100
commit620492ca19d1e5c34312b49f3d4fef24a928412a (patch)
tree1b7434d1dd130afe93f6c4338e347d577b1cab88 /vcl/unx
parent28c0bd6379c0c40bcaf3ab994ef5aee711fe58bb (diff)
Constify some VCL interface functions
This drops the bPaintEnd optimization for vertical and horizontal lines on Windows, where Polyline and LineTo exclude painting the last pixel of the line. Instead we just always set the last pixel. It also merges the various "SetPixel" call sites into a common drawPixelImpl function. Change-Id: I01cc3c01c908ba74f7978fa90eaaf8d88f923ae3 Reviewed-on: https://gerrit.libreoffice.org/43939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx2
-rw-r--r--vcl/unx/generic/gdi/font.cxx2
-rw-r--r--vcl/unx/generic/gdi/gdiimpl.cxx2
-rw-r--r--vcl/unx/generic/gdi/gdiimpl.hxx2
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx2
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx2
-rw-r--r--vcl/unx/generic/print/genpspgraphics.cxx12
7 files changed, 12 insertions, 12 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 77a3539cc81b..5b03eda92eef 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -337,7 +337,7 @@ bool CairoTextRender::GetFontCapabilities(vcl::FontCapabilities &rGetImplFontCap
// SalGraphics
-void CairoTextRender::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void CairoTextRender::SetFont( const FontSelectPattern *pEntry, int nFallbackLevel )
{
setFont(pEntry, nFallbackLevel);
}
diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx
index c872963d159c..bae13f646037 100644
--- a/vcl/unx/generic/gdi/font.cxx
+++ b/vcl/unx/generic/gdi/font.cxx
@@ -70,7 +70,7 @@ bool X11SalGraphics::GetFontCapabilities(vcl::FontCapabilities &rGetImplFontCapa
// SalGraphics
-void X11SalGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void X11SalGraphics::SetFont( const FontSelectPattern *pEntry, int nFallbackLevel )
{
mxTextRenderImpl->SetFont(pEntry, nFallbackLevel);
}
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index fea1b60c9870..84dfdff69e07 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1240,7 +1240,7 @@ void X11SalGraphicsImpl::drawRect( long nX, long nY, long nDX, long nDY )
nX, nY, nDX-1, nDY-1 );
}
-void X11SalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
+void X11SalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
{
drawPolyLine( nPoints, pPtAry, false );
}
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index 42fe5b6c9ee2..fe4f47e51a94 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -152,7 +152,7 @@ public:
virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
- virtual void drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
+ virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 652cb41b7a7e..1ac940050077 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -431,7 +431,7 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
mxImpl->drawRect( nX, nY, nDX, nDY );
}
-void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
{
mxImpl->drawPolyLine( nPoints, pPtAry );
}
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 0b4f49c9b5fa..57393255bcee 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -354,7 +354,7 @@ FreetypeFontFace::FreetypeFontFace( FreetypeFontInfo* pFI, const FontAttributes&
{
}
-LogicalFontInstance* FreetypeFontFace::CreateFontInstance( FontSelectPattern& rFSD ) const
+LogicalFontInstance* FreetypeFontFace::CreateFontInstance( const FontSelectPattern& rFSD ) const
{
FreetypeFontInstance* pEntry = new FreetypeFontInstance( rFSD );
return pEntry;
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index dea5b28f4082..c835b2d5922c 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -396,15 +396,15 @@ void GenPspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
m_pPrinterGfx->DrawRect (tools::Rectangle(Point(nX, nY), Size(nDX, nDY)));
}
-void GenPspGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
+void GenPspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
{
- m_pPrinterGfx->DrawPolyLine (nPoints, reinterpret_cast<Point *>(pPtAry));
+ m_pPrinterGfx->DrawPolyLine (nPoints, reinterpret_cast<const Point *>(pPtAry));
}
void GenPspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
{
// Point must be equal to SalPoint! see include/vcl/salgtype.hxx
- m_pPrinterGfx->DrawPolygon (nPoints, reinterpret_cast<Point const *>(pPtAry));
+ m_pPrinterGfx->DrawPolygon (nPoints, reinterpret_cast<const Point *>(pPtAry));
}
void GenPspGraphics::drawPolyPolygon( sal_uInt32 nPoly,
@@ -532,7 +532,7 @@ public:
explicit ImplPspFontData( const psp::FastPrintFontInfo& );
virtual sal_IntPtr GetFontId() const override { return mnFontId; }
virtual PhysicalFontFace* Clone() const override { return new ImplPspFontData( *this ); }
- virtual LogicalFontInstance* CreateFontInstance( FontSelectPattern& ) const override;
+ virtual LogicalFontInstance* CreateFontInstance( const FontSelectPattern& ) const override;
};
ImplPspFontData::ImplPspFontData( const psp::FastPrintFontInfo& rInfo )
@@ -540,7 +540,7 @@ ImplPspFontData::ImplPspFontData( const psp::FastPrintFontInfo& rInfo )
mnFontId( rInfo.m_nID )
{}
-LogicalFontInstance* ImplPspFontData::CreateFontInstance( FontSelectPattern& rFSD ) const
+LogicalFontInstance* ImplPspFontData::CreateFontInstance( const FontSelectPattern& rFSD ) const
{
FreetypeFontInstance* pEntry = new FreetypeFontInstance( rFSD );
return pEntry;
@@ -610,7 +610,7 @@ bool GenPspGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilitie
return m_pFreetypeFont[0]->GetFontCapabilities(rFontCapabilities);
}
-void GenPspGraphics::SetFont( FontSelectPattern *pEntry, int nFallbackLevel )
+void GenPspGraphics::SetFont( const FontSelectPattern *pEntry, int nFallbackLevel )
{
// release all fonts that are to be overridden
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )