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

Bin the much too verbose SAL_INFO() calls for the "vcl.cg" tag

Quikee agreed that they aren't really useful. Doing even the simplest
things causes such a huge amount of logging that it is questionable
whether anybody could have any use of it.

Parts of it might be useful to restore later, if need arises. Like the
mnContextStackDepth logging in vcl/inc/quartz/CGHelpers.hxx.

Change-Id: If635e6492a50e5955c56c54fa310e7c0ab2986ae
Reviewed-on: https://gerrit.libreoffice.org/73639
Tested-by: Jenkins
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 548f30f2
......@@ -1624,15 +1624,11 @@ void paintTileIOS(LibreOfficeKitDocument* pThis,
nCanvasWidth * 4, CGColorSpaceCreateDeviceRGB(),
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little);
// Use the vcl.cg tag even if this code is not in vcl, to match all other SAL_INFO logging about Core Graphics, in vcl.
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nCanvasWidth << "x" << nCanvasHeight << "x32) = " << pCGContext);
CGContextTranslateCTM(pCGContext, 0, nCanvasHeight);
CGContextScaleCTM(pCGContext, fDPIScale, -fDPIScale);
doc_paintTileToCGContext(pThis, (void*) pCGContext, nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
SAL_INFO("vcl.cg", "CGContextRelease(" << pCGContext << ")");
CGContextRelease(pCGContext);
}
#endif
......@@ -4177,8 +4173,6 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
CGContextRef cgc = CGBitmapContextCreate(pBuffer, nWidth, nHeight, 8, nWidth*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little);
SAL_INFO( "vcl.cg", "CGBitmapContextCreate(" << nWidth << "x" << nHeight << "x32) = " << cgc);
CGContextTranslateCTM(cgc, 0, nHeight);
CGContextScaleCTM(cgc, fDPIScale, -fDPIScale);
......@@ -4198,7 +4192,6 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
comphelper::LibreOfficeKit::setDialogPainting(false);
SAL_INFO( "vcl.cg", "CGContextRelease(" << cgc << ")" );
CGContextRelease(cgc);
#else
......
......@@ -459,7 +459,6 @@ certain functionality.
@li @c vcl
@li @c vcl.a11y
@li @c vcl.app
@li @c vcl.cg - CoreGraphics calls on macOS and iOS
@li @c vcl.control
@li @c vcl.ct - CoreText-using code for macOS and iOS
@li @c vcl.debugevent
......
......@@ -45,7 +45,6 @@ public:
if (mpLayer)
{
aSize = CGLayerGetSize(mpLayer);
SAL_INFO("vcl.cg", "CGLayerGetSize(" << mpLayer << ") = " << aSize);
}
return aSize;
}
......@@ -78,24 +77,15 @@ class CGContextHolder
{
private:
CGContextRef mpContext;
#if OSL_DEBUG_LEVEL > 0
int mnContextStackDepth;
#endif
public:
CGContextHolder()
: mpContext(nullptr)
#if OSL_DEBUG_LEVEL > 0
, mnContextStackDepth(0)
#endif
{
}
CGContextHolder(CGContextRef pContext)
: mpContext(pContext)
#if OSL_DEBUG_LEVEL > 0
, mnContextStackDepth(0)
#endif
{
}
......@@ -105,21 +95,9 @@ public:
void set(CGContextRef const& pContext) { mpContext = pContext; }
void saveState()
{
#if OSL_DEBUG_LEVEL > 0
SAL_INFO("vcl.cg", "CGContextSaveGState(" << mpContext << ") " << ++mnContextStackDepth);
#endif
CGContextSaveGState(mpContext);
}
void saveState() { CGContextSaveGState(mpContext); }
void restoreState()
{
#if OSL_DEBUG_LEVEL > 0
SAL_INFO("vcl.cg", "CGContextRestoreGState(" << mpContext << ") " << mnContextStackDepth--);
#endif
CGContextRestoreGState(mpContext);
}
void restoreState() { CGContextRestoreGState(mpContext); }
};
#endif // INCLUDED_VCL_INC_QUARTZ_CGHELPER_HXX
......
......@@ -84,7 +84,7 @@ bool QuartzSalBitmap::Create(CGLayerHolder const & rLayerHolder, int nBitmapBits
}
const CGSize aLayerSize = CGLayerGetSize(rLayerHolder.get());
SAL_INFO("vcl.cg", "CGLayerGetSize(" << rLayerHolder.get() << ") = " << aLayerSize );
if( nWidth >= static_cast<int>(aLayerSize.width) - nX )
nWidth = static_cast<int>(aLayerSize.width) - nX;
......@@ -106,12 +106,10 @@ bool QuartzSalBitmap::Create(CGLayerHolder const & rLayerHolder, int nBitmapBits
const CGPoint aSrcPoint = { static_cast<CGFloat>(-nX), static_cast<CGFloat>(-nY) };
if (maGraphicContext.isSet()) // remove warning
{
SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << maGraphicContext.get() << "," << aSrcPoint << "," << rLayerHolder.get() << ")");
if( bFlipped )
{
SAL_INFO( "vcl.cg", "CGContextTranslateCTM(" << maGraphicContext.get() << ",0," << mnHeight << ")" );
CGContextTranslateCTM( maGraphicContext.get(), 0, +mnHeight );
SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << maGraphicContext.get() << ",+1,-1)" );
CGContextScaleCTM( maGraphicContext.get(), +1, -1 );
}
......@@ -181,14 +179,12 @@ void QuartzSalBitmap::DestroyContext()
{
if( mxCachedImage )
{
SAL_INFO("vcl.cg", "CGImageRelease(" << mxCachedImage << ")" );
CGImageRelease( mxCachedImage );
mxCachedImage = nullptr;
}
if (maGraphicContext.isSet())
{
SAL_INFO("vcl.cg", "CGContextRelease(" << maGraphicContext.get() << ")" );
CGContextRelease(maGraphicContext.get());
maGraphicContext.set(nullptr);
m_pContextBuffer.reset();
......@@ -252,7 +248,6 @@ bool QuartzSalBitmap::CreateContext()
maGraphicContext.set(CGBitmapContextCreate(m_pContextBuffer.get(), mnWidth, mnHeight,
bitsPerComponent, nContextBytesPerRow,
aCGColorSpace, aCGBmpInfo));
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << mnWidth << "x" << mnHeight << "x" << bitsPerComponent << ") = " << maGraphicContext.get());
}
if (!maGraphicContext.isSet())
......@@ -804,7 +799,6 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
}
}
mxCachedImage = CGBitmapContextCreateImage(maGraphicContext.get());
SAL_INFO("vcl.cg", "CGBitmapContextCreateImage(" << maGraphicContext.get() << ") = " << mxCachedImage );
}
CGImageRef xCroppedImage = nullptr;
......@@ -812,7 +806,6 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
if( !nX && !nY && (mnWidth == nNewWidth) && (mnHeight == nNewHeight) )
{
xCroppedImage = mxCachedImage;
SAL_INFO("vcl.cg", "CFRetain(" << xCroppedImage << ")" );
CFRetain( xCroppedImage );
}
else
......@@ -820,7 +813,6 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
nY = mnHeight - (nY + nNewHeight); // adjust for y-mirrored context
const CGRect aCropRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nNewWidth), static_cast<CGFloat>(nNewHeight) } };
xCroppedImage = CGImageCreateWithImageInRect( mxCachedImage, aCropRect );
SAL_INFO("vcl.cg", "CGImageCreateWithImageInRect(" << mxCachedImage << "," << aCropRect << ") = " << xCroppedImage );
}
return xCroppedImage;
......@@ -854,19 +846,14 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
void* pMaskMem = std::malloc( nMaskBytesPerRow * nHeight );
CGContextRef xMaskContext = CGBitmapContextCreate( pMaskMem,
nWidth, nHeight, 8, nMaskBytesPerRow, GetSalData()->mxGraySpace, kCGImageAlphaNone );
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nWidth << "x" << nHeight << "x8," << nMaskBytesPerRow << ") = " << xMaskContext );
SAL_INFO("vcl.cg", "CGContextDrawImage(" << xMaskContext << "," << xImageRect << "," << xMask << ")" );
CGContextDrawImage( xMaskContext, xImageRect, xMask );
SAL_INFO("vcl.cg", "CFRelease(" << xMask << ")" );
CFRelease( xMask );
CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( nullptr,
pMaskMem, nHeight * nMaskBytesPerRow, &CFRTLFree ) );
static const CGFloat* pDecode = nullptr;
xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false );
SAL_INFO("vcl.cg", "CGImageMaskCreate(" << nWidth << "," << nHeight << ",8,8) = " << xMask );
CFRelease( xDataProvider );
SAL_INFO("vcl.cg", "CFRelease(" << xMaskContext << ")" );
CFRelease( xMaskContext );
}
......@@ -875,10 +862,7 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
// combine image and alpha mask
CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask );
SAL_INFO("vcl.cg", "CGImageCreateWithMask(" << xImage << "," << xMask << ") = " << xMaskedImage );
SAL_INFO("vcl.cg", "CFRelease(" << xMask << ")" );
CFRelease( xMask );
SAL_INFO("vcl.cg", "CFRelease(" << xImage << ")" );
CFRelease( xImage );
return xMaskedImage;
}
......@@ -925,7 +909,6 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth,
CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(nullptr, pMaskBuffer.release(), nHeight * nDestBytesPerRow, &CFRTLFree) );
xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, nullptr, true, kCGRenderingIntentDefault);
SAL_INFO("vcl.cg", "CGImageCreate(" << nWidth << "x" << nHeight << "x8) = " << xMask );
CFRelease(xDataProvider);
}
}
......@@ -959,10 +942,8 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData )
* This whole if statement was originally (before 2011) inside #ifdef CAIRO. Did we use Cairo on Mac back then?
* Anyway, nowadays (since many years, I think) we don't, so should this if statement be dropped? Fun.
*/
SAL_INFO("vcl.cg", "QuartzSalBitmap::" << __func__ << "(): kCGBitmapByteOrder32Host not found => inserting it.");
CGImageRef xImage = CGBitmapContextCreateImage(maGraphicContext.get());
SAL_INFO("vcl.cg", "CGBitmapContextCreateImage(" << maGraphicContext.get() << ") = " << xImage );
// re-create the context with single change: include kCGBitmapByteOrder32Host flag.
CGContextHolder maGraphicContextNew(CGBitmapContextCreate(CGBitmapContextGetData(maGraphicContext.get()),
......@@ -972,29 +953,17 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData )
CGBitmapContextGetBytesPerRow(maGraphicContext.get()),
CGBitmapContextGetColorSpace(maGraphicContext.get()),
CGBitmapContextGetBitmapInfo(maGraphicContext.get()) | kCGBitmapByteOrder32Host));
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << CGBitmapContextGetWidth(maGraphicContext.get()) << "x"
<< CGBitmapContextGetHeight(maGraphicContext.get()) << "x"
<< CGBitmapContextGetBitsPerComponent(maGraphicContext.get()) << ") = "
<< maGraphicContextNew.get());
SAL_INFO("vcl.cg", "CFRelease(" << maGraphicContext.get() << ")");
CFRelease(maGraphicContext.get());
// Needs to be flipped
maGraphicContextNew.saveState();
SAL_INFO("vcl.cg", "CGContextTranslateCTM(" << maGraphicContextNew.get() << ",0," << CGBitmapContextGetHeight(maGraphicContextNew.get()) << ")" );
CGContextTranslateCTM (maGraphicContextNew.get(), 0, CGBitmapContextGetHeight(maGraphicContextNew.get()));
SAL_INFO("vcl.cg", "CGContextScaleCTM(" << maGraphicContextNew.get() << ",1,-1)" );
CGContextScaleCTM (maGraphicContextNew.get(), 1.0, -1.0);
SAL_INFO("vcl.cg", "CGContextDrawImage(" << maGraphicContextNew.get() << "," << CGRectMake(0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)) << "," << xImage << ")" );
CGContextDrawImage(maGraphicContextNew.get(), CGRectMake( 0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage);
// Flip back
SAL_INFO("vcl.cg", "CGContextRestoreGState(" << maGraphicContextNew.get() << ")" );
CGContextRestoreGState( maGraphicContextNew.get() );
SAL_INFO("vcl.cg", "CGImageRelease(" << xImage << ")" );
CGImageRelease( xImage );
maGraphicContext = maGraphicContextNew;
}
......
......@@ -219,7 +219,6 @@ AquaSalGraphics::~AquaSalGraphics()
if( mxClipPath )
{
SAL_INFO("vcl.cg", "CGPathRelease(" << mxClipPath << ")" );
CGPathRelease( mxClipPath );
}
......@@ -239,7 +238,6 @@ AquaSalGraphics::~AquaSalGraphics()
#endif
if (maLayer.isSet())
{
SAL_INFO("vcl.cg", "CGLayerRelease(" << maLayer.get() << ")" );
CGLayerRelease(maLayer.get());
}
else if (maContextHolder.isSet()
......@@ -249,7 +247,6 @@ AquaSalGraphics::~AquaSalGraphics()
)
{
// destroy backbuffer bitmap context that we created ourself
SAL_INFO("vcl.cg", "CGContextRelease(" << maContextHolder.get() << ")" );
CGContextRelease(maContextHolder.get());
maContextHolder.set(nullptr);
}
......@@ -448,10 +445,8 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
maContextHolder.saveState();
// The view is vertically flipped (no idea why), flip it back.
SAL_INFO("vcl.cg", "CGContextScaleCTM(" << maContextHolder.get() << ",1,-1)");
CGContextScaleCTM(maContextHolder.get(), 1.0, -1.0);
CGContextSetShouldAntialias(maContextHolder.get(), !mbNonAntialiasedText);
SAL_INFO("vcl.cg", "CGContextSetFillColor(" << maContextHolder.get() << "," << maTextColor << ")");
CGContextSetFillColor(maContextHolder.get(), maTextColor.AsArray());
if (rStyle.mbFauxBold)
......@@ -476,10 +471,8 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
maContextHolder.saveState();
if (rStyle.mfFontRotation && !bUprightGlyph)
{
SAL_INFO("vcl.cg", "CGContextRotateCTM(" << maContextHolder.get() << "," << rStyle.mfFontRotation << ")");
CGContextRotateCTM(maContextHolder.get(), rStyle.mfFontRotation);
}
SAL_INFO("vcl.cg", "CTFontDrawGlyphs() @" << nStartIndex << ":" << nLen << "," << maContextHolder.get());
CTFontDrawGlyphs(pFont, &aGlyphIds[nStartIndex], &aGlyphPos[nStartIndex], nLen, maContextHolder.get());
maContextHolder.restoreState();
......
This diff is collapsed.
......@@ -81,7 +81,6 @@ void AquaSalGraphics::UnsetState()
}
if( mxClipPath )
{
SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" );
CGPathRelease( mxClipPath );
mxClipPath = nullptr;
}
......@@ -118,7 +117,6 @@ bool AquaSalGraphics::CheckContext()
}
else if (maContextHolder.isSet())
{
SAL_INFO("vcl.cg", "CGContextRelease(" << maContextHolder.get() << ")");
CGContextRelease(maContextHolder.get());
}
maContextHolder.set(nullptr);
......@@ -155,10 +153,8 @@ bool AquaSalGraphics::CheckContext()
// copy original layer to resized layer
if (maContextHolder.isSet())
{
SAL_INFO("vcl.cg", "CGContextDrawLayerAtPoint(" << maContextHolder.get() << "," << CGPointZero << "," << rReleaseLayer << ")");
CGContextDrawLayerAtPoint(maContextHolder.get(), CGPointZero, rReleaseLayer);
}
SAL_INFO("vcl.cg", "CGLayerRelease(" << rReleaseLayer << ")");
CGLayerRelease(rReleaseLayer);
}
......@@ -210,7 +206,6 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
if (maLayer.isSet() && pContext != nullptr)
{
CGContextHolder rCGContextHolder([pContext CGContext]);
SAL_INFO("vcl.cg", "[[NSGraphicsContext currentContext] CGContext] = " << rCGContextHolder.get());
rCGContextHolder.saveState();
......@@ -218,9 +213,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
if (rClip)
{
CGContextBeginPath(rCGContextHolder.get());
SAL_INFO( "vcl.cg", "CGContextAddPath(" << rCGContextHolder.get() << "," << rClip << ")" );
CGContextAddPath(rCGContextHolder.get(), rClip );
SAL_INFO( "vcl.cg", "CGContextClip(" << rCGContextHolder.get() << ")" );
CGContextClip(rCGContextHolder.get());
}
......@@ -229,7 +222,6 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
const CGSize aSize = maLayer.getSizePoints();
const CGRect aRect = CGRectMake(0, 0, aSize.width, aSize.height);
SAL_INFO( "vcl.cg", "CGContextDrawLayerInRect(" << rCGContextHolder.get() << "," << aRect << "," << maLayer.get() << ")" );
CGContextDrawLayerInRect(rCGContextHolder.get(), aRect, maLayer.get());
rCGContextHolder.restoreState();
......
......@@ -101,8 +101,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX
nDX = 0;
nDY = 0;
}
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << pData->rCGContext <<
"," << CGSizeMake( nDX, nDY) << ",NULL) = " << maLayer.get());
mpGraphics->SetVirDevGraphics(maLayer, pData->rCGContext);
}
else
......@@ -174,7 +173,6 @@ void AquaSalVirtualDevice::Destroy()
{
mpGraphics->SetVirDevGraphics(nullptr, nullptr);
}
SAL_INFO("vcl.cg", "CGLayerRelease(" << maLayer.get() << ")");
CGLayerRelease(maLayer.get());
maLayer.set(nullptr);
}
......@@ -183,7 +181,6 @@ void AquaSalVirtualDevice::Destroy()
{
void* pRawData = CGBitmapContextGetData(maBitmapContext.get());
std::free(pRawData);
SAL_INFO( "vcl.cg", "CGContextRelease(" << maBitmapContext.get() << ")" );
CGContextRelease(maBitmapContext.get());
maBitmapContext.set(nullptr);
}
......@@ -218,7 +215,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
if (maLayer.isSet())
{
const CGSize aSize = CGLayerGetSize(maLayer.get());
SAL_INFO( "vcl.cg", "CGlayerGetSize(" << maLayer.get() << ") = " << aSize );
if( (nDX == aSize.width) && (nDY == aSize.height) )
{
// Yay, we do not have to do anything :)
......@@ -242,7 +238,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
maBitmapContext.set(CGBitmapContextCreate( pRawData, nDX, nDY,
mnBitmapDepth, nBytesPerRow,
GetSalData()->mxGraySpace, kCGImageAlphaNone));
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nDX << "x" << nDY << "x" << mnBitmapDepth << ") = " << maBitmapContext.get());
xCGContextHolder = maBitmapContext;
}
else
......@@ -286,7 +281,6 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
#endif
maBitmapContext.set(CGBitmapContextCreate(pRawData, nDX, nDY, 8, nBytesPerRow,
GetSalData()->mxRGBSpace, nFlags));
SAL_INFO("vcl.cg", "CGBitmapContextCreate(" << nDX << "x" << nDY << "x32) = " << maBitmapContext.get());
xCGContextHolder = maBitmapContext;
}
}
......@@ -295,13 +289,11 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
const CGSize aNewSize = { static_cast<CGFloat>(nDX), static_cast<CGFloat>(nDY) };
maLayer.set(CGLayerCreateWithContext(xCGContextHolder.get(), aNewSize, nullptr));
SAL_INFO("vcl.cg", "CGLayerCreateWithContext(" << xCGContextHolder.get() << "," << aNewSize << ",NULL) = " << maLayer.get());
if (maLayer.isSet() && mpGraphics)
{
// get the matching Quartz context
CGContextRef xDrawContext = CGLayerGetContext( maLayer.get() );
SAL_INFO( "vcl.cg", "CGLayerGetContext(" << maLayer.get() << ") = " << xDrawContext );
mpGraphics->SetVirDevGraphics(maLayer.get(), xDrawContext, mnBitmapDepth);
}
......
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