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>
This commit is contained in:
@@ -27,14 +27,9 @@
|
||||
|
||||
namespace vclcanvas
|
||||
{
|
||||
BackBuffer::BackBuffer( const OutputDevice& rRefDevice,
|
||||
bool bMonochromeBuffer ) :
|
||||
maVDev( VclPtr<VirtualDevice>::Create( rRefDevice,
|
||||
bMonochromeBuffer ? DeviceFormat::BITMASK : DeviceFormat::DEFAULT ) )
|
||||
BackBuffer::BackBuffer( const OutputDevice& rRefDevice ) :
|
||||
maVDev( VclPtr<VirtualDevice>::Create( rRefDevice, DeviceFormat::DEFAULT ) )
|
||||
{
|
||||
if( bMonochromeBuffer )
|
||||
return;
|
||||
|
||||
tools::SetDefaultDeviceAntiAliasing( maVDev );
|
||||
}
|
||||
|
||||
|
||||
@@ -31,15 +31,8 @@ namespace vclcanvas
|
||||
class BackBuffer : public OutDevProvider
|
||||
{
|
||||
public:
|
||||
/** Create a backbuffer for given reference device
|
||||
|
||||
@param bMonochromeBuffer
|
||||
When false, default depth of reference device is
|
||||
chosen. When true, the buffer will be monochrome, i.e. one
|
||||
bit deep.
|
||||
*/
|
||||
BackBuffer( const OutputDevice& rRefDevice,
|
||||
bool bMonochromeBuffer=false );
|
||||
/** Create a backbuffer for given reference device */
|
||||
BackBuffer( const OutputDevice& rRefDevice );
|
||||
virtual ~BackBuffer() override;
|
||||
|
||||
virtual OutputDevice& getOutDev() override;
|
||||
|
||||
@@ -58,9 +58,8 @@ namespace vclcanvas
|
||||
BackBufferSharedPtr pBackBuffer = std::make_shared<BackBuffer>( rOutDevProvider->getOutDev() );
|
||||
pBackBuffer->setSize( aSize );
|
||||
|
||||
// create mask backbuffer, with one bit color depth
|
||||
BackBufferSharedPtr pBackBufferMask = std::make_shared<BackBuffer>( rOutDevProvider->getOutDev(),
|
||||
true );
|
||||
// create mask backbuffer
|
||||
BackBufferSharedPtr pBackBufferMask = std::make_shared<BackBuffer>( rOutDevProvider->getOutDev() );
|
||||
pBackBufferMask->setSize( aSize );
|
||||
|
||||
// TODO(F1): Implement alpha vdev (could prolly enable
|
||||
|
||||
@@ -234,7 +234,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
|
||||
maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0);
|
||||
|
||||
// init paint buffering VirtualDevice
|
||||
mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::BITMASK);
|
||||
mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT);
|
||||
mxVirtualBufferDevice->SetOutputSizePixel(maParentDialogSize);
|
||||
mxVirtualBufferDevice->SetFillColor(COL_TRANSPARENT);
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace drawinglayer::primitive2d
|
||||
maGraphic(rGraphic),
|
||||
maAnimation(rGraphic.GetAnimation()),
|
||||
maVirtualDevice(*Application::GetDefaultDevice()),
|
||||
maVirtualDeviceMask(*Application::GetDefaultDevice(), DeviceFormat::BITMASK),
|
||||
maVirtualDeviceMask(*Application::GetDefaultDevice()),
|
||||
mnNextFrameToPrepare(SAL_MAX_UINT32),
|
||||
maBufferedFirstFrame(),
|
||||
maBufferedPrimitives(),
|
||||
|
||||
@@ -4472,7 +4472,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
|
||||
rOutliner.SetStyleSheetPool(static_cast< SfxStyleSheetPool* >(pRet->getSdrModelFromSdrObject().GetStyleSheetPool()));
|
||||
rOutliner.SetUpdateMode( false );
|
||||
rOutliner.SetText( *pParaObj );
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT);
|
||||
pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM));
|
||||
sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
|
||||
if ( nParagraphs )
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
enum class DeviceFormat {
|
||||
NONE = -1,
|
||||
DEFAULT = 0,
|
||||
BITMASK = 1,
|
||||
#ifdef IOS
|
||||
GRAYSCALE = 8
|
||||
#endif
|
||||
|
||||
+7
-14
@@ -82,13 +82,11 @@ protected:
|
||||
|
||||
@param eFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
|
||||
@param eAlphaFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
|
||||
@param eOutDevType
|
||||
This real virtual output device type.
|
||||
@@ -102,13 +100,11 @@ public:
|
||||
|
||||
@param eFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
|
||||
@param eAlphaFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
*/
|
||||
explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::DEFAULT, DeviceFormat eAlphaFormat = DeviceFormat::NONE)
|
||||
: VirtualDevice(nullptr, eFormat, eAlphaFormat, OUTDEV_VIRDEV) {}
|
||||
@@ -120,8 +116,7 @@ public:
|
||||
|
||||
@param eFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
*/
|
||||
explicit VirtualDevice(const OutputDevice& rCompDev,
|
||||
DeviceFormat eFormat = DeviceFormat::DEFAULT)
|
||||
@@ -134,13 +129,11 @@ public:
|
||||
|
||||
@param eFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
|
||||
@param eAlphaFormat
|
||||
Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to
|
||||
indicate: take default screen depth. Only DeviceFormat::BITMASK
|
||||
is the other possibility to denote a binary mask.
|
||||
indicate: take default screen depth.
|
||||
*/
|
||||
explicit VirtualDevice(const OutputDevice& rCompDev,
|
||||
DeviceFormat eFormat, DeviceFormat eAlphaFormat)
|
||||
|
||||
@@ -185,7 +185,7 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
|
||||
#ifdef IOS
|
||||
mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::GRAYSCALE);
|
||||
#else
|
||||
mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::BITMASK);
|
||||
mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
|
||||
#endif
|
||||
mpVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1);
|
||||
MapMode aMapMode( mpVirtualDevice_100th_mm->GetMapMode() );
|
||||
|
||||
@@ -395,7 +395,7 @@ void ScZoomSlider::DoPaint(vcl::RenderContext& rRenderContext)
|
||||
Size aSliderWindowSize(GetOutputSizePixel());
|
||||
tools::Rectangle aRect(Point(0, 0), aSliderWindowSize);
|
||||
|
||||
ScopedVclPtrInstance< VirtualDevice > pVDev(rRenderContext, DeviceFormat::DEFAULT, DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > pVDev(rRenderContext);
|
||||
pVDev->SetOutputSizePixel(aSliderWindowSize);
|
||||
pVDev->SetFillColor( COL_TRANSPARENT );
|
||||
pVDev->SetLineColor( COL_TRANSPARENT );
|
||||
|
||||
@@ -274,7 +274,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
|
||||
pVDev->EnableMapMode( false );
|
||||
|
||||
// setup mask VDev (alpha VDev is currently rather slow)
|
||||
ScopedVclPtrInstance<VirtualDevice> pVDevMask(DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance<VirtualDevice> pVDevMask(DeviceFormat::DEFAULT);
|
||||
pVDevMask->SetOutputSizePixel( aAnimSize );
|
||||
pVDevMask->EnableMapMode( false );
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ static void CalculateHorizontalScalingFactor(
|
||||
aFont.SetOrientation( 0_deg10 );
|
||||
// initializing virtual device
|
||||
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT);
|
||||
pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM));
|
||||
pVirDev->SetFont( aFont );
|
||||
|
||||
@@ -303,7 +303,7 @@ static void GetTextAreaOutline(
|
||||
aFont.SetWeight( rWeightItem.GetWeight() );
|
||||
|
||||
// initializing virtual device
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT);
|
||||
pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM));
|
||||
pVirDev->SetFont( aFont );
|
||||
pVirDev->EnableRTL();
|
||||
|
||||
@@ -263,7 +263,7 @@ VirtualDevice& DocumentDeviceManager::CreateVirtualDevice_() const
|
||||
#ifdef IOS
|
||||
VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::GRAYSCALE);
|
||||
#else
|
||||
VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::BITMASK);
|
||||
VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
|
||||
#endif
|
||||
|
||||
pNewVir->SetReferenceDevice( VirtualDevice::RefDevMode::MSO1 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -31,7 +31,6 @@ typedef struct _cairo_surface cairo_surface_t;
|
||||
|
||||
class VCL_DLLPUBLIC SvpSalVirtualDevice : public SalVirtualDevice
|
||||
{
|
||||
DeviceFormat m_eFormat;
|
||||
cairo_surface_t* m_pRefSurface;
|
||||
cairo_surface_t* m_pSurface;
|
||||
bool m_bOwnsSurface; // nearly always true, except for edge case of tdf#127529
|
||||
@@ -44,7 +43,7 @@ protected:
|
||||
SvpSalGraphics* AddGraphics(SvpSalGraphics* aGraphics);
|
||||
|
||||
public:
|
||||
SvpSalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget);
|
||||
SvpSalVirtualDevice(cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget);
|
||||
virtual ~SvpSalVirtualDevice() override;
|
||||
|
||||
// SalVirtualDevice
|
||||
|
||||
@@ -34,12 +34,11 @@ class Qt5VirtualDevice final : public SalVirtualDevice
|
||||
{
|
||||
std::vector<Qt5Graphics*> m_aGraphics;
|
||||
std::unique_ptr<QImage> m_pImage;
|
||||
DeviceFormat m_eFormat;
|
||||
QSize m_aFrameSize;
|
||||
double m_fScale;
|
||||
|
||||
public:
|
||||
Qt5VirtualDevice(DeviceFormat eFormat, double fScale);
|
||||
Qt5VirtualDevice(double fScale);
|
||||
|
||||
// SalVirtualDevice
|
||||
virtual SalGraphics* AcquireGraphics() override;
|
||||
|
||||
@@ -72,7 +72,7 @@ void LifecycleTest::testVirtualDevice()
|
||||
VclPtr<VirtualDevice> pVDev = VclPtr< VirtualDevice >::Create();
|
||||
ScopedVclPtrInstance< VirtualDevice > pVDev2;
|
||||
VclPtrInstance<VirtualDevice> pVDev3;
|
||||
VclPtrInstance<VirtualDevice> pVDev4(DeviceFormat::BITMASK);
|
||||
VclPtrInstance<VirtualDevice> pVDev4(DeviceFormat::DEFAULT);
|
||||
CPPUNIT_ASSERT(!!pVDev);
|
||||
CPPUNIT_ASSERT(!!pVDev2);
|
||||
CPPUNIT_ASSERT(!!pVDev3);
|
||||
|
||||
@@ -311,7 +311,7 @@ void Qt5Instance::DestroyObject(SalObject* pObject)
|
||||
|
||||
std::unique_ptr<SalVirtualDevice>
|
||||
Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, tools::Long& nDX, tools::Long& nDY,
|
||||
DeviceFormat eFormat, const SystemGraphicsData* pGd)
|
||||
DeviceFormat /*eFormat*/, const SystemGraphicsData* pGd)
|
||||
{
|
||||
if (m_bUseCairo)
|
||||
{
|
||||
@@ -321,13 +321,13 @@ Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, tools::Long& nDX, tools
|
||||
cairo_surface_t* pPreExistingTarget
|
||||
= pGd ? static_cast<cairo_surface_t*>(pGd->pSurface) : nullptr;
|
||||
std::unique_ptr<SalVirtualDevice> pVD(
|
||||
new Qt5SvpVirtualDevice(eFormat, pSvpSalGraphics->getSurface(), pPreExistingTarget));
|
||||
new Qt5SvpVirtualDevice(pSvpSalGraphics->getSurface(), pPreExistingTarget));
|
||||
pVD->SetSize(nDX, nDY);
|
||||
return pVD;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::unique_ptr<SalVirtualDevice> pVD(new Qt5VirtualDevice(eFormat, 1));
|
||||
std::unique_ptr<SalVirtualDevice> pVD(new Qt5VirtualDevice(/*scale*/ 1));
|
||||
pVD->SetSize(nDX, nDY);
|
||||
return pVD;
|
||||
}
|
||||
|
||||
@@ -25,9 +25,8 @@
|
||||
class VCL_DLLPUBLIC Qt5SvpVirtualDevice : public SvpSalVirtualDevice
|
||||
{
|
||||
public:
|
||||
Qt5SvpVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface,
|
||||
cairo_surface_t* pPreExistingTarget)
|
||||
: SvpSalVirtualDevice(eFormat, pRefSurface, pPreExistingTarget)
|
||||
Qt5SvpVirtualDevice(cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget)
|
||||
: SvpSalVirtualDevice(pRefSurface, pPreExistingTarget)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,8 @@
|
||||
|
||||
#include <QtGui/QImage>
|
||||
|
||||
Qt5VirtualDevice::Qt5VirtualDevice(DeviceFormat eFormat, double fScale)
|
||||
: m_eFormat(eFormat)
|
||||
, m_fScale(fScale)
|
||||
Qt5VirtualDevice::Qt5VirtualDevice(double fScale)
|
||||
: m_fScale(fScale)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -67,17 +66,10 @@ bool Qt5VirtualDevice::SetSizeUsingBuffer(tools::Long nNewDX, tools::Long nNewDY
|
||||
nNewDX *= m_fScale;
|
||||
nNewDY *= m_fScale;
|
||||
|
||||
if (m_eFormat == DeviceFormat::BITMASK)
|
||||
{
|
||||
m_pImage.reset(new QImage(nNewDX, nNewDY, QImage::Format_Mono));
|
||||
}
|
||||
if (pBuffer)
|
||||
m_pImage.reset(new QImage(pBuffer, nNewDX, nNewDY, Qt5_DefaultFormat32));
|
||||
else
|
||||
{
|
||||
if (pBuffer)
|
||||
m_pImage.reset(new QImage(pBuffer, nNewDX, nNewDY, Qt5_DefaultFormat32));
|
||||
else
|
||||
m_pImage.reset(new QImage(nNewDX, nNewDY, Qt5_DefaultFormat32));
|
||||
}
|
||||
m_pImage.reset(new QImage(nNewDX, nNewDY, Qt5_DefaultFormat32));
|
||||
|
||||
m_pImage->fill(Qt::transparent);
|
||||
m_pImage->setDevicePixelRatio(m_fScale);
|
||||
|
||||
@@ -116,9 +116,6 @@ AquaSalVirtualDevice::AquaSalVirtualDevice(
|
||||
mpGraphics = new AquaSalGraphics(); // never fails
|
||||
switch (eFormat)
|
||||
{
|
||||
case DeviceFormat::BITMASK:
|
||||
mnBitmapDepth = 1;
|
||||
break;
|
||||
#ifdef IOS
|
||||
case DeviceFormat::GRAYSCALE:
|
||||
mnBitmapDepth = 8;
|
||||
|
||||
@@ -548,8 +548,7 @@ BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx const & aBitmap, const tools::Long
|
||||
Size aStdSize( aStandardSize, aStandardSize );
|
||||
tools::Rectangle aRect(aEmptyPoint, aStdSize );
|
||||
|
||||
ScopedVclPtrInstance< VirtualDevice > aVirDevice(*Application::GetDefaultDevice(),
|
||||
DeviceFormat::DEFAULT, DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > aVirDevice(*Application::GetDefaultDevice());
|
||||
aVirDevice->SetOutputSizePixel( aStdSize );
|
||||
aVirDevice->SetFillColor( COL_TRANSPARENT );
|
||||
aVirDevice->SetLineColor( COL_TRANSPARENT );
|
||||
|
||||
@@ -2001,7 +2001,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const to
|
||||
vcl::Font aNotRotatedFont( maFont );
|
||||
aNotRotatedFont.SetOrientation( 0_deg10 );
|
||||
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT);
|
||||
pVirDev->SetMapMode( rVDev.GetMapMode() );
|
||||
pVirDev->SetFont( aNotRotatedFont );
|
||||
pVirDev->SetTextAlign( eTextAlign );
|
||||
|
||||
@@ -157,21 +157,10 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
|
||||
css::uno::Reference< css::uno::XInterface >() );
|
||||
}
|
||||
|
||||
switch (meFormat)
|
||||
{
|
||||
case DeviceFormat::BITMASK:
|
||||
mnBitCount = 1;
|
||||
break;
|
||||
default:
|
||||
mnBitCount = pOutDev->GetBitCount();
|
||||
break;
|
||||
}
|
||||
mnBitCount = pOutDev->GetBitCount();
|
||||
mnOutWidth = nDX;
|
||||
mnOutHeight = nDY;
|
||||
|
||||
if (meFormat == DeviceFormat::BITMASK)
|
||||
SetAntialiasing( AntialiasingFlags::DisableText );
|
||||
|
||||
mbScreenComp = pOutDev->IsScreenComp();
|
||||
|
||||
mbDevOutput = true;
|
||||
|
||||
@@ -215,7 +215,7 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
|
||||
|
||||
// cache virtual device for rotation
|
||||
if (!mpOutDevData->mpRotateDev)
|
||||
mpOutDevData->mpRotateDev = VclPtr<VirtualDevice>::Create(*this, DeviceFormat::BITMASK);
|
||||
mpOutDevData->mpRotateDev = VclPtr<VirtualDevice>::Create(*this);
|
||||
VirtualDevice* pVDev = mpOutDevData->mpRotateDev;
|
||||
|
||||
// size it accordingly
|
||||
|
||||
@@ -380,7 +380,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly,
|
||||
|
||||
if( !bDrawn )
|
||||
{
|
||||
ScopedVclPtrInstance< VirtualDevice > aVDev(*this, DeviceFormat::BITMASK);
|
||||
ScopedVclPtrInstance< VirtualDevice > aVDev(*this);
|
||||
const Size aDstSz( aDstRect.GetSize() );
|
||||
const sal_uInt8 cTrans = static_cast<sal_uInt8>(MinMax( FRound( nTransparencePercent * 2.55 ), 0, 255 ));
|
||||
|
||||
|
||||
@@ -302,13 +302,8 @@ namespace cairo
|
||||
{
|
||||
if (!maSysData.pRenderFormat)
|
||||
return DeviceFormat::DEFAULT;
|
||||
switch (static_cast<XRenderPictFormat*>(maSysData.pRenderFormat)->depth)
|
||||
{
|
||||
case 1:
|
||||
return DeviceFormat::BITMASK;
|
||||
default:
|
||||
return DeviceFormat::DEFAULT;
|
||||
}
|
||||
assert (static_cast<XRenderPictFormat*>(maSysData.pRenderFormat)->depth != 1 && "unsupported");
|
||||
return DeviceFormat::DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, cairo_surface_t* pPreEx
|
||||
}
|
||||
|
||||
X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics const * pGraphics, tools::Long &nDX, tools::Long &nDY,
|
||||
DeviceFormat eFormat, const SystemGraphicsData *pData,
|
||||
DeviceFormat /*eFormat*/, const SystemGraphicsData *pData,
|
||||
std::unique_ptr<X11SalGraphics> pNewGraphics) :
|
||||
pGraphics_(std::move(pNewGraphics)),
|
||||
m_nXScreen(0),
|
||||
@@ -96,18 +96,7 @@ X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics const * pGraphics, tools::L
|
||||
SalColormap* pColormap = nullptr;
|
||||
bool bDeleteColormap = false;
|
||||
|
||||
sal_uInt16 nBitCount;
|
||||
switch (eFormat)
|
||||
{
|
||||
case DeviceFormat::BITMASK:
|
||||
nBitCount = 1;
|
||||
break;
|
||||
default:
|
||||
nBitCount = pGraphics->GetBitCount();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
sal_uInt16 nBitCount = pGraphics->GetBitCount();
|
||||
pDisplay_ = vcl_sal::getSalDisplay(GetGenericUnixSalData());
|
||||
nDepth_ = nBitCount;
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ void GtkYieldMutex::ThreadsLeave()
|
||||
|
||||
std::unique_ptr<SalVirtualDevice> GtkInstance::CreateVirtualDevice( SalGraphics *pG,
|
||||
tools::Long &nDX, tools::Long &nDY,
|
||||
DeviceFormat eFormat,
|
||||
DeviceFormat /*eFormat*/,
|
||||
const SystemGraphicsData* pGd )
|
||||
{
|
||||
EnsureInit();
|
||||
@@ -343,7 +343,7 @@ std::unique_ptr<SalVirtualDevice> GtkInstance::CreateVirtualDevice( SalGraphics
|
||||
assert(pSvpSalGraphics);
|
||||
// tdf#127529 see SvpSalInstance::CreateVirtualDevice for the rare case of a non-null pPreExistingTarget
|
||||
cairo_surface_t* pPreExistingTarget = pGd ? static_cast<cairo_surface_t*>(pGd->pSurface) : nullptr;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ HBITMAP WinSalVirtualDevice::ImplCreateVirDevBitmap(HDC hDC, tools::Long nDX, to
|
||||
|
||||
std::unique_ptr<SalVirtualDevice> WinSalInstance::CreateVirtualDevice( SalGraphics* pSGraphics,
|
||||
tools::Long &nDX, tools::Long &nDY,
|
||||
DeviceFormat eFormat,
|
||||
DeviceFormat /*eFormat*/,
|
||||
const SystemGraphicsData* pData )
|
||||
{
|
||||
WinSalGraphics* pGraphics = static_cast<WinSalGraphics*>(pSGraphics);
|
||||
@@ -102,8 +102,7 @@ std::unique_ptr<SalVirtualDevice> WinSalInstance::CreateVirtualDevice( SalGraphi
|
||||
if (!hDC)
|
||||
return nullptr;
|
||||
|
||||
sal_uInt16 nBitCount = (eFormat == DeviceFormat::BITMASK) ? 1 : 0;
|
||||
|
||||
sal_uInt16 nBitCount = 0;
|
||||
HBITMAP hBmp = nullptr;
|
||||
if (!pData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user