[Libreoffice-commits] core.git: vcl/inc vcl/quartz
Tor Lillqvist
tml at collabora.com
Thu Mar 20 09:20:12 PDT 2014
vcl/inc/quartz/salbmp.h | 4 --
vcl/quartz/salbmp.cxx | 94 ++----------------------------------------------
2 files changed, 5 insertions(+), 93 deletions(-)
New commits:
commit a475c6963e639bbc575d3591c804fbb1ef980183
Author: Tor Lillqvist <tml at collabora.com>
Date: Thu Mar 20 18:14:14 2014 +0200
Bin some dead code
Has been dead since bff2ddbbfb8a4cebee2cc223c3bba6a8d9ebc038, when we
stopped using SvpSalVirtualDevice on iOS.
Change-Id: I4403f61fac73596f1c7c3d11b2351c37173c970d
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index 136e6d2..1e946d2 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -55,7 +55,6 @@ public:
int mnWidth;
int mnHeight;
sal_uInt32 mnBytesPerRow;
- void* maExternalData;
public:
QuartzSalBitmap();
@@ -71,8 +70,6 @@ public:
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize,
bool bMask = false );
- // creating quartz wrapper from existing buffer
- bool Create( BitmapBuffer& buffer);
void Destroy();
@@ -96,7 +93,6 @@ private:
public:
bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight );
- bool Create( CGImageRef xImage, int nBitCount, int nX, int nY, int nWidth, int nHeight );
public:
CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index fb3ca3c..3732550 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -62,7 +62,6 @@ QuartzSalBitmap::QuartzSalBitmap()
, mnWidth(0)
, mnHeight(0)
, mnBytesPerRow(0)
-, maExternalData(NULL)
{
}
@@ -108,77 +107,6 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
return true;
}
-
-
-bool QuartzSalBitmap::Create( CGImageRef xImage, int nBitmapBits,
- int nX, int nY, int nWidth, int nHeight )
-{
- DBG_ASSERT( xImage, "QuartzSalBitmap::Create() from null image" );
-
- // sanitize input parameters
- if( nX < 0 )
- nWidth += nX, nX = 0;
- if( nY < 0 )
- nHeight += nY, nY = 0;
- const CGSize aLayerSize = CGSizeMake(CGImageGetWidth(xImage), CGImageGetHeight(xImage));
- if( nWidth >= (int)aLayerSize.width - nX )
- nWidth = (int)aLayerSize.width - nX;
- if( nHeight >= (int)aLayerSize.height - nY )
- nHeight = (int)aLayerSize.height - nY;
- if( (nWidth < 0) || (nHeight < 0) )
- nWidth = nHeight = 0;
-
- // initialize properties
- mnWidth = nWidth;
- mnHeight = nHeight;
- mnBits = nBitmapBits ? nBitmapBits : 32;
-
- // initialize drawing context
- CreateContext();
-
- // copy layer content into the bitmap buffer
- if(mxGraphicContext) // remove warning
- {
- // Flip the image right side up & draw
- CGContextSaveGState(mxGraphicContext);
-
- CGContextScaleCTM(mxGraphicContext, 1.0, -1.0);
- CGContextTranslateCTM(mxGraphicContext, 0.0, -aLayerSize.height);
-
- CGContextDrawImage( mxGraphicContext,
- CGRectMake(static_cast<CGFloat>(-nX),
- static_cast<CGFloat>(nY),
- aLayerSize.width,
- aLayerSize.height),
- xImage );
-
- // Restore the context so that the coordinate system is restored
- CGContextRestoreGState(mxGraphicContext);
-
- }
-
-
- return true;
-}
-
-bool QuartzSalBitmap::Create( BitmapBuffer& buffer)
-{
- // initialize properties
- mnWidth = buffer.mnWidth;
- mnHeight = buffer.mnHeight;
- mnBits = buffer.mnBitCount;
- mnBytesPerRow = buffer.mnScanlineSize;
- maExternalData = buffer.mpBits;
- maPalette = buffer.maPalette;
-
- // initialize drawing context
- CreateContext();
-
- return true;
-}
-
-
-
bool QuartzSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette )
{
if( !isValidBitCount( nBits ) )
@@ -239,7 +167,6 @@ void QuartzSalBitmap::Destroy()
{
DestroyContext();
maUserBuffer.reset();
- maExternalData = NULL;
}
@@ -265,7 +192,7 @@ bool QuartzSalBitmap::CreateContext()
// prepare graphics context
// convert image from user input if available
- const bool bSkipConversion = !maUserBuffer && !maExternalData;
+ const bool bSkipConversion = !maUserBuffer;
if( bSkipConversion )
AllocateUserData();
@@ -282,11 +209,8 @@ bool QuartzSalBitmap::CreateContext()
sal_uInt32 nContextBytesPerRow = mnBytesPerRow;
if( (mnBits == 16) || (mnBits == 32) )
{
- if (!maExternalData)
- {
- // no conversion needed for truecolor
- maContextBuffer = maUserBuffer;
- }
+ // no conversion needed for truecolor
+ maContextBuffer = maUserBuffer;
}
else if( mnBits == 8
#ifndef IOS
@@ -295,10 +219,7 @@ bool QuartzSalBitmap::CreateContext()
)
{
// no conversion needed for grayscale
- if (!maExternalData)
- {
- maContextBuffer = maUserBuffer;
- }
+ maContextBuffer = maUserBuffer;
#ifdef IOS
aCGColorSpace = CGColorSpaceCreateDeviceGray();
#else
@@ -327,12 +248,7 @@ bool QuartzSalBitmap::CreateContext()
}
}
- if(maExternalData)
- {
- mxGraphicContext = ::CGBitmapContextCreate( maExternalData, mnWidth, mnHeight,
- bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo );
- }
- else if( maContextBuffer.get() )
+ if( maContextBuffer.get() )
{
mxGraphicContext = ::CGBitmapContextCreate( maContextBuffer.get(), mnWidth, mnHeight,
bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo );
More information about the Libreoffice-commits
mailing list