summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-10-25 18:51:51 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-11-03 22:54:14 +0000
commitad6d94009cf8ea526eb70bf1a07e5c6a21320f83 (patch)
tree4dc2b9cd15ab76cbf25bb50fcd27a150b14cab83 /vcl/inc
parentc79d2dbe3a75e3376a5997444b6a3a5f947da107 (diff)
vcl: Allow SalGraphics to draw gradients natively
The aim of this patch is to allow for native gradient rendering in SalGraphics (i.e. let OpenGL do this natively). It is a two step process: 1. I need to allow gradient draw into SalGraphics, however the current completely intertwined with the metafile code in OutputDevice. I am seperating the gradient metafile code from the gradient drawing code. 2. After splitting the metafile stuff from the actual gradient drawing, I am now able to call on SalGraphics::DrawGradient(). This just calls on SalGraphics::drawGradient() which returns false if there is no way of drawing native gradients, and true if there is. If false, then we use OutputDevice's DrawGradient() functionality. Change-Id: Ibaaabe13b76a8e7a037d9f751b5f662653a50566 Reviewed-on: https://gerrit.libreoffice.org/12119 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/generic/genpspgraphics.h2
-rw-r--r--vcl/inc/headless/svpgdi.hxx1
-rw-r--r--vcl/inc/quartz/salgdi.h1
-rw-r--r--vcl/inc/salgdi.hxx11
-rw-r--r--vcl/inc/unx/salgdi.h2
-rw-r--r--vcl/inc/win/salgdi.h1
6 files changed, 18 insertions, 0 deletions
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 2a562c341ff7..30c8fecd5eea 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -148,6 +148,8 @@ public:
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
const sal_uInt8* const* pFlgAry ) SAL_OVERRIDE;
+ virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) SAL_OVERRIDE { return false; };
+
virtual void copyArea( long nDestX,
long nDestY,
long nSrcX,
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index a872d4a2019d..cbbac7a4b1dd 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -211,6 +211,7 @@ public:
const sal_uInt32* pPoints,
const SalPoint* const* pPtAry,
const sal_uInt8* const* pFlgAry ) SAL_OVERRIDE;
+ virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) SAL_OVERRIDE { return false; };
virtual void copyArea( long nDestX,
long nDestY,
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 23d3bb3904a9..eb21e09a6710 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -237,6 +237,7 @@ public:
const ::basegfx::B2DVector& rLineWidths,
basegfx::B2DLineJoin,
com::sun::star::drawing::LineCap eLineCap) SAL_OVERRIDE;
+ virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) SAL_OVERRIDE { return false; };
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 7e06ee6d82e7..2266d87ee64e 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -288,6 +288,12 @@ public:
const sal_uInt8* const* pFlgAry,
const OutputDevice *pOutDev );
+ bool DrawGradient(
+ const tools::PolyPolygon& rPolyPoly,
+ const Gradient& rGradient,
+ OutputDevice* );
+
+
// CopyArea --> No RasterOp, but ClipRegion
void CopyArea(
long nDestX, long nDestY,
@@ -451,6 +457,11 @@ protected:
const SalPoint* const* pPtAry,
const sal_uInt8* const* pFlgAry ) = 0;
+
+ virtual bool drawGradient(
+ const tools::PolyPolygon& rPolyPoly,
+ const Gradient& rGradient ) = 0;
+
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea(
long nDestX, long nDestY,
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index c4eea0fe3c37..f56411227405 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -277,6 +277,8 @@ public:
basegfx::B2DLineJoin,
com::sun::star::drawing::LineCap) SAL_OVERRIDE;
virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
+ virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) SAL_OVERRIDE { return false; };
+
#if 1 // TODO: remove these obselete methods
virtual bool drawPolyLineBezier( sal_uInt32 nPoints,
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 66c561830e49..ca423fb46f8d 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -219,6 +219,7 @@ protected:
virtual bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
virtual bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
virtual bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry );
+ virtual bool drawGradient( const tools::PolyPolygon&, const Gradient& ) SAL_OVERRIDE { return false; };
// CopyArea --> No RasterOp, but ClipRegion
virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,