Kaydet (Commit) a475c696 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Bin some dead code

Has been dead since bff2ddbb, when we
stopped using SvpSalVirtualDevice on iOS.

Change-Id: I4403f61fac73596f1c7c3d11b2351c37173c970d
üst 1f2817e9
...@@ -55,7 +55,6 @@ public: ...@@ -55,7 +55,6 @@ public:
int mnWidth; int mnWidth;
int mnHeight; int mnHeight;
sal_uInt32 mnBytesPerRow; sal_uInt32 mnBytesPerRow;
void* maExternalData;
public: public:
QuartzSalBitmap(); QuartzSalBitmap();
...@@ -71,8 +70,6 @@ public: ...@@ -71,8 +70,6 @@ public:
virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas,
Size& rSize, Size& rSize,
bool bMask = false ); bool bMask = false );
// creating quartz wrapper from existing buffer
bool Create( BitmapBuffer& buffer);
void Destroy(); void Destroy();
...@@ -96,7 +93,6 @@ private: ...@@ -96,7 +93,6 @@ private:
public: public:
bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight ); 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: public:
CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const; CGImageRef CreateWithMask( const QuartzSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const;
......
...@@ -62,7 +62,6 @@ QuartzSalBitmap::QuartzSalBitmap() ...@@ -62,7 +62,6 @@ QuartzSalBitmap::QuartzSalBitmap()
, mnWidth(0) , mnWidth(0)
, mnHeight(0) , mnHeight(0)
, mnBytesPerRow(0) , mnBytesPerRow(0)
, maExternalData(NULL)
{ {
} }
...@@ -108,77 +107,6 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, ...@@ -108,77 +107,6 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
return true; 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 ) bool QuartzSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapPalette& rBitmapPalette )
{ {
if( !isValidBitCount( nBits ) ) if( !isValidBitCount( nBits ) )
...@@ -239,7 +167,6 @@ void QuartzSalBitmap::Destroy() ...@@ -239,7 +167,6 @@ void QuartzSalBitmap::Destroy()
{ {
DestroyContext(); DestroyContext();
maUserBuffer.reset(); maUserBuffer.reset();
maExternalData = NULL;
} }
...@@ -265,7 +192,7 @@ bool QuartzSalBitmap::CreateContext() ...@@ -265,7 +192,7 @@ bool QuartzSalBitmap::CreateContext()
// prepare graphics context // prepare graphics context
// convert image from user input if available // convert image from user input if available
const bool bSkipConversion = !maUserBuffer && !maExternalData; const bool bSkipConversion = !maUserBuffer;
if( bSkipConversion ) if( bSkipConversion )
AllocateUserData(); AllocateUserData();
...@@ -281,13 +208,10 @@ bool QuartzSalBitmap::CreateContext() ...@@ -281,13 +208,10 @@ bool QuartzSalBitmap::CreateContext()
size_t bitsPerComponent = (mnBits == 16) ? 5 : 8; size_t bitsPerComponent = (mnBits == 16) ? 5 : 8;
sal_uInt32 nContextBytesPerRow = mnBytesPerRow; sal_uInt32 nContextBytesPerRow = mnBytesPerRow;
if( (mnBits == 16) || (mnBits == 32) ) if( (mnBits == 16) || (mnBits == 32) )
{
if (!maExternalData)
{ {
// no conversion needed for truecolor // no conversion needed for truecolor
maContextBuffer = maUserBuffer; maContextBuffer = maUserBuffer;
} }
}
else if( mnBits == 8 else if( mnBits == 8
#ifndef IOS #ifndef IOS
&& maPalette.IsGreyPalette() && maPalette.IsGreyPalette()
...@@ -295,10 +219,7 @@ bool QuartzSalBitmap::CreateContext() ...@@ -295,10 +219,7 @@ bool QuartzSalBitmap::CreateContext()
) )
{ {
// no conversion needed for grayscale // no conversion needed for grayscale
if (!maExternalData)
{
maContextBuffer = maUserBuffer; maContextBuffer = maUserBuffer;
}
#ifdef IOS #ifdef IOS
aCGColorSpace = CGColorSpaceCreateDeviceGray(); aCGColorSpace = CGColorSpaceCreateDeviceGray();
#else #else
...@@ -327,12 +248,7 @@ bool QuartzSalBitmap::CreateContext() ...@@ -327,12 +248,7 @@ bool QuartzSalBitmap::CreateContext()
} }
} }
if(maExternalData) if( maContextBuffer.get() )
{
mxGraphicContext = ::CGBitmapContextCreate( maExternalData, mnWidth, mnHeight,
bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo );
}
else if( maContextBuffer.get() )
{ {
mxGraphicContext = ::CGBitmapContextCreate( maContextBuffer.get(), mnWidth, mnHeight, mxGraphicContext = ::CGBitmapContextCreate( maContextBuffer.get(), mnWidth, mnHeight,
bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo ); bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment