From 6d0273b70b228af6b18e0dfdb89759ccad30a03c Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Tue, 1 Apr 2014 01:28:02 +1100 Subject: fdo#74702 New abstract function UsePolyPolygonForComplexGradient() A new protected abstract function has been introduced only for complex gradients. As it stands, we currently need to work out if we should use a PolyPolygon or a Polygon because, as the comments say: // Determine if we output via Polygon or PolyPolygon // For all rasteroperations other then Overpaint always use // PolyPolygon, as we will get wrong results if we output multiple // times on top of each other. // Also for printers always use PolyPolygon, as not all printers // can print polygons on top of each other. Interestingly, the next line is either wrong or expressed badly, because the check uses PolyPolygons when a VirtualDevice is in use: // Also virtual devices are excluded, as some drivers are too slow. Therefore, I've removed that comment as it seems rather misleading. Change-Id: Ic496284cb2be8e7e2d348eae76aeeec994e1029c Reviewed-on: https://gerrit.libreoffice.org/8802 Reviewed-by: Chris Sherlock Tested-by: Chris Sherlock --- include/vcl/outdev.hxx | 1 + include/vcl/print.hxx | 1 + include/vcl/virdev.hxx | 3 +++ include/vcl/window.hxx | 5 +++-- 4 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include/vcl') diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 363cdbf62d90..56aa0739c04f 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -805,6 +805,7 @@ protected: const Point& rSrcPtPixel, const Size& rSrcSizePixel ); virtual long ImplGetGradientStepCount( long nMinRect ); + virtual bool UsePolyPolygonForComplexGradient() = 0; /** Transform and draw a bitmap directly diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 0271f0bcac1f..d70e7c025c01 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -274,6 +274,7 @@ public: protected: long ImplGetGradientStepCount( long nMinRect ) SAL_OVERRIDE; + virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE; void ScaleBitmap ( Bitmap&, SalTwoRect& ) SAL_OVERRIDE { }; public: diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 0436b5dc7161..b2a29be735bb 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -140,6 +140,9 @@ public: private: SAL_DLLPRIVATE void ImplSetReferenceDevice( RefDevMode, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY ); +protected: + virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE; + }; #endif // INCLUDED_VCL_VIRDEV_HXX diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 5751489fe1c7..a527a8f2be76 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -579,8 +579,9 @@ protected: virtual sal_uInt16 getDefaultAccessibleRole() const; virtual OUString getDefaultAccessibleName() const; - virtual void CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags) SAL_OVERRIDE; - virtual void ClipToPaintRegion( Rectangle& rDstRect ) SAL_OVERRIDE; + virtual void CopyAreaFinal( SalTwoRect& aPosAry, sal_uInt32 nFlags) SAL_OVERRIDE; + virtual void ClipToPaintRegion( Rectangle& rDstRect ) SAL_OVERRIDE; + virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE; public: bool HasMirroredGraphics() const SAL_OVERRIDE; -- cgit