summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-10 19:33:30 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-10 19:49:41 +0300
commited2f0490f891b40a90eccc9d4143a18b31c79e63 (patch)
treeaa1b97d9078e791ccdcd6ae92b3df82651e65229
parent590d851f7fc66b8a0fd3d2a08aa059ee747d7468 (diff)
Avoid a couple of pointless constant variables
Change-Id: If1dcb577d2dcc6477f43ad1be0e970e08d9093c6
-rw-r--r--vcl/quartz/salgdicommon.cxx6
-rw-r--r--vcl/quartz/salvd.cxx12
2 files changed, 5 insertions, 13 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index ceb1ee5bc270..4df173c38695 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 ee75417245da..549bd9f80492 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