diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-28 15:27:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 08:40:56 +0200 |
commit | b153d147c9d813f78dd551fc186c261f52c929a1 (patch) | |
tree | cfb9706eb8dd8840e1642a4eb55ad5302abca55a /vcl/headless | |
parent | bd944fe3812fd9fa5a90e98cdac4a77f1a4e6865 (diff) |
remove support for BITMASK in vcl backends
Rather use a proper alpha channel if we need transparency.
This is another small step towards merged alpha in our vcl
layer.
I suspect the intent in a lot of this code was to save memory.
Which have been a thing way back then, but these days our
backends mostly end up doing a copy-and-convert to a real
alpha channel anyway, so the existing code is actually
now a pessimisation.
Change-Id: I4a2bcbb2f76b841f05bc00580f364492829c69de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114808
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpinst.cxx | 4 | ||||
-rw-r--r-- | vcl/headless/svpvd.cxx | 12 |
2 files changed, 5 insertions, 11 deletions
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx index 954f6539d2e6..422928f98d38 100644 --- a/vcl/headless/svpinst.cxx +++ b/vcl/headless/svpinst.cxx @@ -243,7 +243,7 @@ void SvpSalInstance::DestroyObject( SalObject* pObject ) std::unique_ptr<SalVirtualDevice> SvpSalInstance::CreateVirtualDevice(SalGraphics* pGraphics, tools::Long &nDX, tools::Long &nDY, - DeviceFormat eFormat, + DeviceFormat /*eFormat*/, const SystemGraphicsData* pGd) { SvpSalGraphics *pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics); @@ -258,7 +258,7 @@ std::unique_ptr<SalVirtualDevice> SvpSalInstance::CreateVirtualDevice(SalGraphic (void)pGd; cairo_surface_t* pPreExistingTarget = nullptr; #endif - std::unique_ptr<SalVirtualDevice> pNew(new SvpSalVirtualDevice(eFormat, pSvpSalGraphics->getSurface(), pPreExistingTarget)); + std::unique_ptr<SalVirtualDevice> pNew(new SvpSalVirtualDevice(pSvpSalGraphics->getSurface(), pPreExistingTarget)); pNew->SetSize( nDX, nDY ); return pNew; } diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index 9025326827a6..f8e9cb5e6874 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -31,9 +31,8 @@ using namespace basegfx; -SvpSalVirtualDevice::SvpSalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget) - : m_eFormat(eFormat) - , m_pRefSurface(pRefSurface) +SvpSalVirtualDevice::SvpSalVirtualDevice(cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget) + : m_pRefSurface(pRefSurface) , m_pSurface(pPreExistingTarget) , m_bOwnsSurface(!pPreExistingTarget) { @@ -77,12 +76,7 @@ void SvpSalVirtualDevice::CreateSurface(tools::Long nNewDX, tools::Long nNewDY, cairo_surface_destroy(m_pSurface); } - if (m_eFormat == DeviceFormat::BITMASK) - { - m_pSurface = cairo_surface_create_similar(m_pRefSurface, CAIRO_CONTENT_ALPHA, - nNewDX, nNewDY); - } - else if (pBuffer) + if (pBuffer) { double fXScale, fYScale; if (comphelper::LibreOfficeKit::isActive()) |