[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - vcl/headless
Caolán McNamara
caolanm at redhat.com
Mon Jul 18 14:10:19 UTC 2016
vcl/headless/svpgdi.cxx | 40 ++++++++++------------------------------
1 file changed, 10 insertions(+), 30 deletions(-)
New commits:
commit d4e0eefa1f899fa05c27acd90d7bef5a55ce1ad9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 26 11:18:40 2015 +0000
try to get this working on linux baseline
(cherry picked from commit 22a35a56b385b1a08d20eb609f35ab506cc8333e)
Conflicts:
vcl/headless/svpgdi.cxx
Change-Id: If17327385423d62eeb201e6754a7a45f0640c2f8
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index d1fc52b..6f9543d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -66,7 +66,7 @@ rDevice
namespace
{
-#if CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR < 10
+#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
#define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
@@ -86,7 +86,9 @@ namespace
cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
extents.x = x1, extents.y = y1, extents.width = x2-x1, extents.height = y2-y1;
-#if CAIRO_VERSION_MAJOR > 1 || (CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR >= 10)
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
+ extents.x = x1, extents.y = x2, extents.width = x2-x1, extents.height = y2-y1;
+
cairo_region_t *region = cairo_region_create_rectangle(&extents);
cairo_fill_extents(cr, &x1, &y1, &x2, &y2);
@@ -149,9 +151,6 @@ namespace
bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap )
{
- bool bRet = false;
- (void)rTR; (void)rSourceBitmap; (void)rAlphaBitmap;
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
if (rAlphaBitmap.GetBitCount() != 8 && rAlphaBitmap.GetBitCount() != 1)
{
SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap alpha depth case: " << rAlphaBitmap.GetBitCount());
@@ -276,9 +275,7 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS
xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width,
extents.y + extents.height));
}
- bRet = true;
-#endif
- return bRet;
+ return true;
}
bool SvpSalGraphics::drawTransformedBitmap(
@@ -301,11 +298,10 @@ namespace
if (!rBuffer)
return false;
- if (rBuffer->getScanlineFormat() != SVP_CAIRO_FORMAT
- && rBuffer->getScanlineFormat() != basebmp::Format::OneBitMsbPal)
+ if (rBuffer->getScanlineFormat() != SVP_CAIRO_FORMAT &&
+ rBuffer->getScanlineFormat() != basebmp::Format::OneBitMsbPal)
return false;
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
basegfx::B2IVector size = rBuffer->getSize();
sal_Int32 nStride = rBuffer->getScanlineStride();
cairo_format_t nFormat;
@@ -314,9 +310,6 @@ namespace
else
nFormat = CAIRO_FORMAT_A1;
return (cairo_format_stride_for_width(nFormat, size.getX()) == nStride);
-#else
- return false;
-#endif
}
}
@@ -341,10 +334,6 @@ void SvpSalGraphics::clipRegion(cairo_t* cr)
bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
{
- bool bRet = false;
- (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency;
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
-
cairo_t* cr = getCairoContext();
assert(cr && m_aDevice->isTopDown());
@@ -391,9 +380,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width,
extents.y + extents.height));
}
- bRet = true;
-#endif
- return bRet;
+ return true;
}
SvpSalGraphics::SvpSalGraphics() :
@@ -805,7 +792,6 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
dbgOut( m_aDevice );
}
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
static void AddPolygonToPath(cairo_t* cr, const basegfx::B2DPolygon& rPolygon, bool bClosePath)
{
// short circuit if there is nothing to do
@@ -866,7 +852,6 @@ static void AddPolygonToPath(cairo_t* cr, const basegfx::B2DPolygon& rPolygon, b
cairo_close_path(cr);
}
}
-#endif
bool SvpSalGraphics::drawPolyLine(
const ::basegfx::B2DPolygon& rPolyLine,
@@ -1004,10 +989,6 @@ bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32,
bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, double fTransparency)
{
- bool bRet = false;
- (void)rPolyPoly; (void)fTransparency;
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
-
cairo_t* cr = getCairoContext();
assert(cr && m_aDevice->isTopDown());
@@ -1053,9 +1034,8 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d
xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width,
extents.y + extents.height));
}
- bRet = true;
-#endif
- return bRet;
+
+ return true;
}
void SvpSalGraphics::copyArea( long nDestX,
More information about the Libreoffice-commits
mailing list