[Libreoffice-commits] core.git: vcl/source vcl/win

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 5 16:28:04 UTC 2019


 vcl/source/gdi/bmpfast.cxx |   14 +++++++-------
 vcl/win/gdi/salbmp.cxx     |   12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit ad657dddd0b5f34a7fedde54b90d59d69513336d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 5 15:46:46 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 5 18:27:08 2019 +0200

    consistently use RemoveScanline
    
    Change-Id: Iad0bbbf1e2a522778fe4a88632bd7cbce4e2008c
    Reviewed-on: https://gerrit.libreoffice.org/78661
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 32ff21c88076..393a634c6127 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -379,7 +379,7 @@ static bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc
     TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
 
     // select the matching instantiation for the destination's bitmap format
-    switch( rDst.mnFormat & ~ScanlineFormat::TopDown )
+    switch (RemoveScanline(rDst.mnFormat))
     {
         case ScanlineFormat::N1BitMsbPal:
         case ScanlineFormat::N1BitLsbPal:
@@ -460,8 +460,8 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
     if( rDst.mnHeight < rTR.mnDestY + rTR.mnDestHeight )
         return false;
 
-    const ScanlineFormat nSrcFormat = rSrc.mnFormat & ~ScanlineFormat::TopDown;
-    const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown;
+    const ScanlineFormat nSrcFormat = RemoveScanline(rSrc.mnFormat);
+    const ScanlineFormat nDstFormat = RemoveScanline(rDst.mnFormat);
 
     // TODO: also implement conversions for 16bit colormasks with non-565 format
     if( nSrcFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) )
@@ -610,7 +610,7 @@ static bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, c
     TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits );
 
     // select the matching instantiation for the destination's bitmap format
-    switch( rDst.mnFormat & ~ScanlineFormat::TopDown )
+    switch (RemoveScanline(rDst.mnFormat))
     {
         case ScanlineFormat::N1BitMsbPal:
         case ScanlineFormat::N1BitLsbPal:
@@ -707,8 +707,8 @@ bool ImplFastBitmapBlending( BitmapWriteAccess const & rDstWA,
     const BitmapBuffer& rSrc = *rSrcRA.ImplGetBitmapBuffer();
     const BitmapBuffer& rMsk = *rMskRA.ImplGetBitmapBuffer();
 
-    const ScanlineFormat nSrcFormat = rSrc.mnFormat & ~ScanlineFormat::TopDown;
-    const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown;
+    const ScanlineFormat nSrcFormat = RemoveScanline(rSrc.mnFormat);
+    const ScanlineFormat nDstFormat = RemoveScanline(rDst.mnFormat);
 
     // accelerated conversions for 16bit colormasks with non-565 format are not yet implemented
     if( nSrcFormat & (ScanlineFormat::N16BitTcLsbMask | ScanlineFormat::N16BitTcMsbMask) )
@@ -769,7 +769,7 @@ bool ImplFastBitmapBlending( BitmapWriteAccess const & rDstWA,
 
 bool ImplFastEraseBitmap( BitmapBuffer& rDst, const BitmapColor& rColor )
 {
-    const ScanlineFormat nDstFormat = rDst.mnFormat & ~ScanlineFormat::TopDown;
+    const ScanlineFormat nDstFormat = RemoveScanline(rDst.mnFormat);
 
     // erasing a bitmap is often just a byte-wise memory fill
     bool bByteFill = true;
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 480154e0fec4..c3e9b53feb8f 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -246,7 +246,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
     BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BitmapAccessMode::Read);
     std::unique_ptr<BitmapBuffer> pExtraRGB;
 
-    if(pRGB && ScanlineFormat::N24BitTcBgr != (pRGB->mnFormat & ~ScanlineFormat::TopDown))
+    if(pRGB && ScanlineFormat::N24BitTcBgr != RemoveScanline(pRGB->mnFormat))
     {
         // convert source bitmap to BMP_FORMAT_24BIT_TC_BGR format if not yet in that format
         SalTwoRect aSalTwoRect(0, 0, pRGB->mnWidth, pRGB->mnHeight, 0, 0, pRGB->mnWidth, pRGB->mnHeight);
@@ -262,7 +262,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
     if(pRGB
         && pRGB->mnWidth > 0
         && pRGB->mnHeight > 0
-        && ScanlineFormat::N24BitTcBgr == (pRGB->mnFormat & ~ScanlineFormat::TopDown))
+        && ScanlineFormat::N24BitTcBgr == RemoveScanline(pRGB->mnFormat))
     {
         const sal_uInt32 nW(pRGB->mnWidth);
         const sal_uInt32 nH(pRGB->mnHeight);
@@ -334,7 +334,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
     BitmapBuffer* pRGB = pSalRGB->AcquireBuffer(BitmapAccessMode::Read);
     std::unique_ptr<BitmapBuffer> pExtraRGB;
 
-    if(pRGB && ScanlineFormat::N24BitTcBgr != (pRGB->mnFormat & ~ScanlineFormat::TopDown))
+    if(pRGB && ScanlineFormat::N24BitTcBgr != RemoveScanline(pRGB->mnFormat))
     {
         // convert source bitmap to canlineFormat::N24BitTcBgr format if not yet in that format
         SalTwoRect aSalTwoRect(0, 0, pRGB->mnWidth, pRGB->mnHeight, 0, 0, pRGB->mnWidth, pRGB->mnHeight);
@@ -361,7 +361,7 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
     BitmapBuffer* pA = pSalA->AcquireBuffer(BitmapAccessMode::Read);
     std::unique_ptr<BitmapBuffer> pExtraA;
 
-    if(pA && ScanlineFormat::N8BitPal != (pA->mnFormat & ~ScanlineFormat::TopDown))
+    if(pA && ScanlineFormat::N8BitPal != RemoveScanline(pA->mnFormat))
     {
         // convert alpha bitmap to ScanlineFormat::N8BitPal format if not yet in that format
         SalTwoRect aSalTwoRect(0, 0, pA->mnWidth, pA->mnHeight, 0, 0, pA->mnWidth, pA->mnHeight);
@@ -383,8 +383,8 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
         && pRGB->mnHeight > 0
         && pRGB->mnWidth == pA->mnWidth
         && pRGB->mnHeight == pA->mnHeight
-        && ScanlineFormat::N24BitTcBgr == (pRGB->mnFormat & ~ScanlineFormat::TopDown)
-        && ScanlineFormat::N8BitPal == (pA->mnFormat & ~ScanlineFormat::TopDown))
+        && ScanlineFormat::N24BitTcBgr == RemoveScanline(pRGB->mnFormat)
+        && ScanlineFormat::N8BitPal == RemoveScanline(pA->mnFormat))
     {
         // we have alpha and bitmap in known formats, create GdiPlus Bitmap as 32bit ARGB
         const sal_uInt32 nW(pRGB->mnWidth);


More information about the Libreoffice-commits mailing list