From 4cb41493edd162a83975e7b7604a3bf4ca43a578 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 23 May 2014 19:31:11 +0300 Subject: Add SAL_INFO tracing for CoreText calls Change-Id: Ie60e0b64a2d9d8a045cb3c59fc781d6f9b2808a0 --- vcl/quartz/ctlayout.cxx | 14 ++++++++++++++ vcl/quartz/salgdi.cxx | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'vcl/quartz') diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 0c317c4f9cc7..f74b235c3325 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -21,6 +21,8 @@ #include #include "tools/debug.hxx" +#include "quartz/utils.h" + #include "ctfonts.hxx" #include "CTRunData.hxx" @@ -128,6 +130,7 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs ) // CFAttributedStringCreate copies the attribues parameter mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() ); mpCTLine = CTLineCreateWithAttributedString( mpAttrString ); + SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine ); CFRelease( aCFText); mnTrailingSpaceCount = 0; @@ -206,6 +209,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) aCFText, mpTextStyle->GetStyleDict() ); mpCTLine = CTLineCreateWithAttributedString( pAttrStr ); + SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine ); CFRelease( pAttrStr ); CFRelease( aCFText ); #endif @@ -222,6 +226,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth - mfTrailingSpaceWidth ); #else CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth); + SAL_INFO( "vcl.ct", "CTLineCreateJustifiedLine(" << mpCTLine << ",1.0," << nPixelWidth << ") = " << pNewCTLine ); #endif if( !pNewCTLine ) { @@ -233,6 +238,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) // - changing the CTM matrix return; } + SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" ); CFRelease( mpCTLine ); mpCTLine = pNewCTLine; #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060 @@ -306,10 +312,12 @@ bool CTLayout::DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const CFAttributedStringGetString(mpAttrString), styledict); CTLineRef pCTLine = CTLineCreateWithAttributedString( pAttrStr ); + SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(" << pAttrStr << ") = " << pCTLine ); CFRelease( pAttrStr ); /* draw the text in 'outline' */ drawCTLine(rAquaGraphics, pCTLine, mpTextStyle); + SAL_INFO( "vcl.ct", "CFRelease(" << pCTLine << ")" ); CFRelease(pCTLine); return true; } @@ -324,7 +332,9 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons // the view is vertically flipped => flipped glyphs // so apply a temporary transformation that it flips back // also compensate if the font was size limited + SAL_INFO( "vcl.ct", "CGContextSaveGState(" << rAquaGraphics.mrContext << ")" ); CGContextSaveGState( rAquaGraphics.mrContext ); + SAL_INFO( "vcl.ct", "CGContextScaleCTM(" << rAquaGraphics.mrContext << ",1.0,-1.0)" ); CGContextScaleCTM( rAquaGraphics.mrContext, 1.0, -1.0 ); CGContextSetShouldAntialias( rAquaGraphics.mrContext, !rAquaGraphics.mbNonAntialiasedText ); @@ -334,13 +344,16 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons if( pStyle->mfFontRotation != 0.0 ) { const CGFloat fRadians = pStyle->mfFontRotation; + SAL_INFO( "vcl.ct", "CGContextRotateCTM(" << rAquaGraphics.mrContext << "," << +fRadians << ")" ); CGContextRotateCTM( rAquaGraphics.mrContext, +fRadians ); const CGAffineTransform aInvMatrix = CGAffineTransformMakeRotation( -fRadians ); aTextPos = CGPointApplyAffineTransform( aTextPos, aInvMatrix ); } + SAL_INFO( "vcl.ct", "CGContextSetTextPosition(" << rAquaGraphics.mrContext << "," << aTextPos << ")" ); CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y ); + SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << rAquaGraphics.mrContext << ")" ); CTLineDraw( ctline, rAquaGraphics.mrContext ); #ifndef IOS // request an update of the changed window area @@ -352,6 +365,7 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons } #endif // restore the original graphic context transformations + SAL_INFO( "vcl.ct", "CGContextRestoreGState(" << rAquaGraphics.mrContext << ")" ); CGContextRestoreGState( rAquaGraphics.mrContext ); } diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 4a346df57e04..10210903468b 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -467,7 +467,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac mpTextStyle = mpFontData->CreateTextStyle( *pReqFont ); mpTextStyle->SetTextColor( maTextColor ); - SAL_INFO("vcl.coretext", + SAL_INFO("vcl.ct", "SetFont" << " to " << mpFontData->GetFamilyName() << ", " << mpFontData->GetStyleName() -- cgit