summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-01 01:28:02 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-03-31 21:06:20 +0000
commit6d0273b70b228af6b18e0dfdb89759ccad30a03c (patch)
treedee722e7baa6e68647572a0d2b2731317eb66ba0 /vcl/source
parente65141e93a540fc9fb4343ee65a5a7da7e3b1769 (diff)
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 <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/outdev4.cxx3
-rw-r--r--vcl/source/gdi/print.cxx5
-rw-r--r--vcl/source/gdi/virdev.cxx5
-rw-r--r--vcl/source/window/window.cxx8
4 files changed, 19 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index c3873b6adcb4..4d23620013c4 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -372,7 +372,6 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
// 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.
- // Also virtual devices are excluded, as some drivers are too slow.
boost::scoped_ptr<PolyPolygon> pPolyPoly;
Rectangle aRect;
@@ -393,7 +392,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
rGradient.GetBoundRect( rRect, aRect, aCenter );
- if( (meRasterOp != ROP_OVERPAINT) || (meOutDevType != OUTDEV_WINDOW) || bMtf )
+ if ( UsePolyPolygonForComplexGradient() || bMtf )
pPolyPoly.reset(new PolyPolygon( 2 ));
long nMinRect = std::min( aRect.GetWidth(), aRect.GetHeight() );
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index c83757b51a06..f6ebc67f3bc0 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1863,4 +1863,9 @@ void Printer::updatePrinters()
}
}
+bool Printer::UsePolyPolygonForComplexGradient()
+{
+ return true;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index df30533616d1..1b3fba203211 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -543,6 +543,11 @@ sal_uInt16 VirtualDevice::GetAlphaBitCount() const
return 0;
}
+bool VirtualDevice::UsePolyPolygonForComplexGradient()
+{
+ return true;
+}
+
void VirtualDevice::Compat_ZeroExtleadBug()
{
meRefDevMode = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6ae570051d96..5bed7e135b94 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9840,4 +9840,12 @@ Selection Window::GetSurroundingTextSelection() const
return Selection( 0, 0 );
}
+bool Window::UsePolyPolygonForComplexGradient()
+{
+ if ( meRasterOp != ROP_OVERPAINT )
+ return true;
+
+ return false;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */