diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-06 18:14:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-07 10:19:32 +0000 |
commit | 00659bcdbbb167596e6fd18e283a54819dd6fe91 (patch) | |
tree | 65316f99002c5aa6851ee1770df557b789772f20 | |
parent | 545ddfbaa98cfeaa35c95d7db7b16cd241cedc89 (diff) |
improve readability of VirtualDevice constructor
(a) It is not obvious what DeviceFormat::DEFAULT means
(b) There are two parameters (each with two states), but only really 2
possible overall states
So
(1) use more useful names
(2) combine the two parameters into one enum
Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
50 files changed, 126 insertions, 156 deletions
diff --git a/canvas/qa/cppunit/canvastest.cxx b/canvas/qa/cppunit/canvastest.cxx index 7927f07c0723..d4cba860db43 100644 --- a/canvas/qa/cppunit/canvastest.cxx +++ b/canvas/qa/cppunit/canvastest.cxx @@ -76,9 +76,8 @@ public: void setupCanvas(const Size& size, Color backgroundColor = COL_WHITE, bool alpha = false) { - mVclDevice - = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT) - : VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + mVclDevice = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA) + : VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); mVclDevice->SetOutputSizePixel(size); mVclDevice->SetBackground(Wallpaper(backgroundColor)); mVclDevice->Erase(); diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index 9a8771428d93..4b223d1cad0f 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -83,7 +83,7 @@ namespace dxcanvas SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDC = reinterpret_cast< ::HDC >(hdc); - ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::WITHOUT_ALPHA); // disable font antialiasing - GDI does not handle alpha // surfaces properly. @@ -246,7 +246,7 @@ namespace dxcanvas SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDC = reinterpret_cast< ::HDC >(GetDC( nullptr )); - ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::WITHOUT_ALPHA); // create the font const css::rendering::FontRequest& rFontRequest = rCanvasFont->getFontRequest(); diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx index 684a02c8bd55..aa45a56e7ab6 100644 --- a/canvas/source/vcl/backbuffer.cxx +++ b/canvas/source/vcl/backbuffer.cxx @@ -28,7 +28,7 @@ namespace vclcanvas { BackBuffer::BackBuffer( const OutputDevice& rRefDevice ) : - maVDev( VclPtr<VirtualDevice>::Create( rRefDevice, DeviceFormat::DEFAULT ) ) + maVDev( VclPtr<VirtualDevice>::Create( rRefDevice, DeviceFormat::WITHOUT_ALPHA ) ) { tools::SetDefaultDeviceAntiAliasing( maVDev ); } diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index d6f87e3c0e00..3766276f3b53 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.cxx @@ -112,7 +112,7 @@ namespace vclcanvas // VDev not yet created, do it now. Create an alpha-VDev, // if bitmap has transparency. mpVDev = maBitmap->IsAlpha() ? - VclPtr<VirtualDevice>::Create( mrRefDevice, DeviceFormat::DEFAULT, DeviceFormat::DEFAULT ) : + VclPtr<VirtualDevice>::Create( mrRefDevice, DeviceFormat::WITH_ALPHA ) : VclPtr<VirtualDevice>::Create( mrRefDevice ); OSL_ENSURE( mpVDev, diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index 248a87e77b3e..b1dff7cb404f 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -228,7 +228,7 @@ namespace cppcanvas::internal // render our content into an appropriately sized // VirtualDevice with alpha channel ScopedVclPtrInstance<VirtualDevice> aVDev( - *::Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT ); + *::Application::GetDefaultDevice(), DeviceFormat::WITH_ALPHA ); aVDev->SetOutputSizePixel( aBitmapSizePixel ); aVDev->SetMapMode(); diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index f4f53f8c8655..8bdbbc2bf6f4 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -55,7 +55,7 @@ static sal_Int32 makeEnumComboBox(weld::ComboBox& rNameBox, void FontFeaturesDialog::initialize() { ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(), - DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + DeviceFormat::WITH_ALPHA); std::vector<vcl::font::Feature> rFontFeatures = getFontFeatureList(m_sFontName, *aVDev); std::unordered_set<sal_uInt32> aDoneFeatures; diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index 6994ce1ed7e8..c23146f91fbd 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -232,7 +232,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( maDimmedDialogBitmap.Adjust(-15, 0, 0, 0, 0); // init paint buffering VirtualDevice - mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT); + mxVirtualBufferDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::WITHOUT_ALPHA); mxVirtualBufferDevice->SetOutputSizePixel(maParentDialogSize); mxVirtualBufferDevice->SetFillColor(COL_TRANSPARENT); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 194dfd65f830..7f418a762047 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -224,7 +224,7 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController* , m_xCTLFontFeaturesButton(m_xBuilder->weld_button("btnCTLFeatures")) , m_xCTLFontTypeFT(m_xBuilder->weld_label("lbCTLFontinfo")) - , m_xVDev(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT) + , m_xVDev(*Application::GetDefaultDevice(), DeviceFormat::WITH_ALPHA) { m_xPreviewWin.reset(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWin)); #ifdef IOS diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0e9e2c203fff..9eb8fc64547b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3754,7 +3754,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, double fDPIScaleX = 1.0; paintTileIOS(pThis, pBuffer, nCanvasWidth, nCanvasHeight, fDPIScaleX, nTilePosX, nTilePosY, nTileWidth, nTileHeight); #else - ScopedVclPtrInstance< VirtualDevice > pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > pDevice(DeviceFormat::WITHOUT_ALPHA); // Set background to transparent by default. pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); @@ -5632,7 +5632,7 @@ static char* getFontSubset (std::string_view aFontName) if (const vcl::Font* pFont = FindFont(aFoundFont)) { FontCharMapRef xFontCharMap (new FontCharMap()); - auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); aDevice->SetFont(*pFont); aDevice->GetFontCharMap(xFontCharMap); @@ -6269,7 +6269,7 @@ unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER LibreOfficeKitDocu if (aText.isEmpty()) aText = aFont.GetFamilyName(); - auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); ::tools::Rectangle aRect; aFont.SetFontSize(Size(0, nDefaultFontSize)); aFont.SetOrientation(Degree10(pOrientation)); @@ -6408,7 +6408,7 @@ static void doc_paintWindowForView(LibreOfficeKitDocument* pThis, unsigned nLOKW #else - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nWidth, nHeight), Fraction(1.0), Point(), pBuffer); diff --git a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx index 4f0a312ec1d7..478645cbf5b1 100644 --- a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx +++ b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx @@ -61,9 +61,8 @@ public: void setupCanvas(const Size& size, Color backgroundColor = COL_WHITE, bool alpha = false) { - mVclDevice - = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT) - : VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + mVclDevice = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA) + : VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); mVclDevice->SetOutputSizePixel(size); mVclDevice->SetBackground(Wallpaper(backgroundColor)); mVclDevice->Erase(); diff --git a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx index daf54c910e29..573c4bdc32f0 100644 --- a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx +++ b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx @@ -46,7 +46,8 @@ public: // Test that drawing only a part of a gradient draws the proper part of it. void testTdf139000() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(100, 200)); device->SetBackground(Wallpaper(COL_RED)); device->Erase(); diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index f4373778ceb0..37dae31a4e26 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -234,7 +234,7 @@ VclPtr<VirtualDevice> VDevBuffer::alloc(OutputDevice& rOutDev, const Size& rSize // no success yet, create new buffer if (!pRetval) { - pRetval = VclPtr<VirtualDevice>::Create(rOutDev, DeviceFormat::DEFAULT); + pRetval = VclPtr<VirtualDevice>::Create(rOutDev, DeviceFormat::WITHOUT_ALPHA); maDeviceTemplates[pRetval] = &rOutDev; pRetval->SetOutputSizePixel(rSizePixel, true); } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 552deee7df5f..afbc0a43869e 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4561,7 +4561,7 @@ rtl::Reference<SdrObject> SvxMSDffManager::ImportShape( const DffRecordHeader& r rOutliner.SetStyleSheetPool(static_cast< SfxStyleSheetPool* >(xRet->getSdrModelFromSdrObject().GetStyleSheetPool())); bool bOldUpdateMode = rOutliner.SetUpdateLayout( false ); rOutliner.SetText( *pParaObj ); - ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount(); if ( nParagraphs ) diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx index efd5cc8060d3..65213d4f7af5 100644 --- a/include/vcl/salgtype.hxx +++ b/include/vcl/salgtype.hxx @@ -27,7 +27,8 @@ enum class DeviceFormat { NONE = -1, - DEFAULT = 0, + WITHOUT_ALPHA = 0, + WITH_ALPHA = 1, #ifdef IOS GRAYSCALE = 8 #endif diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index b611e7f8aecd..0f6ec8ee1857 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -50,8 +50,7 @@ private: VclPtr<VirtualDevice> mpNext; sal_uInt16 mnBitCount; bool mbScreenComp; - const DeviceFormat meFormat; - const DeviceFormat meAlphaFormat; + const DeviceFormat meFormatAndAlpha; RefDevMode meRefDevMode; bool mbForceZeroExtleadBug; @@ -81,33 +80,23 @@ protected: If it's the nullptr, it uses Application::GetDefaultDevice(). @param eFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. - - @param eAlphaFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. + Device format of the generated virtual device. @param eOutDevType This real virtual output device type. */ explicit VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, - DeviceFormat eAlphaFormat, OutDevType eOutDevType); + OutDevType eOutDevType); public: /** Create a virtual device of size 1x1 @param eFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. - - @param eAlphaFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. + Device format of the generated virtual device. */ - explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::DEFAULT, DeviceFormat eAlphaFormat = DeviceFormat::NONE) - : VirtualDevice(nullptr, eFormat, eAlphaFormat, OUTDEV_VIRDEV) {} + explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::WITHOUT_ALPHA) + : VirtualDevice(nullptr, eFormat, OUTDEV_VIRDEV) {} /** Create a virtual device of size 1x1 @@ -115,29 +104,11 @@ public: The generated vdev will be compatible to this device. @param eFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. - */ - explicit VirtualDevice(const OutputDevice& rCompDev, - DeviceFormat eFormat = DeviceFormat::DEFAULT) - : VirtualDevice(&rCompDev, eFormat, DeviceFormat::NONE, OUTDEV_VIRDEV) {} - - /** Create a virtual device of size 1x1 with alpha channel - - @param rCompDev - The generated vdev will be compatible to this device. - - @param eFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. - - @param eAlphaFormat - Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to - indicate: take default screen depth. + Device format of the generated virtual device. */ explicit VirtualDevice(const OutputDevice& rCompDev, - DeviceFormat eFormat, DeviceFormat eAlphaFormat) - : VirtualDevice(&rCompDev, eFormat, eAlphaFormat, OUTDEV_VIRDEV) {} + DeviceFormat eFormat = DeviceFormat::WITHOUT_ALPHA) + : VirtualDevice(&rCompDev, eFormat, OUTDEV_VIRDEV) {} /** Create a virtual device using an existing system dependent device or graphics context Any rendering will happen directly on the context and not on any intermediate bitmap. diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 47ed1530c075..84b9a941ba50 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1440,7 +1440,7 @@ void ScTiledRenderingTest::testInsertGraphicInvalidations() int nCanvasWidth = 256; int nCanvasHeight = 256; std::vector<unsigned char> aBuffer(nCanvasWidth * nCanvasHeight * 4); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer.data()); pModelObj->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, /*nTilePosY=*/0, /*nTileWidth=*/3840, /*nTileHeight=*/3840); Scheduler::ProcessEventsToIdle(); @@ -1476,7 +1476,7 @@ void ScTiledRenderingTest::testDocumentSizeWithTwoViews() int nCanvasWidth = 256; int nCanvasHeight = 256; std::vector<unsigned char> aBuffer1(nCanvasWidth * nCanvasHeight * 4); - ScopedVclPtrInstance<VirtualDevice> pDevice1(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice1(DeviceFormat::WITHOUT_ALPHA); pDevice1->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer1.data()); pModelObj->paintTile(*pDevice1, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, /*nTilePosY=*/291840, /*nTileWidth=*/3840, /*nTileHeight=*/3840); Scheduler::ProcessEventsToIdle(); @@ -1486,7 +1486,7 @@ void ScTiledRenderingTest::testDocumentSizeWithTwoViews() SfxLokHelper::createView(); std::vector<unsigned char> aBuffer2(nCanvasWidth * nCanvasHeight * 4); - ScopedVclPtrInstance<VirtualDevice> pDevice2(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice2(DeviceFormat::WITHOUT_ALPHA); pDevice2->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer2.data()); pModelObj->paintTile(*pDevice2, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, /*nTilePosY=*/291840, /*nTileWidth=*/3840, /*nTileHeight=*/3840); Scheduler::ProcessEventsToIdle(); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 94072cd2931f..7adf00852e75 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -186,7 +186,7 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm() #ifdef IOS mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::GRAYSCALE); #else - mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + mpVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); #endif mpVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1); MapMode aMapMode( mpVirtualDevice_100th_mm->GetMapMode() ); diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index c1eb0ea90616..3e5139d32fb9 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -128,7 +128,7 @@ void InsertionIndicatorOverlay::Create ( // Create virtual devices for bitmap and mask whose bitmaps later be // combined to form the BitmapEx of the icon. ScopedVclPtrInstance<VirtualDevice> pContent( - *mrSlideSorter.GetContentWindow()->GetOutDev(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + *mrSlideSorter.GetContentWindow()->GetOutDev(), DeviceFormat::WITH_ALPHA); pContent->SetOutputSizePixel(aIconSize); pContent->SetFillColor(); diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 2e60b5b54279..0c9e432850c6 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -268,7 +268,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, pVDev->EnableMapMode( false ); // setup mask VDev (alpha VDev is currently rather slow) - ScopedVclPtrInstance<VirtualDevice> pVDevMask(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pVDevMask(DeviceFormat::WITHOUT_ALPHA); pVDevMask->SetOutputSizePixel( aAnimSize ); pVDevMask->EnableMapMode( false ); diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 672cd28fbc8e..f0e569737d67 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -225,7 +225,7 @@ static void CalculateHorizontalScalingFactor( aFont.SetOrientation( 0_deg10 ); // initializing virtual device - ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); @@ -338,7 +338,7 @@ static void GetTextAreaOutline( aFont.SetWeight( rWeightItem.GetWeight() ); // initializing virtual device - ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); pVirDev->EnableRTL(); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index d16c0b4d92cc..adda37b22e45 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -32,7 +32,7 @@ namespace svx { const tools::Long DIAL_OUTER_WIDTH = 8; DialControlBmp::DialControlBmp(OutputDevice& rReference) - : VirtualDevice(rReference, DeviceFormat::DEFAULT, DeviceFormat::DEFAULT) + : VirtualDevice(rReference, DeviceFormat::WITH_ALPHA) , mbEnabled(true) , mrParent(rReference) , mnCenterX(0) diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 44accc6d51a7..bab0a27c010a 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -1838,7 +1838,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPaintCallbacks) int nCanvasWidth = 256; int nCanvasHeight = 256; std::vector<unsigned char> aBuffer(nCanvasWidth * nCanvasHeight * 4); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer.data()); // Make sure that painting a tile in the second view doesn't invoke // callbacks on the first view. @@ -2674,7 +2674,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSemiTransparent) size_t nCanvasHeight = 512; size_t nTileSize = 256; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2703,7 +2703,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHighlightNumbering) size_t nCanvasHeight = 512; size_t nTileSize = 256; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2728,7 +2728,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testHighlightNumbering_shd) size_t nCanvasHeight = 512; size_t nTileSize = 256; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2758,7 +2758,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPilcrowRedlining) size_t nCanvasHeight = 1024; size_t nTileSize = 512; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2821,7 +2821,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDoubleUnderlineAndStrikeOut) size_t nCanvasHeight = 350; size_t nTileSize = 350; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2867,7 +2867,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTdf43244_SpacesOnMargin) size_t nCanvasHeight = 512; size_t nTileSize = 64; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -2910,7 +2910,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testClipText) size_t nCanvasHeight = 512; size_t nTileSize = 256; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -3039,7 +3039,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton) size_t nCanvasWidth = 1024; size_t nCanvasHeight = 512; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -3112,7 +3112,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonEditing) size_t nCanvasWidth = 1024; size_t nCanvasHeight = 512; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -3169,7 +3169,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoSelectio size_t nCanvasWidth = 1024; size_t nCanvasHeight = 512; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -3255,7 +3255,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButtonNoItem) size_t nCanvasWidth = 1024; size_t nCanvasHeight = 512; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); @@ -3292,7 +3292,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTablePaintInvalidate) size_t nCanvasWidth = 256; size_t nCanvasHeight = 256; std::vector<unsigned char> aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); - ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aPixmap.data()); diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx index 251007bde7a6..b90474082c92 100644 --- a/sw/source/core/doc/DocumentDeviceManager.cxx +++ b/sw/source/core/doc/DocumentDeviceManager.cxx @@ -262,7 +262,7 @@ VirtualDevice& DocumentDeviceManager::CreateVirtualDevice_() const #ifdef IOS VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::GRAYSCALE); #else - VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); #endif pNewVir->SetReferenceDevice( VirtualDevice::RefDevMode::MSO1 ); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index abc6fb9bbc80..3ee457723a40 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3771,7 +3771,7 @@ void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_I sal_Int64 nWindowHandle; Parent >>= nWindowHandle; aData.hWnd = reinterpret_cast<HWND>(nWindowHandle); - ScopedVclPtrInstance<VirtualDevice> xDevice(aData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xDevice(aData, Size(1, 1), DeviceFormat::WITHOUT_ALPHA); paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); #else // TODO: support other platforms diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index ce0f7b8bc6e5..f1db0bf66637 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -274,7 +274,7 @@ std::pair<double, double> test::BootstrapFixture::getDPIScaling() sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount() { ScopedVclPtr<VirtualDevice> device - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); return device->GetBitCount(); } diff --git a/toolkit/source/controls/table/gridtablerenderer.cxx b/toolkit/source/controls/table/gridtablerenderer.cxx index 7047d01af7d7..cb3fe2ec1228 100644 --- a/toolkit/source/controls/table/gridtablerenderer.cxx +++ b/toolkit/source/controls/table/gridtablerenderer.cxx @@ -85,8 +85,7 @@ namespace svt::table Point const aBitmapPos( 0, 0 ); Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight ); - ScopedVclPtrInstance< VirtualDevice > aDevice(i_device, DeviceFormat::DEFAULT, - DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > aDevice(i_device, DeviceFormat::WITH_ALPHA); aDevice->SetOutputSizePixel( aBitmapSize ); DecorationView aDecoView(aDevice.get()); diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index adbae9599e0f..d85791e40745 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -352,9 +352,9 @@ OUString OutputDeviceTestCommon::getRenderBackendName() const void OutputDeviceTestCommon::initialSetup(tools::Long nWidth, tools::Long nHeight, Color aColor, bool bEnableAA, bool bAlphaVirtualDevice) { if (bAlphaVirtualDevice) - mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA); else - mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); maVDRectangle = tools::Rectangle(Point(), Size (nWidth, nHeight)); mpVirtualDevice->SetOutputSizePixel(maVDRectangle.GetSize()); diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index 4aeec29147c9..2c85be06e66d 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -779,7 +779,7 @@ public: { // Create normal virtual device (no alpha). ScopedVclPtr<VirtualDevice> device - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(10, 10)); // Erase with white, check it's white. device->SetBackground(Wallpaper(COL_WHITE)); @@ -806,7 +806,7 @@ public: { // Create virtual device with alpha. ScopedVclPtr<VirtualDevice> device - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA); device->SetOutputSizePixel(Size(10, 10)); // Erase with white, check it's white. device->SetBackground(Wallpaper(COL_WHITE)); @@ -1139,7 +1139,7 @@ public: return; // Create virtual device with alpha. ScopedVclPtr<VirtualDevice> device - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA); #ifdef MACOSX // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented if (getRenderBackendName(device) == "aqua") @@ -1194,7 +1194,8 @@ public: if (getDefaultDeviceBitCount() < 24) return; // Normal virtual device. - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); #ifdef MACOSX // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented if (getRenderBackendName(device) == "aqua") @@ -1202,7 +1203,7 @@ public: #endif // Virtual device with alpha. ScopedVclPtr<VirtualDevice> alphaDevice - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA); device->SetOutputSizePixel(Size(20, 20)); device->SetBackground(Wallpaper(COL_BLACK)); device->Erase(); @@ -1349,7 +1350,8 @@ public: void testTdf124848() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); #ifdef MACOSX // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented if (getRenderBackendName(device) == "aqua") @@ -1390,7 +1392,7 @@ public: return; // Create virtual device with alpha. ScopedVclPtr<VirtualDevice> device - = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA); device->SetOutputSizePixel(Size(10, 10)); device->SetBackground(Wallpaper(COL_WHITE)); device->Erase(); @@ -1415,7 +1417,8 @@ public: { // VCL may call copyArea()/copyBits() of backends even with coordinates partially // outside of the device, so try various copying like that. - ScopedVclPtr<VirtualDevice> device1 = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device1 + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device1->SetOutputSizePixel(Size(100, 100)); device1->SetBackground(Wallpaper(COL_YELLOW)); device1->Erase(); @@ -1429,7 +1432,8 @@ public: #endif // Plain 1:1 copy device1->device2. - ScopedVclPtr<VirtualDevice> device2 = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device2 + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device2->SetOutputSizePixel(Size(100, 100)); device2->DrawOutDev(Point(0, 0), Size(100, 100), Point(0, 0), Size(100, 100), *device1); exportDevice("tdf145811-1.png", device2); diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx index 9858c96e0a9f..9d47ceb17063 100644 --- a/vcl/qa/cppunit/FontFeatureTest.cxx +++ b/vcl/qa/cppunit/FontFeatureTest.cxx @@ -42,7 +42,7 @@ void FontFeatureTest::testGetFontFeaturesGraphite() { #if HAVE_MORE_FONTS ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(), - DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + DeviceFormat::WITH_ALPHA); aVDev->SetOutputSizePixel(Size(10, 10)); OUString aFontName("Linux Libertine G"); @@ -126,7 +126,7 @@ void FontFeatureTest::testGetFontFeaturesOpenType() { #if HAVE_MORE_FONTS ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(), - DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + DeviceFormat::WITH_ALPHA); aVDev->SetOutputSizePixel(Size(10, 10)); OUString aFontName("Amiri"); @@ -175,7 +175,7 @@ void FontFeatureTest::testGetFontFeaturesOpenTypeEnum() { #if HAVE_MORE_FONTS ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(), - DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + DeviceFormat::WITH_ALPHA); aVDev->SetOutputSizePixel(Size(10, 10)); OUString aFontName("Reem Kufi"); diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index 06758e4ae694..dbe02d455b04 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -182,8 +182,8 @@ void BitmapRenderTest::testAlphaVirtualDevice() // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented #ifndef MACOSX // Create an alpha virtual device - ScopedVclPtr<VirtualDevice> pAlphaVirtualDevice(VclPtr<VirtualDevice>::Create( - *Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)); + ScopedVclPtr<VirtualDevice> pAlphaVirtualDevice( + VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::WITH_ALPHA)); // Set it up pAlphaVirtualDevice->SetOutputSizePixel(Size(4, 4)); diff --git a/vcl/qa/cppunit/cjktext.cxx b/vcl/qa/cppunit/cjktext.cxx index af63b29959fd..3adc89ddcc47 100644 --- a/vcl/qa/cppunit/cjktext.cxx +++ b/vcl/qa/cppunit/cjktext.cxx @@ -105,7 +105,7 @@ static tools::Long getCharacterRightSideHeight(VirtualDevice* device, const Poin void VclCjkTextTest::testVerticalText() { OUString text(u"\x30e8"); - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(100, 100)); device->SetBackground(Wallpaper(COL_WHITE)); // Disable AA, to make all pixels be black or white. diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx index 853cef3828e4..5856e670a828 100644 --- a/vcl/qa/cppunit/lifecycle.cxx +++ b/vcl/qa/cppunit/lifecycle.cxx @@ -72,7 +72,7 @@ void LifecycleTest::testVirtualDevice() VclPtr<VirtualDevice> pVDev = VclPtr< VirtualDevice >::Create(); ScopedVclPtrInstance< VirtualDevice > pVDev2; VclPtrInstance<VirtualDevice> pVDev3; - VclPtrInstance<VirtualDevice> pVDev4(DeviceFormat::DEFAULT); + VclPtrInstance<VirtualDevice> pVDev4(DeviceFormat::WITHOUT_ALPHA); CPPUNIT_ASSERT(!!pVDev); CPPUNIT_ASSERT(!!pVDev2); CPPUNIT_ASSERT(!!pVDev3); diff --git a/vcl/qa/cppunit/logicalfontinstance.cxx b/vcl/qa/cppunit/logicalfontinstance.cxx index 2a7a5c83ac27..ffe9bb995ff9 100644 --- a/vcl/qa/cppunit/logicalfontinstance.cxx +++ b/vcl/qa/cppunit/logicalfontinstance.cxx @@ -37,7 +37,7 @@ public: void VclLogicalFontInstanceTest::testglyphboundrect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 110))); diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx index f2990d3811fc..606541a0ac48 100644 --- a/vcl/qa/cppunit/skia/skia.cxx +++ b/vcl/qa/cppunit/skia/skia.cxx @@ -116,7 +116,7 @@ void SkiaTest::testDrawShaders() { if (!SkiaHelper::isVCLSkiaEnabled()) return; - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(20, 20)); device->SetBackground(Wallpaper(COL_WHITE)); device->Erase(); @@ -159,7 +159,8 @@ void SkiaTest::testDrawShaders() device->Erase(); // Test with scaling. Use everything 10x larger to reduce the impact of smoothscaling. - ScopedVclPtr<VirtualDevice> deviceLarge = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> deviceLarge + = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); deviceLarge->SetOutputSizePixel(Size(200, 200)); deviceLarge->SetBackground(Wallpaper(COL_WHITE)); deviceLarge->Erase(); @@ -439,7 +440,7 @@ void SkiaTest::testDrawDelayedScaleImage() return; if (SkiaHelper::renderMethodToUse() != SkiaHelper::RenderRaster) return; // This test tests caching that's done only in raster mode. - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(10, 10)); device->SetBackground(Wallpaper(COL_WHITE)); device->Erase(); @@ -513,7 +514,7 @@ void SkiaTest::testTdf137329() return; // Draw a filled polygon in the entire device, with AA enabled. // All pixels in the device should be black, even those at edges (i.e. not affected by AA). - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(10, 10)); device->SetBackground(Wallpaper(COL_WHITE)); device->SetAntialiasing(AntialiasingFlags::Enable); @@ -534,7 +535,7 @@ void SkiaTest::testTdf140848() { if (!SkiaHelper::isVCLSkiaEnabled()) return; - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1300, 400)); device->SetBackground(Wallpaper(COL_BLACK)); device->SetAntialiasing(AntialiasingFlags::Enable); @@ -562,7 +563,7 @@ void SkiaTest::testTdf132367() { if (!SkiaHelper::isVCLSkiaEnabled()) return; - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(2, 2)); device->SetBackground(Wallpaper(COL_BLACK)); device->Erase(); diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx index 833022ee2204..094610bf42c6 100644 --- a/vcl/qa/cppunit/text.cxx +++ b/vcl/qa/cppunit/text.cxx @@ -175,7 +175,7 @@ static tools::Long getCharacterLeftSideHeight(VirtualDevice* device, const Point void VclTextTest::testSimpleText() { OUString text("L"); - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(100, 100)); device->SetBackground(Wallpaper(COL_WHITE)); // Disable AA, to make all pixels be black or white. @@ -605,7 +605,7 @@ void VclTextTest::testImplLayoutArgs_PrepareFallback_precalculatedglyphs() void VclTextTest::testGetStringWithCenterEllpsis() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("DejaVu Sans", "Book", Size(0, 11))); @@ -617,7 +617,7 @@ void VclTextTest::testGetStringWithCenterEllpsis() void VclTextTest::testGetStringWithEndEllpsis() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("DejaVu Sans", "Book", Size(0, 11))); @@ -636,7 +636,7 @@ void VclTextTest::testGetStringWithEndEllpsis() void VclTextTest::testGetStringWithNewsEllpsis() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("DejaVu Sans", "Book", Size(0, 11))); @@ -670,7 +670,7 @@ void VclTextTest::testGetStringWithNewsEllpsis() void VclTextTest::testGetTextBreak() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("DejaVu Sans", "Book", Size(0, 11))); @@ -694,7 +694,7 @@ void VclTextTest::testGetTextBreak() void VclTextTest::testGetSingleLineTextRect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -705,7 +705,7 @@ void VclTextTest::testGetSingleLineTextRect() void VclTextTest::testGetSingleLineTextRectWithEndEllipsis() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -717,7 +717,7 @@ void VclTextTest::testGetSingleLineTextRectWithEndEllipsis() void VclTextTest::testGetRightBottomAlignedSingleLineTextRect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -729,7 +729,7 @@ void VclTextTest::testGetRightBottomAlignedSingleLineTextRect() void VclTextTest::testGetRotatedSingleLineTextRect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -744,7 +744,7 @@ void VclTextTest::testGetRotatedSingleLineTextRect() void VclTextTest::testGetMultiLineTextRect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -756,7 +756,7 @@ void VclTextTest::testGetMultiLineTextRect() void VclTextTest::testGetMultiLineTextRectWithEndEllipsis() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); @@ -769,7 +769,7 @@ void VclTextTest::testGetMultiLineTextRectWithEndEllipsis() void VclTextTest::testGetRightBottomAlignedMultiLineTextRect() { - ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); + ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA); device->SetOutputSizePixel(Size(1000, 1000)); device->SetFont(vcl::Font("Liberation Sans", Size(0, 11))); diff --git a/vcl/qt5/QtSvpSurface.cxx b/vcl/qt5/QtSvpSurface.cxx index 944110847267..760419bd7fac 100644 --- a/vcl/qt5/QtSvpSurface.cxx +++ b/vcl/qt5/QtSvpSurface.cxx @@ -83,7 +83,7 @@ VclPtr<VirtualDevice> QtSvpSurface::createVirtualDevice() const aSystemGraphicsData.pSurface = m_pSurface.get(); return VclPtr<VirtualDevice>::Create(aSystemGraphicsData, get_surface_size(m_pSurface.get()), - DeviceFormat::DEFAULT); + DeviceFormat::WITHOUT_ALPHA); } } // namespace cairo diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 259192c854cb..43a4b6305395 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -662,8 +662,8 @@ OUString SalInstanceWidget::strip_mnemonic(const OUString& rLabel) const VclPtr<VirtualDevice> SalInstanceWidget::create_virtual_device() const { // create with (annoying) separate alpha layer that LibreOffice itself uses - return VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, - DeviceFormat::DEFAULT); + return VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), + DeviceFormat::WITH_ALPHA); } void SalInstanceWidget::call_attention_to() @@ -1379,7 +1379,7 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRen pWindow->SetMapMode(aMapMode); } - VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); Size aChildSizePixel(pWindow->GetSizePixel()); xOutput->SetOutputSizePixel(aChildSizePixel); diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx index a6ee4c288e00..c22a109a3ce2 100644 --- a/vcl/source/filter/eps/eps.cxx +++ b/vcl/source/filter/eps/eps.cxx @@ -1997,7 +1997,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, KernArra vcl::Font aNotRotatedFont( maFont ); aNotRotatedFont.SetOrientation( 0_deg10 ); - ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode( rVDev.GetMapMode() ); pVirDev->SetFont( aNotRotatedFont ); pVirDev->SetTextAlign( eTextAlign ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 05e4c0fb3a6b..6b1300e589d6 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -818,7 +818,7 @@ void GDIMetaFile::ImplAddGradientEx( GDIMetaFile& rMtf, const Gradient& rGrad ) { // Generate comment, GradientEx and Gradient actions (within DrawGradient) - ScopedVclPtrInstance< VirtualDevice > aVDev(rMapDev, DeviceFormat::DEFAULT); + ScopedVclPtrInstance< VirtualDevice > aVDev(rMapDev, DeviceFormat::WITHOUT_ALPHA); aVDev->EnableOutput( false ); GDIMetaFile aGradMtf; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 8be74da9e1c5..e4807abfaae8 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1198,7 +1198,7 @@ double PDFPage::getHeight() const PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >& xEnc, PDFWriter& i_rOuterFace) - : VirtualDevice(Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::NONE, OUTDEV_PDF), + : VirtualDevice(Application::GetDefaultDevice(), DeviceFormat::WITHOUT_ALPHA, OUTDEV_PDF), m_aMapMode( MapUnit::MapPoint, Point(), Fraction( 1, pointToPixel(1) ), Fraction( 1, pointToPixel(1) ) ), m_aWidgetStyleSettings(Application::GetSettings().GetStyleSettings()), m_nCurrentStructElement( 0 ), diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index d0687faa76b2..4d10f317e93c 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -154,7 +154,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, (void)pOutDev->AcquireGraphics(); pGraphics = pOutDev->mpGraphics; if ( pGraphics ) - mpVirDev = pSVData->mpDefInst->CreateVirtualDevice(*pGraphics, nDX, nDY, meFormat, pData); + mpVirDev = pSVData->mpDefInst->CreateVirtualDevice(*pGraphics, nDX, nDY, meFormatAndAlpha, pData); else mpVirDev = nullptr; if ( !mpVirDev ) @@ -200,14 +200,12 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, pSVData->maGDIData.mpFirstVirDev = this; } -VirtualDevice::VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, - DeviceFormat eAlphaFormat, OutDevType eOutDevType) +VirtualDevice::VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormatAndAlpha, + OutDevType eOutDevType) : OutputDevice(eOutDevType) - , meFormat(eFormat) - , meAlphaFormat(eAlphaFormat) + , meFormatAndAlpha(eFormatAndAlpha) { - SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << static_cast<int>(eFormat) - << ", " << static_cast<int>(eAlphaFormat) + SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << static_cast<int>(eFormatAndAlpha) << ", " << static_cast<int>(eOutDevType) << " )" ); ImplInitVirDev(pCompDev ? pCompDev : Application::GetDefaultDevice(), 0, 0); @@ -216,8 +214,7 @@ VirtualDevice::VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, VirtualDevice::VirtualDevice(const SystemGraphicsData& rData, const Size &rSize, DeviceFormat eFormat) : OutputDevice(OUTDEV_VIRDEV) - , meFormat(eFormat) - , meAlphaFormat(DeviceFormat::NONE) + , meFormatAndAlpha(eFormat) { SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << static_cast<int>(eFormat) << " )" ); @@ -303,7 +300,7 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra assert(mpGraphics); - pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice(*mpGraphics, nNewWidth, nNewHeight, meFormat); + pNewVirDev = pSVData->mpDefInst->CreateVirtualDevice(*mpGraphics, nNewWidth, nNewHeight, meFormatAndAlpha); if ( pNewVirDev ) { SalGraphics* pGraphics = pNewVirDev->AcquireGraphics(); @@ -359,7 +356,7 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, { if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer) ) { - if (meAlphaFormat != DeviceFormat::NONE) + if (meFormatAndAlpha != DeviceFormat::WITHOUT_ALPHA) { // #110958# Setup alpha bitmap if(mpAlphaVDev && mpAlphaVDev->GetOutputSizePixel() != rNewSize) @@ -369,7 +366,7 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, if( !mpAlphaVDev ) { - mpAlphaVDev = VclPtr<VirtualDevice>::Create(*this, meAlphaFormat); + mpAlphaVDev = VclPtr<VirtualDevice>::Create(*this, meFormatAndAlpha); mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase, nullptr); } diff --git a/vcl/source/image/ImplImage.cxx b/vcl/source/image/ImplImage.cxx index 20469d8b4292..a63dd8ccb7ce 100644 --- a/vcl/source/image/ImplImage.cxx +++ b/vcl/source/image/ImplImage.cxx @@ -163,7 +163,7 @@ BitmapEx const & ImplImage::getBitmapExForHiDPI(bool bDisabled, SalGraphics* pGr loadStockAtScale(pGraphics, maBitmapEx); else // if (mxMetaFile) { - ScopedVclPtrInstance<VirtualDevice> aVDev(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> aVDev(DeviceFormat::WITH_ALPHA); aVDev->SetOutputSizePixel(aTarget); mxMetaFile->WindStart(); mxMetaFile->Play(*aVDev, Point(), aTarget); diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 2aebffb4c8b2..7f601075edae 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -1050,8 +1050,7 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, const Point& rEndPos, to size_t nWordLength = nEndX - nStartX; // start with something big to avoid updating it frequently nWordLength = nWordLength < 1024 ? 1024 : nWordLength; - ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, DeviceFormat::DEFAULT, - DeviceFormat::DEFAULT ); + ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, DeviceFormat::WITH_ALPHA ); pVirtDev->SetOutputSizePixel( Size( nWordLength, nWaveHeight * 2 ), false ); pVirtDev->SetLineColor( GetLineColor() ); pVirtDev->SetBackground( Wallpaper( COL_TRANSPARENT ) ); diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index d2be9bef6fc9..4a4b6b5a54bb 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -597,7 +597,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, if( !aDstRect.IsEmpty() ) { // Create transparent buffer - ScopedVclPtrInstance<VirtualDevice> xVDev(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xVDev(DeviceFormat::WITH_ALPHA); xVDev->mnDPIX = mnDPIX; xVDev->mnDPIY = mnDPIY; diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index a70f1c0e4004..a98703ca255b 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1521,8 +1521,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP // paint metafile to VDev VclPtrInstance<VirtualDevice> pMaskedDevice(*i_pTargetOutDev, - DeviceFormat::DEFAULT, - DeviceFormat::DEFAULT); + DeviceFormat::WITH_ALPHA); pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() ); pMaskedDevice->EnableRTL( IsRTLEnabled() ); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 9439ef62e88c..603cc8aca5fd 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -1124,7 +1124,7 @@ VclPtr<VirtualDevice> SystemWindow::createScreenshot() Size aSize(GetOutputSizePixel()); - VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); xOutput->SetOutputSizePixel(aSize); Point aPos; diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx index ede009f7f914..3e563d206619 100644 --- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx +++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx @@ -250,7 +250,7 @@ namespace cairo return VclPtr<VirtualDevice>::Create(aSystemGraphicsData, Size(width, height), - DeviceFormat::DEFAULT); + DeviceFormat::WITHOUT_ALPHA); } /** diff --git a/vcl/unx/gtk3/gtkcairo.cxx b/vcl/unx/gtk3/gtkcairo.cxx index b77711384ac2..f389f4d087c1 100644 --- a/vcl/unx/gtk3/gtkcairo.cxx +++ b/vcl/unx/gtk3/gtkcairo.cxx @@ -122,7 +122,7 @@ namespace cairo return VclPtr<VirtualDevice>::Create(aSystemGraphicsData, get_surface_size(mpSurface.get()), - DeviceFormat::DEFAULT); + DeviceFormat::WITHOUT_ALPHA); } } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 925c8669be78..6b8b65c4fbce 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -4483,7 +4483,7 @@ public: gtk_container_resize_children(GTK_CONTAINER(m_pWidget)); #endif - VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); xOutput->SetOutputSizePixel(aSize); switch (rOutput.GetOutDevType()) @@ -6543,7 +6543,7 @@ public: #endif } - VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA)); xOutput->SetOutputSizePixel(get_size()); cairo_surface_t* pSurface = get_underlying_cairo_surface(*xOutput); cairo_t* cr = cairo_create(pSurface); @@ -18352,7 +18352,7 @@ public: #if !GTK_CHECK_VERSION(4, 0, 0) , m_pAccessible(nullptr) #endif - , m_xDevice(DeviceFormat::DEFAULT) + , m_xDevice(DeviceFormat::WITHOUT_ALPHA) , m_pSurface(nullptr) , m_nQueryTooltip(g_signal_connect(m_pDrawingArea, "query-tooltip", G_CALLBACK(signalQueryTooltip), this)) #if !GTK_CHECK_VERSION(4, 0, 0) diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index c40190ff4ed3..6fb5f3514017 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1096,7 +1096,7 @@ public: if (static_cast<int>(eType) < RENDER_AS_BITMAPEX) pNested = VclPtr<VirtualDevice>::Create(rDev).get(); else - pNested = VclPtr<VirtualDevice>::Create(rDev,DeviceFormat::DEFAULT,DeviceFormat::DEFAULT).get(); + pNested = VclPtr<VirtualDevice>::Create(rDev,DeviceFormat::WITH_ALPHA).get(); pNested->SetOutputSizePixel(r.GetSize()); tools::Rectangle aWhole(Point(0,0), r.GetSize()); |