[Libreoffice-commits] core.git: 3 commits - vcl/headless vcl/quartz

Tor Lillqvist tml at collabora.com
Thu Apr 10 09:50:24 PDT 2014


 vcl/headless/svpbmp.cxx     |    2 +-
 vcl/headless/svpvd.cxx      |    2 +-
 vcl/quartz/salbmp.cxx       |    1 -
 vcl/quartz/salgdicommon.cxx |    6 ++----
 vcl/quartz/salvd.cxx        |   12 +++---------
 5 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit a8877197072523ec60fadb138f9790aa2bf66cd2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Apr 10 19:42:06 2014 +0300

    ImageIO does not handle CGImageMasks
    
    Change-Id: Ie5a35f68041a9c65658b9ce569ed3202c8a72ecb

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 45c3e1a..5d6c400 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -806,7 +806,6 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
         static const CGFloat* pDecode = NULL;
         xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false );
         CG_TRACE( "CGImageMaskCreate(" << nWidth << "," << nHeight << ",8,8) = " << xMask );
-        DBG_WRITE_IMAGE(xMask, "xMask.new");
         CFRelease( xDataProvider );
         CG_TRACE( "CFRelease(" << xMaskContext << ")" );
         CFRelease( xMaskContext );
commit ed2f0490f891b40a90eccc9d4143a18b31c79e63
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Apr 10 19:33:30 2014 +0300

    Avoid a couple of pointless constant variables
    
    Change-Id: If1dcb577d2dcc6477f43ad1be0e970e08d9093c6

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index ceb1ee5..4df173c 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1458,8 +1458,6 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY )
         return COL_BLACK;
     }
     // prepare creation of matching a CGBitmapContext
-    CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
-    CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big;
 #if defined OSL_BIGENDIAN
     struct{ unsigned char b, g, r, a; } aPixel;
 #else
@@ -1469,8 +1467,8 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY )
     // create a one-pixel bitmap context
     // TODO: is it worth to cache it?
     CGContextRef xOnePixelContext =
-        CGBitmapContextCreate( &aPixel, 1, 1, 8, sizeof(aPixel),
-                               aCGColorSpace, aCGBmpInfo );
+        CGBitmapContextCreate( &aPixel, 1, 1, 8, 32,
+                               GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big );
 
     CG_TRACE( "CGBitmapContextCreate(1x1x8) = " << xOnePixelContext );
 
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index ee75417..549bd9f 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -184,8 +184,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
     if( mnBitmapDepth && (mnBitmapDepth < 16) )
     {
         mnBitmapDepth = 8;  // TODO: are 1bit vdevs worth it?
-        const CGColorSpaceRef aCGColorSpace = GetSalData()->mxGraySpace;
-        const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNone;
         const int nBytesPerRow = (mnBitmapDepth * nDX + 7) / 8;
 
         void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY );
@@ -194,7 +192,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
             ((sal_uInt8*)pRawData)[i] = (i & 0xFF);
 #endif
         mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
-                                                 mnBitmapDepth, nBytesPerRow, aCGColorSpace, aCGBmpInfo );
+                                                 mnBitmapDepth, nBytesPerRow, GetSalData()->mxGraySpace, kCGImageAlphaNone );
         CG_TRACE( "CGBitmapContextCreate(" << nDX << "x" << nDY << "x" << mnBitmapDepth << ") = " << mxBitmapContext );
         xCGContext = mxBitmapContext;
     }
@@ -233,8 +231,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
             {
                 // fall back to a bitmap context
                 mnBitmapDepth = 32;
-                const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
-                const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
                 const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
 
                 void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY );
@@ -243,15 +239,13 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
                     ((sal_uInt8*)pRawData)[i] = (i & 0xFF);
 #endif
                 mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
-                                                         8, nBytesPerRow, aCGColorSpace, aCGBmpInfo );
+                                                         8, nBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
                 CG_TRACE( "CGBitmapContextCreate(" << nDX << "x" << nDY << "x32) = " << mxBitmapContext );
                 xCGContext = mxBitmapContext;
             }
         }
 #else
         mnBitmapDepth = 32;
-        const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
-        const CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
         const int nBytesPerRow = (mnBitmapDepth * nDX) / 8;
 
         void* pRawData = rtl_allocateMemory( nBytesPerRow * nDY );
@@ -260,7 +254,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
             ((sal_uInt8*)pRawData)[i] = (i & 0xFF);
 #endif
         mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
-                                                 8, nBytesPerRow, aCGColorSpace, aCGBmpInfo );
+                                                 8, nBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
         CG_TRACE( "CGBitmapContextCreate(" << nDX << "x" << nDY << "x32) = " << mxBitmapContext );
         xCGContext = mxBitmapContext;
 #endif
commit 590d851f7fc66b8a0fd3d2a08aa059ee747d7468
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Apr 10 19:16:30 2014 +0300

    Avoid pointless ifdef for iOS inside code not compiled for iOS anyway
    
    The whole of svpbmp.cxx and svpvd.cxx are nowadays ifdeffed out for iOS.
    
    Change-Id: Iac1f66457dc315ea86f86d12e1f6eb5bf4bcbb8c

diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 03a8a90..3e08e90 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -53,7 +53,7 @@ bool SvpSalBitmap::Create( const Size& rSize,
         case 16: nFormat = FORMAT_SIXTEEN_BIT_LSB_TC_MASK; break;
 #endif
         case 24: nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break;
-#if defined(ANDROID) || defined(IOS)
+#ifdef ANDROID
         case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA; break;
 #else
         case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA; break;
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index d9ca7d2..e5a20b5 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -81,7 +81,7 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, const ba
 #endif
             case 24: nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break;
             case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA; break;
-#if defined(ANDROID) || defined(IOS)
+#ifdef ANDROID
             case 0:  nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA; break;
 #else
             case 0:  nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break;


More information about the Libreoffice-commits mailing list