Kaydet (Commit) ec665e3e authored tarafından Noel Grandin's avatar Noel Grandin

use more OutputDevice::GetBitmapEx

instead of GetBitmap

Change-Id: Ib43cfaf3c91968d623e5a24f44539368da28d36f
Reviewed-on: https://gerrit.libreoffice.org/55190
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 30d5569d
......@@ -241,8 +241,8 @@ namespace cairocanvas
const ::Point aEmptyPoint;
bool bOldMap( mpRefDevice->IsMapModeEnabled() );
mpRefDevice->EnableMapMode( false );
const ::Bitmap aTempBitmap(mpRefDevice->GetBitmap(aEmptyPoint, mpRefDevice->GetOutputSizePixel()));
WriteDIB(aTempBitmap, aStream, false, true);
const ::BitmapEx aTempBitmap(mpRefDevice->GetBitmapEx(aEmptyPoint, mpRefDevice->GetOutputSizePixel()));
WriteDIB(aTempBitmap, aStream, false);
mpRefDevice->EnableMapMode( bOldMap );
++nFilePostfixCount;
......
......@@ -901,7 +901,7 @@ namespace vclcanvas
const Point aEmptyPoint(0,0);
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
BitmapEx aBitmap( rOutDev.GetBitmapEx(aEmptyPoint, aBmpSize) );
aBitmap.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
beFast ? BmpScaleFlag::Default : BmpScaleFlag::BestQuality );
......@@ -927,8 +927,8 @@ namespace vclcanvas
rOutDev.EnableMapMode( false );
rOutDev.SetAntialiasing( AntialiasingFlags::EnableB2dDraw );
Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(),
aRect.GetSize()) );
Bitmap aBitmap( rOutDev.GetBitmapEx(aRect.TopLeft(),
aRect.GetSize()).GetBitmap() );
Bitmap::ScopedReadAccess pReadAccess( aBitmap );
......
......@@ -953,8 +953,8 @@ namespace vclcanvas
// output VDev content alpha-blended to
// target position.
const ::Point aEmptyPoint;
Bitmap aContentBmp(
pVDev->GetBitmap( aEmptyPoint,
BitmapEx aContentBmp(
pVDev->GetBitmapEx( aEmptyPoint,
pVDev->GetOutputSizePixel() ) );
sal_uInt8 nCol( static_cast< sal_uInt8 >(
......@@ -962,7 +962,7 @@ namespace vclcanvas
AlphaMask aAlpha( pVDev->GetOutputSizePixel(),
&nCol );
BitmapEx aOutputBmpEx( aContentBmp, aAlpha );
BitmapEx aOutputBmpEx( aContentBmp.GetBitmap(), aAlpha );
rOutDev.DrawBitmapEx( aPolygonDeviceRect.TopLeft(),
aOutputBmpEx );
......
......@@ -208,7 +208,7 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDev->getOutDev();
bool bOldMap( rOutDev.IsMapModeEnabled() );
rOutDev.EnableMapMode( false );
WriteDIB(rOutDev.GetBitmap(aEmptyPoint, rOutDev.GetOutputSizePixel()), aStream, false, true);
WriteDIB(rOutDev.GetBitmapEx(aEmptyPoint, rOutDev.GetOutputSizePixel()), aStream, false);
rOutDev.EnableMapMode( bOldMap );
++nFilePostfixCount;
......
......@@ -120,7 +120,7 @@ namespace vclcanvas
const ::Point aEmptyPoint;
mpBackBuffer->getOutDev().EnableMapMode( false );
mpBackBuffer->getOutDev().SetAntialiasing( AntialiasingFlags::EnableB2dDraw );
WriteDIB(mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint, mpBackBuffer->getOutDev().GetOutputSizePixel()), aStream, false, true);
WriteDIB(mpBackBuffer->getOutDev().GetBitmapEx(aEmptyPoint, mpBackBuffer->getOutDev().GetOutputSizePixel()), aStream, false);
}
++nFilePostfixCount;
......
......@@ -129,7 +129,7 @@ namespace vclcanvas
if( bNeedBitmapUpdate )
{
Bitmap aBmp( mpBackBuffer->getOutDev().GetBitmap( aEmptyPoint,
BitmapEx aBmp( mpBackBuffer->getOutDev().GetBitmapEx( aEmptyPoint,
aOutputSize ) );
if( isContentFullyOpaque() )
......@@ -144,7 +144,7 @@ namespace vclcanvas
{
// sprite content might contain alpha, create
// BmpEx, then.
Bitmap aMask( mpBackBufferMask->getOutDev().GetBitmap( aEmptyPoint,
BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmapEx( aEmptyPoint,
aOutputSize ) );
// bitmasks are much faster than alphamasks on some platforms
......@@ -163,7 +163,7 @@ namespace vclcanvas
// Note: since we retrieved aBmp and aMask
// directly from an OutDev, it's already a
// 'display bitmap' on windows.
maContent = BitmapEx( aBmp, aMask );
maContent = BitmapEx( aBmp.GetBitmap(), aMask.GetBitmap() );
}
}
......
......@@ -960,7 +960,7 @@ Image SvxToolbarEntriesListBox::GetSizedImage(
rVDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
// Create new image that uses the fillcolor as transparent
return Image(BitmapEx(rVDev.GetBitmap(Point(), aNewSize), aFillColor));
return Image(BitmapEx(rVDev.GetBitmapEx(Point(), aNewSize).GetBitmap(), aFillColor));
}
void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
......
......@@ -47,7 +47,7 @@ void SvxDefaultColorOptPage::InsertColorEntry(const XColorEntry& rEntry, sal_Int
xDevice->SetFillColor(rColor);
xDevice->SetLineColor(rStyleSettings.GetDisableColor());
xDevice->DrawRect(aRect);
BitmapEx aBitmap(xDevice->GetBitmap(Point(0, 0), xDevice->GetOutputSize()));
BitmapEx aBitmap(xDevice->GetBitmapEx(Point(0, 0), xDevice->GetOutputSize()));
nPos = m_pLbChartColors->InsertEntry(rStr, Image(aBitmap), nPos);
......
......@@ -187,7 +187,7 @@ namespace drawinglayer
xControlView->draw(0, 0);
// get bitmap
const Bitmap aContent(aVirtualDevice->GetBitmap(Point(), aSizePixel));
const BitmapEx aContent(aVirtualDevice->GetBitmapEx(Point(), aSizePixel));
// to avoid scaling, use the Bitmap pixel size as primitive size
const Size aBitmapSize(aContent.GetSizePixel());
......
......@@ -141,7 +141,6 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void SetBitmap( const BitmapEx& rBitmap );
using OutputDevice::GetBitmap;
};
......
......@@ -467,7 +467,7 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
aVirDev->SetFillColor( aColor2 );
svtools::DrawLine( *aVirDev.get(), basegfx::B2DPoint( 0, y2 ), basegfx::B2DPoint( aSize.Width(), y2 ), n2, SvxBorderLineStyle::SOLID );
}
rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
rBmp = aVirDev->GetBitmapEx( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
}
LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
......
......@@ -705,7 +705,7 @@ void FrameSelectorImpl::CopyVirDevToControl(vcl::RenderContext& rRenderContext)
{
if (mbFullRepaint)
DrawVirtualDevice();
rRenderContext.DrawBitmap(maVirDevPos, mpVirDev->GetBitmap(Point(0, 0), mpVirDev->GetOutputSizePixel()));
rRenderContext.DrawBitmapEx(maVirDevPos, mpVirDev->GetBitmapEx(Point(0, 0), mpVirDev->GetOutputSizePixel()));
}
void FrameSelectorImpl::DrawAllTrackingRects()
......
......@@ -3372,9 +3372,11 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent )
sal_uInt16 nStyle = bRTL ? i|RULER_TAB_RTL : i;
nStyle |= static_cast<sal_uInt16>(bHorz ? WB_HORZ : WB_VERT);
DrawTab(*pDev, aFillColor, aPt, nStyle);
BitmapEx aItemBitmapEx(pDev->GetBitmapEx(Point(), aSz));
aItemBitmapEx.Replace(COL_WHITE, COL_TRANSPARENT);
aMenu->InsertItem(i + 1,
SvxResId(RID_SVXSTR_RULER_TAB[i]),
Image(BitmapEx(pDev->GetBitmap(Point(), aSz), COL_WHITE)));
Image(aItemBitmapEx));
aMenu->CheckItem(i + 1, i == mpTabs[mxRulerImpl->nIdx + TAB_GAP].nStyle);
pDev->SetOutputSize(aSz); // delete device
}
......
......@@ -277,7 +277,7 @@ void SvxColorDockingWindow::FillValueSet()
pVD->DrawLine( Point(), Point( nPtX, nPtY ) );
pVD->DrawLine( Point( 0, nPtY ), Point( nPtX, 0 ) );
BitmapEx aBmp( pVD->GetBitmap( Point(), aColorSize ) );
BitmapEx aBmp( pVD->GetBitmapEx( Point(), aColorSize ) );
aColorSet->InsertItem( sal_uInt16(1), Image(aBmp), SvxResId( RID_SVXSTR_INVISIBLE ) );
......
......@@ -137,7 +137,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
pVDev->DrawCheckered(aNull, aSize, nLen, aW, aG);
pVDev->DrawBitmapEx(aNull, aThumb);
maFavoritesHorizontal.emplace_back(pVDev->GetBitmap(aNull, aSize));
maFavoritesHorizontal.emplace_back(pVDev->GetBitmapEx(aNull, aSize));
}
}
......
......@@ -608,7 +608,7 @@ namespace
}
}
rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
}
}
} // end of anonymous namespace
......
......@@ -3350,7 +3350,7 @@ void SvxColorListBox::ShowPreview(const NamedColor &rColor)
xDevice->SetLineColor(rStyleSettings.GetDisableColor());
xDevice->DrawRect(aRect);
BitmapEx aBitmap(xDevice->GetBitmap(Point(0, 0), xDevice->GetOutputSize()));
BitmapEx aBitmap(xDevice->GetBitmapEx(Point(0, 0), xDevice->GetOutputSize()));
SetImageAlign(ImageAlign::Left);
SetModeImage(Image(aBitmap));
SetText(rColor.second);
......
......@@ -705,7 +705,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
if( pVDev )
{
aGraphic = pVDev->GetBitmap( Point(), pVDev->GetOutputSize() );
aGraphic = pVDev->GetBitmapEx( Point(), pVDev->GetOutputSize() );
aGraphic.SetPrefMapMode( aMap );
aGraphic.SetPrefSize( aSize );
}
......
......@@ -125,7 +125,7 @@ void XOBitmap::Array2Bitmap()
}
}
xGraphicObject.reset(new GraphicObject(pVDev->GetBitmap(Point(), Size(nLines, nLines))));
xGraphicObject.reset(new GraphicObject(pVDev->GetBitmapEx(Point(), Size(nLines, nLines))));
bGraphicDirty = false;
}
......
......@@ -96,7 +96,7 @@ BitmapEx XBitmapList::CreateBitmap( long nIndex, const Size& rSize ) const
}
}
}
rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
return rBitmapEx;
}
else
......
......@@ -168,7 +168,7 @@ BitmapEx XDashList::ImpCreateBitmapForXDash(const XDash* pDash)
}
// get result bitmap and scale
BitmapEx aRetval(pVirtualDevice->GetBitmap(Point(0, 0), pVirtualDevice->GetOutputSizePixel()));
BitmapEx aRetval(pVirtualDevice->GetBitmapEx(Point(0, 0), pVirtualDevice->GetOutputSizePixel()));
if(1 != nFactor)
{
......
......@@ -200,7 +200,7 @@ BitmapEx XGradientList::CreateBitmap( long nIndex, const Size& rSize ) const
}
// get result bitmap and scale
aRetval = pVirtualDevice->GetBitmap(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
}
return aRetval;
......
......@@ -175,7 +175,7 @@ BitmapEx XHatchList::CreateBitmap( long nIndex, const Size& rSize) const
}
// get result bitmap and scale
aRetval = pVirtualDevice->GetBitmap(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
}
return aRetval;
......
......@@ -157,7 +157,7 @@ BitmapEx XLineEndList::CreateBitmapForUI( long nIndex )
}
// get result bitmap and scale
aRetval = pVirtualDevice->GetBitmap(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), pVirtualDevice->GetOutputSizePixel());
}
return aRetval;
......
......@@ -132,7 +132,7 @@ BitmapEx XPatternList::CreateBitmap( long nIndex, const Size& rSize ) const
}
}
}
rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
return rBitmapEx;
}
else
......
......@@ -1241,7 +1241,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf )
if( pVirtDev->SetOutputSize( aSz ) )
{
aGrf.Draw( pVirtDev.get(), Point(), aSz );
rGrf = pVirtDev->GetBitmap( Point(), aSz );
rGrf = pVirtDev->GetBitmapEx( Point(), aSz );
}
else
{
......
......@@ -194,10 +194,10 @@ css::uno::Reference< css::awt::XBitmap > VCLXDevice::createBitmap( sal_Int32 nX,
css::uno::Reference< css::awt::XBitmap > xBmp;
if( mpOutputDevice )
{
Bitmap aBmp = mpOutputDevice->GetBitmap( Point( nX, nY ), Size( nWidth, nHeight ) );
BitmapEx aBmp = mpOutputDevice->GetBitmapEx( Point( nX, nY ), Size( nWidth, nHeight ) );
VCLXBitmap* pBmp = new VCLXBitmap;
pBmp->SetBitmap( BitmapEx( aBmp ) );
pBmp->SetBitmap( aBmp );
xBmp = pBmp;
}
return xBmp;
......
......@@ -44,7 +44,7 @@ namespace vcl
Size maPreviewSize;
sal_Int32 mnDPIX;
sal_Int32 mnDPIY;
Bitmap maPreviewBitmap;
BitmapEx maPreviewBitmap;
OUString maReplacementString;
OUString maToolTipString;
bool mbGreyscale;
......
......@@ -2202,7 +2202,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
Graphic aGraphic2=aGraphic;
aGraphic2.Draw(aVirDev.get(),Point(0,0),aSizePixel); // this changes the MapMode
aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
aGraphic=Graphic(aVirDev->GetBitmap(Point(0,0),aSizePixel));
aGraphic=Graphic(aVirDev->GetBitmapEx(Point(0,0),aSizePixel));
}
}
if( rOStm.GetError() )
......
......@@ -2812,7 +2812,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve
const_cast<GDIMetaFile *>(this)->Play(aVDev.get(), Point(), aAntialias);
// get paint bitmap
Bitmap aBitmap( aVDev->GetBitmap( aNullPt, aVDev->GetOutputSizePixel() ) );
BitmapEx aBitmap( aVDev->GetBitmapEx( aNullPt, aVDev->GetOutputSizePixel() ) );
// scale down the image to the desired size - use the input scaler for the scaling operation
aBitmap.Scale(aDrawSize, nScaleFlag);
......@@ -2822,7 +2822,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve
if (aSize.Width() && aSize.Height())
aBitmap.Convert(eColorConversion);
rBitmapEx = BitmapEx(aBitmap);
rBitmapEx = aBitmap;
}
return !rBitmapEx.IsEmpty();
......
......@@ -737,7 +737,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
ImplDraw( aVDev.get(), Point(), aDrawSize );
// use maEx as local buffer for rendered metafile
const_cast< ImpGraphic* >(this)->maEx = aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
const_cast< ImpGraphic* >(this)->maEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
}
}
......
......@@ -146,7 +146,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
aVDev->SetBackground( rWallpaper.GetColor() );
aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
aVDev->DrawBitmapEx( Point(), aBmpEx );
aBmpEx = BitmapEx(aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() ));
aBmpEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
}
bDrawColorBackground = true;
......
......@@ -165,14 +165,14 @@ void PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
}
else
{
Bitmap aPreviewBitmap(maPreviewBitmap);
BitmapEx aPreviewBitmap(maPreviewBitmap);
// This explicit force-to-scale allows us to get the
// mentioned best quality here. Unfortunately this is
// currently not sure when using just ::DrawBitmap with
// a defined size or ::DrawOutDev
aPreviewBitmap.Scale(maPreviewSize, BmpScaleFlag::BestQuality);
rRenderContext.DrawBitmap(aOffset, aPreviewBitmap);
rRenderContext.DrawBitmapEx(aOffset, aPreviewBitmap);
}
tools::Rectangle aFrameRect(aOffset + Point(-1, -1), Size(maPreviewSize.Width() + 2, maPreviewSize.Height() + 2));
......@@ -377,7 +377,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
SetMapMode(MapMode(MapUnit::MapPixel));
pPrerenderVDev->SetMapMode(MapMode(MapUnit::MapPixel));
maPreviewBitmap = pPrerenderVDev->GetBitmap(Point(0, 0), aVDevSize);
maPreviewBitmap = pPrerenderVDev->GetBitmapEx(Point(0, 0), aVDevSize);
pPrerenderVDev->SetDrawMode( nOldDrawMode );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment