[Libreoffice-commits] core.git: 2 commits - vcl/quartz
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 9 16:33:54 UTC 2018
vcl/quartz/salbmp.cxx | 42 ------------------------------------------
vcl/quartz/salvd.cxx | 6 ------
2 files changed, 48 deletions(-)
New commits:
commit 828d91ecde50b3a5e6c02ef1e5061e6e655a1399
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Oct 9 14:11:14 2018 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Oct 9 19:33:13 2018 +0300
Bin some no longer needed dbgutil code
It was used to initialize a virtual device pixel buffer to an
"interesting" pattern, in case actual rendering to it failed.
Change-Id: Iacdd86382dfa8c9ed1ea9d213fa489515b2b217d
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 8de6d38ee52d..d752a2d84acf 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -237,12 +237,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
const int nBytesPerRow = (mnBitmapDepth * nDX + 7) / 8;
void* pRawData = std::malloc( nBytesPerRow * nDY );
-#ifdef DBG_UTIL
- for (ssize_t i = 0; i < nBytesPerRow * nDY; i++)
- {
- static_cast<sal_uInt8*>(pRawData)[i] = (i & 0xFF);
- }
-#endif
mxBitmapContext = CGBitmapContextCreate( pRawData, nDX, nDY,
mnBitmapDepth, nBytesPerRow,
GetSalData()->mxGraySpace, kCGImageAlphaNone );
commit 1ab835e0fae20118971a349811ae28712c41fbc0
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Oct 9 14:08:11 2018 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Oct 9 19:33:13 2018 +0300
Bin horribly verbose image saving on iOS for debug purposes
Not really that useful any longer.
Change-Id: Idf29b9c3eeafd1b1cc7a2baa87205f7064681a23
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 8f3b9e3492ca..8fd2a5e76aee 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -48,45 +48,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) ||
@@ -885,7 +846,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
@@ -918,8 +878,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 << ")" );
More information about the Libreoffice-commits
mailing list