include/vcl/BitmapInfoAccess.hxx       |    1 -
 include/vcl/BitmapReadAccess.hxx       |    4 ++--
 include/vcl/BitmapWriteAccess.hxx      |    2 +-
 vcl/quartz/salbmp.cxx                  |   11 -----------
 vcl/source/bitmap/BitmapReadAccess.cxx |    2 --
 5 files changed, 3 insertions(+), 17 deletions(-)

New commits:
commit 973771c8cd1e9888f34511919070a0161e079229
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 24 12:10:41 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jan 24 14:18:34 2025 +0100

    no need to store ColorMask in BitmapInfoAccess
    
    when we already have it in the BitmapBuffer we point to
    
    Change-Id: I64158251c113f9dd11f21f4f3f112248b82db5f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180700
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/vcl/BitmapInfoAccess.hxx b/include/vcl/BitmapInfoAccess.hxx
index f3ac582b6a16..4e6f38081f7e 100644
--- a/include/vcl/BitmapInfoAccess.hxx
+++ b/include/vcl/BitmapInfoAccess.hxx
@@ -149,7 +149,6 @@ private:
 protected:
     Bitmap maBitmap;
     BitmapBuffer* mpBuffer;
-    ColorMask maColorMask;
     BitmapAccessMode mnAccessMode;
 };
 
diff --git a/include/vcl/BitmapReadAccess.hxx b/include/vcl/BitmapReadAccess.hxx
index 7e4a9e2b04c1..79b39cfc5b88 100644
--- a/include/vcl/BitmapReadAccess.hxx
+++ b/include/vcl/BitmapReadAccess.hxx
@@ -60,7 +60,7 @@ public:
     {
         assert(pData && "Access is not valid!");
 
-        return mFncGetPixel(pData, nX, maColorMask);
+        return mFncGetPixel(pData, nX, mpBuffer->maColorMask);
     }
 
     sal_uInt8 GetIndexFromData(const sal_uInt8* pData, tools::Long nX) const
@@ -72,7 +72,7 @@ public:
     {
         assert(pData && "Access is not valid!");
 
-        mFncSetPixel(pData, nX, rBitmapColor, maColorMask);
+        mFncSetPixel(pData, nX, rBitmapColor, mpBuffer->maColorMask);
     }
 
     BitmapColor GetPixel(tools::Long nY, tools::Long nX) const
diff --git a/include/vcl/BitmapWriteAccess.hxx 
b/include/vcl/BitmapWriteAccess.hxx
index 631b097438bf..86936457295d 100644
--- a/include/vcl/BitmapWriteAccess.hxx
+++ b/include/vcl/BitmapWriteAccess.hxx
@@ -54,7 +54,7 @@ public:
         assert(nX < mpBuffer->mnWidth && "x-coordinate out of range!");
         assert(nY < mpBuffer->mnHeight && "y-coordinate out of range!");
 
-        mFncSetPixel(GetScanline(nY), nX, rBitmapColor, maColorMask);
+        mFncSetPixel(GetScanline(nY), nX, rBitmapColor, mpBuffer->maColorMask);
     }
 
     void SetPixelIndex(tools::Long nY, tools::Long nX, sal_uInt8 cIndex)
diff --git a/vcl/source/bitmap/BitmapReadAccess.cxx 
b/vcl/source/bitmap/BitmapReadAccess.cxx
index c5e5a6a92c8e..3588f097b20b 100644
--- a/vcl/source/bitmap/BitmapReadAccess.cxx
+++ b/vcl/source/bitmap/BitmapReadAccess.cxx
@@ -41,8 +41,6 @@ BitmapReadAccess::BitmapReadAccess(const Bitmap& rBitmap, 
BitmapAccessMode nMode
     if (!xImpBmp)
         return;
 
-    maColorMask = mpBuffer->maColorMask;
-
     mFncGetPixel = GetPixelFunction(mpBuffer->meFormat);
     mFncSetPixel = SetPixelFunction(mpBuffer->meFormat);
 
commit 9e77eefb0ef2d6a23a2d9833ad9783a194c37d1b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 24 11:55:11 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jan 24 14:18:26 2025 +0100

    no need to use color mask in QuartzSalBitmap::AcquireBuffer
    
    ever since
        commit b29e161488f0291f381f04e2533106321f357c1e
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Fri Jan 10 21:19:54 2025 +0200
        make the ScanlineFormat values more explicit
    
    Change-Id: I5a348659e1d341e3f33e0a2636697e37aaabfe47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180699
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index ca286b3fc434..82ef64db8ebe 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -46,10 +46,6 @@
 #include <ios/iosinst.hxx>
 #endif
 
-const unsigned long k32BitRedColorMask   = 0x00ff0000;
-const unsigned long k32BitGreenColorMask = 0x0000ff00;
-const unsigned long k32BitBlueColorMask  = 0x000000ff;
-
 QuartzSalBitmap::QuartzSalBitmap()
   : mxCachedImage( nullptr )
   , mnBits(0)
@@ -446,13 +442,6 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( 
BitmapAccessMode /*nMode*/ )
         case 32:
         {
             pBuffer->meFormat = ImplGetSVData()->mpDefInst->supportsBitmap32() 
? ScanlineFormat::N32BitTcArgb : ScanlineFormat::N32BitTcXrgb;
-            ColorMaskElement aRedMask(k32BitRedColorMask);
-            aRedMask.CalcMaskShift();
-            ColorMaskElement aGreenMask(k32BitGreenColorMask);
-            aGreenMask.CalcMaskShift();
-            ColorMaskElement aBlueMask(k32BitBlueColorMask);
-            aBlueMask.CalcMaskShift();
-            pBuffer->maColorMask  = ColorMask(aRedMask, aGreenMask, aBlueMask);
             break;
         }
         default: assert(false);

Reply via email to