diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-10-09 14:08:11 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-10-30 17:00:49 +0000 |
commit | 610c0be9d8cbe1ea0c227f2ae4af94fdc1de26c5 (patch) | |
tree | bb0c39043ea6cb2e54c9f7f1da854267979ae9d9 /vcl | |
parent | 4ed5ebfe973660adeac37c91233636951dc65ae8 (diff) |
Bin horribly verbose image saving on iOS for debug purposes
Not really that useful any longer.
Change-Id: Idf29b9c3eeafd1b1cc7a2baa87205f7064681a23
(cherry picked from commit 1ab835e0fae20118971a349811ae28712c41fbc0)
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/quartz/salbmp.cxx | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index 60a16503f3d2..ffe830348ba7 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -46,45 +46,6 @@ static const unsigned long k32BitRedColorMask = 0x00ff0000; static const unsigned long k32BitGreenColorMask = 0x0000ff00; static const unsigned long k32BitBlueColorMask = 0x000000ff; -#if defined IOS && defined DBG_UTIL - -#include <MobileCoreServices/UTCoreTypes.h> -#include <ImageIO/ImageIO.h> - -static void writeImageToFile(CGImageRef image, const char *baseName) -{ - static bool bDoIt = getenv("DBG_WRITE_CGIMAGES"); - if (!bDoIt) - return; - - static int counter = 0; - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = [paths objectAtIndex:0]; - NSString *path = [NSString stringWithFormat:@"%@/%s.%d.png", documentsDirectory, baseName, counter++]; - CFURLRef url = (CFURLRef)[NSURL fileURLWithPath:path]; - CGImageDestinationRef destination = CGImageDestinationCreateWithURL(url, kUTTypePNG, 1, NULL); - CGImageDestinationAddImage(destination, image, nil); - - if (!CGImageDestinationFinalize(destination)) - { - NSLog(@"Failed to write image to %@", path); - } - else - { - SAL_DEBUG("--- saved image " << baseName << " to " << [path UTF8String]); - } - - CFRelease(destination); -} - -#define DBG_WRITE_IMAGE(image, name) writeImageToFile(image, name) - -#else - -#define DBG_WRITE_IMAGE(image, name) /* empty */ - -#endif - static bool isValidBitCount( sal_uInt16 nBitCount ) { return (nBitCount == 1) || (nBitCount == 4) || (nBitCount == 8) || @@ -906,7 +867,6 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask, // CGImageCreateWithMask() only likes masks or greyscale images => convert if needed // TODO: isolate in an extra method? - DBG_WRITE_IMAGE(xMask, "xMask"); if( !CGImageIsMask(xMask) || rMask.GetBitCount() != 8)//(CGImageGetColorSpace(xMask) != GetSalData()->mxGraySpace) ) { const CGRect xImageRect=CGRectMake( 0, 0, nWidth, nHeight );//the rect has no offset @@ -939,8 +899,6 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask, // combine image and alpha mask CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask ); SAL_INFO("vcl.cg", "CGImageCreateWithMask(" << xImage << "," << xMask << ") = " << xMaskedImage ); - DBG_WRITE_IMAGE(xImage, "xImage"); - DBG_WRITE_IMAGE(xMaskedImage, "xMaskedImage"); SAL_INFO("vcl.cg", "CFRelease(" << xMask << ")" ); CFRelease( xMask ); SAL_INFO("vcl.cg", "CFRelease(" << xImage << ")" ); |