diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-03-31 23:01:40 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-03-31 23:02:12 +0300 |
commit | 092f498fb3dd4f89ab43c0c76930ecc42a2900d4 (patch) | |
tree | ca255c76b1ff1c841c030daae678a974ac21fa51 /vcl | |
parent | 6e0b9798b329fc1a9b8429461b09726a8f2107f3 (diff) |
More CoreGraphics tracing
Change-Id: Idfb615063ec8822dee468883c844bab7dba7cf4c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/quartz/salbmp.cxx | 15 | ||||
-rw-r--r-- | vcl/quartz/salvd.cxx | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index cea1b6c2cdc3..800335608b4c 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -86,6 +86,7 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, if( nY < 0 ) nHeight += nY, nY = 0; const CGSize aLayerSize = CGLayerGetSize( xLayer ); + CG_TRACE( "CGLayerGetSize(" << xLayer << ") = " << aLayerSize ); if( nWidth >= (int)aLayerSize.width - nX ) nWidth = (int)aLayerSize.width - nX; if( nHeight >= (int)aLayerSize.height - nY ) @@ -255,8 +256,9 @@ bool QuartzSalBitmap::CreateContext() if( maContextBuffer.get() ) { - mxGraphicContext = ::CGBitmapContextCreate( maContextBuffer.get(), mnWidth, mnHeight, + mxGraphicContext = CGBitmapContextCreate( maContextBuffer.get(), mnWidth, mnHeight, bitsPerComponent, nContextBytesPerRow, aCGColorSpace, aCGBmpInfo ); + CG_TRACE( "CGBitmapContextCreate(" << mnWidth << "x" << mnHeight << "x" << bitsPerComponent << ") = " << mxGraphicContext ); } if( !mxGraphicContext ) @@ -868,6 +870,7 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHe CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(NULL, pMaskBuffer, nHeight * nDestBytesPerRow, &CFRTLFree) ); xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, NULL, true, kCGRenderingIntentDefault); + CG_TRACE( "CGImageCreate(" << nWidth << "x" << nHeight << "x8) = " << xMask ); CFRelease(xDataProvider); } else @@ -906,6 +909,7 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData ) OSL_TRACE("QuartzSalBitmap::%s(): kCGBitmapByteOrder32Host not found => inserting it.",__func__); CGImageRef xImage = CGBitmapContextCreateImage (mxGraphicContext); + CG_TRACE( "CGBitmapContextCreateImage(" << mxGraphicContext << ") = " << xImage ); // re-create the context with single change: include kCGBitmapByteOrder32Host flag. CGContextRef mxGraphicContextNew = CGBitmapContextCreate( CGBitmapContextGetData(mxGraphicContext), @@ -915,18 +919,27 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData ) CGBitmapContextGetBytesPerRow(mxGraphicContext), CGBitmapContextGetColorSpace(mxGraphicContext), CGBitmapContextGetBitmapInfo(mxGraphicContext) | kCGBitmapByteOrder32Host); + CG_TRACE( "CGBitmapContextCreate(" << CGBitmapContextGetWidth(mxGraphicContext) << "x" << CGBitmapContextGetHeight(mxGraphicContext) << "x" << CGBitmapContextGetBitsPerComponent(mxGraphicContext) << ") = " << mxGraphicContextNew ); + + CG_TRACE( "CFRelease(" << mxGraphicContext << ")" ); CFRelease(mxGraphicContext); // Needs to be flipped + CG_TRACE( "CGContextSaveGState(" << mxGraphicContextNew << ")" ); CGContextSaveGState( mxGraphicContextNew ); + CG_TRACE( "CGContextTranslateCTM(" << mxGraphicContextNew << ",0," << CGBitmapContextGetHeight(mxGraphicContextNew) << ")" ); CGContextTranslateCTM (mxGraphicContextNew, 0, CGBitmapContextGetHeight(mxGraphicContextNew)); + CG_TRACE( "CGContextScaleCTM(" << mxGraphicContextNew << ",1,-1)" ); CGContextScaleCTM (mxGraphicContextNew, 1.0, -1.0); + CG_TRACE( "CGContextDrawImage(" << mxGraphicContextNew << "," << CGRectMake(0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)) << "," << xImage << ")" ); CGContextDrawImage(mxGraphicContextNew, CGRectMake( 0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage); // Flip back + CG_TRACE( "CGContextRestoreGState(" << mxGraphicContextNew << ")" ); CGContextRestoreGState( mxGraphicContextNew ); + CG_TRACE( "CGImageRelease(" << xImage << ")" ); CGImageRelease( xImage ); mxGraphicContext = mxGraphicContextNew; } diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx index 0d8cc285ce03..543fc5d60289 100644 --- a/vcl/quartz/salvd.cxx +++ b/vcl/quartz/salvd.cxx @@ -179,6 +179,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) if( mxLayer ) { const CGSize aSize = CGLayerGetSize( mxLayer ); + CG_TRACE( "CGlayerGetSize(" << mxLayer << ") = " << aSize ); if( (nDX == aSize.width) && (nDY == aSize.height) ) { // Yay, we do not have to do anything :) |