diff options
-rw-r--r-- | canvas/source/vcl/backbuffer.cxx | 12 | ||||
-rw-r--r-- | canvas/source/vcl/bitmapbackbuffer.cxx | 13 | ||||
-rw-r--r-- | canvas/source/vcl/impltools.cxx | 18 | ||||
-rw-r--r-- | canvas/source/vcl/impltools.hxx | 1 | ||||
-rw-r--r-- | canvas/source/vcl/spritedevicehelper.cxx | 12 |
5 files changed, 25 insertions, 31 deletions
diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx index 0ddf0344ea73..c2779cdf0489 100644 --- a/canvas/source/vcl/backbuffer.cxx +++ b/canvas/source/vcl/backbuffer.cxx @@ -22,6 +22,7 @@ #include <vcl/svapp.hxx> #include "backbuffer.hxx" +#include "impltools.hxx" namespace vclcanvas @@ -34,16 +35,7 @@ namespace vclcanvas if( bMonochromeBuffer ) return; - // #i95645# -#if defined( MACOSX ) - // use AA on VCLCanvas for Mac - maVDev->SetAntialiasing( AntialiasingFlags::Enable | maVDev->GetAntialiasing() ); -#else - // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly - // (especially gradient painting). This will need extra work. - maVDev->SetAntialiasing( maVDev->GetAntialiasing() & ~AntialiasingFlags::Enable); -#endif + tools::SetDefaultDeviceAntiAliasing( maVDev ); } BackBuffer::~BackBuffer() diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index 4ac6d1a7b95e..337e0bae7c2e 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.cxx @@ -24,7 +24,7 @@ #include <vcl/svapp.hxx> #include "bitmapbackbuffer.hxx" - +#include "impltools.hxx" namespace vclcanvas { @@ -120,16 +120,7 @@ namespace vclcanvas mpVDev->SetOutputSizePixel( maBitmap->GetSizePixel() ); - // #i95645# -#if defined( MACOSX ) - // use AA on VCLCanvas for Mac - mpVDev->SetAntialiasing( AntialiasingFlags::Enable | mpVDev->GetAntialiasing() ); -#else - // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly - // (especially gradient painting). This will need extra work. - mpVDev->SetAntialiasing(mpVDev->GetAntialiasing() & ~AntialiasingFlags::Enable); -#endif + tools::SetDefaultDeviceAntiAliasing( mpVDev ); } void BitmapBackBuffer::updateVDev() const diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index 754a34ce0806..a76fefcb40c7 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -33,6 +33,7 @@ #include <vcl/canvastools.hxx> #include <vcl/BitmapTools.hxx> #include <vcl/metric.hxx> +#include <vcl/skia/SkiaHelper.hxx> #include <canvas/canvastools.hxx> @@ -216,6 +217,23 @@ namespace vclcanvas::tools return vcl::bitmap::CanvasTransformBitmap(rBitmap, rTransform, aDestRect, aLocalTransform); } + + void SetDefaultDeviceAntiAliasing( OutputDevice* pDevice ) + { +#if defined( MACOSX ) + // use AA on VCLCanvas for Mac + pDevice->SetAntialiasing( AntialiasingFlags::Enable | pDevice->GetAntialiasing() ); +#else + // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and + // is not required to do AA. It would need to be adapted to use it correctly + // (especially gradient painting). This will need extra work. + if( SkiaHelper::isVCLSkiaEnabled()) // But Skia handles AA fine. + pDevice->SetAntialiasing( AntialiasingFlags::Enable | pDevice->GetAntialiasing() ); + else + pDevice->SetAntialiasing(pDevice->GetAntialiasing() & ~AntialiasingFlags::Enable); +#endif + } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx index 8ac5a7e62d42..f8a9db075227 100644 --- a/canvas/source/vcl/impltools.hxx +++ b/canvas/source/vcl/impltools.hxx @@ -171,6 +171,7 @@ namespace vclcanvas ::BitmapEx transformBitmap( const BitmapEx& rBitmap, const ::basegfx::B2DHomMatrix& rTransform ); + void SetDefaultDeviceAntiAliasing( OutputDevice* pDevice ); } } diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx index f123b31e4cfb..150e3fcb42af 100644 --- a/canvas/source/vcl/spritedevicehelper.cxx +++ b/canvas/source/vcl/spritedevicehelper.cxx @@ -25,6 +25,7 @@ #include <tools/stream.hxx> #include "spritedevicehelper.hxx" +#include "impltools.hxx" using namespace ::com::sun::star; @@ -44,16 +45,7 @@ namespace vclcanvas mpBackBuffer = std::make_shared<BackBuffer>( rOutDev ); mpBackBuffer->setSize( rOutDev.GetOutputSizePixel() ); - // #i95645# -#if defined( MACOSX ) - // use AA on VCLCanvas for Mac - mpBackBuffer->getOutDev().SetAntialiasing( AntialiasingFlags::Enable | mpBackBuffer->getOutDev().GetAntialiasing() ); -#else - // switch off AA for WIN32 and UNIX, the VCLCanvas does not look good with it and - // is not required to do AA. It would need to be adapted to use it correctly - // (especially gradient painting). This will need extra work. - mpBackBuffer->getOutDev().SetAntialiasing(mpBackBuffer->getOutDev().GetAntialiasing() & ~AntialiasingFlags::Enable); -#endif + tools::SetDefaultDeviceAntiAliasing( &mpBackBuffer->getOutDev()); } bool SpriteDeviceHelper::showBuffer( bool, bool ) |