summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-20 15:51:01 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-22 17:53:16 +0000
commitae033e72144645bb86e70071acc6bf7e2f0dda80 (patch)
treedf8e702672996728fdf2ee832a208a75b6649167 /vcl/unx
parent57ef4457becdb5c66a3c0db9e499e1ac491860f2 (diff)
Convert BitmapAccessMode to scoped enum
Change-Id: I0f2b86f0a34e257d00856ce4f1dbbb1869ec967a Reviewed-on: https://gerrit.libreoffice.org/25208 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/gdi/gdiimpl.cxx12
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx2
-rw-r--r--vcl/unx/generic/print/genpspgraphics.cxx4
3 files changed, 9 insertions, 9 deletions
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 8946ed3d128a..cf0216650668 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -109,7 +109,7 @@ namespace
//fdo#33455 and fdo#80160 handle 1 bit depth pngs with palette entries
//to set fore/back colors
SalBitmap& rBitmap = const_cast<SalBitmap&>(rSalBitmap);
- if (BitmapBuffer* pBitmapBuffer = rBitmap.AcquireBuffer(BITMAP_READ_ACCESS))
+ if (BitmapBuffer* pBitmapBuffer = rBitmap.AcquireBuffer(BitmapAccessMode::Read))
{
const BitmapPalette& rPalette = pBitmapBuffer->maPalette;
if (rPalette.GetEntryCount() == 2)
@@ -120,7 +120,7 @@ namespace
const BitmapColor aBlack(rPalette[rPalette.GetBestIndex(Color(COL_BLACK))]);
rValues.background = rColMap.GetPixel(ImplColorToSal(aBlack));
}
- rBitmap.ReleaseBuffer(pBitmapBuffer, BITMAP_READ_ACCESS);
+ rBitmap.ReleaseBuffer(pBitmapBuffer, BitmapAccessMode::Read);
}
}
}
@@ -673,11 +673,11 @@ void X11SalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry,
DBG_ASSERT( !mrParent.bPrinter_, "Drawing of transparent bitmaps on printer devices is strictly forbidden" );
// decide if alpha masking or transparency masking is needed
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( BITMAP_READ_ACCESS );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( BitmapAccessMode::Read );
if( pAlphaBuffer != nullptr )
{
int nMaskFormat = pAlphaBuffer->mnFormat;
- const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, BITMAP_READ_ACCESS );
+ const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, BitmapAccessMode::Read );
if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
drawAlphaBitmap( rPosAry, rSrcBitmap, rMaskBitmap );
}
@@ -857,7 +857,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR,
// TODO: use SalX11Bitmap functionality and caching for the Alpha Pixmap
// problem is that they don't provide an 8bit Pixmap on a non-8bit display
- BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( BITMAP_READ_ACCESS );
+ BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rAlphaBmp).AcquireBuffer( BitmapAccessMode::Read );
// an XImage needs its data top_down
// TODO: avoid wrongly oriented images in upper layers!
@@ -902,7 +902,7 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR,
if( pAlphaBits != reinterpret_cast<char*>(pAlphaBuffer->mpBits) )
delete[] pAlphaBits;
- const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, BITMAP_READ_ACCESS );
+ const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, BitmapAccessMode::Read );
XRenderPictureAttributes aAttr;
aAttr.repeat = int(true);
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index dd01c4b7a348..c16be93ccf18 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -868,7 +868,7 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ )
void X11SalBitmap::ReleaseBuffer( BitmapBuffer*, BitmapAccessMode nMode )
{
- if( nMode == BITMAP_WRITE_ACCESS )
+ if( nMode == BitmapAccessMode::Write )
{
if( mpDDB )
{
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index 41cf16ee8409..dc3b80a4f414 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -504,12 +504,12 @@ void GenPspGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSa
Rectangle aDst (Point(rPosAry.mnDestX, rPosAry.mnDestY),
Size(rPosAry.mnDestWidth, rPosAry.mnDestHeight));
- BitmapBuffer* pBuffer= const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(BITMAP_READ_ACCESS);
+ BitmapBuffer* pBuffer= const_cast<SalBitmap&>(rSalBitmap).AcquireBuffer(BitmapAccessMode::Read);
SalPrinterBmp aBmp (pBuffer);
m_pPrinterGfx->DrawBitmap (aDst, aSrc, aBmp);
- const_cast<SalBitmap&>(rSalBitmap).ReleaseBuffer (pBuffer, BITMAP_READ_ACCESS);
+ const_cast<SalBitmap&>(rSalBitmap).ReleaseBuffer (pBuffer, BitmapAccessMode::Read);
}
void GenPspGraphics::drawBitmap( const SalTwoRect&,