include/sal/log-areas.dox | 2 vcl/quartz/ctlayout.cxx | 14 +++ vcl/quartz/salgdi.cxx | 2 vcl/quartz/salgdicommon.cxx | 3 vcl/source/filter/wmf/enhwmf.cxx | 140 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 156 insertions(+), 5 deletions(-)
New commits: commit 4cb41493edd162a83975e7b7604a3bf4ca43a578 Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 19:31:11 2014 +0300 Add SAL_INFO tracing for CoreText calls Change-Id: Ie60e0b64a2d9d8a045cb3c59fc781d6f9b2808a0 diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 8412f01..38d72fc 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -368,7 +368,7 @@ certain functionality. @li @c vcl.app @li @c vcl.cg - CoreGraphics calls on OS X and iOS @li @c vcl.control -@li @c vcl.coretext - CoreText-using code for Mac OS X and iOS +@li @c vcl.ct - CoreText-using code for OS X and iOS @li @c vcl.debugevent @li @c vcl.emf - EMF/EMF+ processing @li @c vcl.filter diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 0c317c4..f74b235 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -21,6 +21,8 @@ #include <boost/ptr_container/ptr_vector.hpp> #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 4a346df..1021090 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() commit b8624e120e6e2643b0b9c7497177c659389b94d3 Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 19:16:14 2014 +0300 Output record types symbolically in SAL_INFO Change-Id: I57665f39f9921a11e855d0574f836ef52078660b diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index 4047093..6c806db 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -156,6 +156,144 @@ using namespace std; namespace { +const char * +record_type_name(sal_uInt32 nRecType) +{ +#ifndef SAL_LOG_INFO + (void) nRecType; + return ""; +#else + switch( nRecType ) + { + case EMR_HEADER: return "HEADER"; + case EMR_POLYBEZIER: return "POLYBEZIER"; + case EMR_POLYGON: return "POLYGON"; + case EMR_POLYLINE: return "POLYLINE"; + case EMR_POLYBEZIERTO: return "POLYBEZIERTO"; + case EMR_POLYLINETO: return "POLYLINETO"; + case EMR_POLYPOLYLINE: return "POLYPOLYLINE"; + case EMR_POLYPOLYGON: return "POLYPOLYGON"; + case EMR_SETWINDOWEXTEX: return "SETWINDOWEXTEX"; + case EMR_SETWINDOWORGEX: return "SETWINDOWORGEX"; + case EMR_SETVIEWPORTEXTEX: return "SETVIEWPORTEXTEX"; + case EMR_SETVIEWPORTORGEX: return "SETVIEWPORTORGEX"; + case EMR_SETBRUSHORGEX: return "SETBRUSHORGEX"; + case EMR_EOF: return "EOF"; + case EMR_SETPIXELV: return "SETPIXELV"; + case EMR_SETMAPPERFLAGS: return "SETMAPPERFLAGS"; + case EMR_SETMAPMODE: return "SETMAPMODE"; + case EMR_SETBKMODE: return "SETBKMODE"; + case EMR_SETPOLYFILLMODE: return "SETPOLYFILLMODE"; + case EMR_SETROP2: return "SETROP2"; + case EMR_SETSTRETCHBLTMODE: return "SETSTRETCHBLTMODE"; + case EMR_SETTEXTALIGN: return "SETTEXTALIGN"; + case EMR_SETCOLORADJUSTMENT: return "SETCOLORADJUSTMENT"; + case EMR_SETTEXTCOLOR: return "SETTEXTCOLOR"; + case EMR_SETBKCOLOR: return "SETBKCOLOR"; + case EMR_OFFSETCLIPRGN: return "OFFSETCLIPRGN"; + case EMR_MOVETOEX: return "MOVETOEX"; + case EMR_SETMETARGN: return "SETMETARGN"; + case EMR_EXCLUDECLIPRECT: return "EXCLUDECLIPRECT"; + case EMR_INTERSECTCLIPRECT: return "INTERSECTCLIPRECT"; + case EMR_SCALEVIEWPORTEXTEX: return "SCALEVIEWPORTEXTEX"; + case EMR_SCALEWINDOWEXTEX: return "SCALEWINDOWEXTEX"; + case EMR_SAVEDC: return "SAVEDC"; + case EMR_RESTOREDC: return "RESTOREDC"; + case EMR_SETWORLDTRANSFORM: return "SETWORLDTRANSFORM"; + case EMR_MODIFYWORLDTRANSFORM: return "MODIFYWORLDTRANSFORM"; + case EMR_SELECTOBJECT: return "SELECTOBJECT"; + case EMR_CREATEPEN: return "CREATEPEN"; + case EMR_CREATEBRUSHINDIRECT: return "CREATEBRUSHINDIRECT"; + case EMR_DELETEOBJECT: return "DELETEOBJECT"; + case EMR_ANGLEARC: return "ANGLEARC"; + case EMR_ELLIPSE: return "ELLIPSE"; + case EMR_RECTANGLE: return "RECTANGLE"; + case EMR_ROUNDRECT: return "ROUNDRECT"; + case EMR_ARC: return "ARC"; + case EMR_CHORD: return "CHORD"; + case EMR_PIE: return "PIE"; + case EMR_SELECTPALETTE: return "SELECTPALETTE"; + case EMR_CREATEPALETTE: return "CREATEPALETTE"; + case EMR_SETPALETTEENTRIES: return "SETPALETTEENTRIES"; + case EMR_RESIZEPALETTE: return "RESIZEPALETTE"; + case EMR_REALIZEPALETTE: return "REALIZEPALETTE"; + case EMR_EXTFLOODFILL: return "EXTFLOODFILL"; + case EMR_LINETO: return "LINETO"; + case EMR_ARCTO: return "ARCTO"; + case EMR_POLYDRAW: return "POLYDRAW"; + case EMR_SETARCDIRECTION: return "SETARCDIRECTION"; + case EMR_SETMITERLIMIT: return "SETMITERLIMIT"; + case EMR_BEGINPATH: return "BEGINPATH"; + case EMR_ENDPATH: return "ENDPATH"; + case EMR_CLOSEFIGURE: return "CLOSEFIGURE"; + case EMR_FILLPATH: return "FILLPATH"; + case EMR_STROKEANDFILLPATH: return "STROKEANDFILLPATH"; + case EMR_STROKEPATH: return "STROKEPATH"; + case EMR_FLATTENPATH: return "FLATTENPATH"; + case EMR_WIDENPATH: return "WIDENPATH"; + case EMR_SELECTCLIPPATH: return "SELECTCLIPPATH"; + case EMR_ABORTPATH: return "ABORTPATH"; + case EMR_GDICOMMENT: return "GDICOMMENT"; + case EMR_FILLRGN: return "FILLRGN"; + case EMR_FRAMERGN: return "FRAMERGN"; + case EMR_INVERTRGN: return "INVERTRGN"; + case EMR_PAINTRGN: return "PAINTRGN"; + case EMR_EXTSELECTCLIPRGN: return "EXTSELECTCLIPRGN"; + case EMR_BITBLT: return "BITBLT"; + case EMR_STRETCHBLT: return "STRETCHBLT"; + case EMR_MASKBLT: return "MASKBLT"; + case EMR_PLGBLT: return "PLGBLT"; + case EMR_SETDIBITSTODEVICE: return "SETDIBITSTODEVICE"; + case EMR_STRETCHDIBITS: return "STRETCHDIBITS"; + case EMR_EXTCREATEFONTINDIRECTW: return "EXTCREATEFONTINDIRECTW"; + case EMR_EXTTEXTOUTA: return "EXTTEXTOUTA"; + case EMR_EXTTEXTOUTW: return "EXTTEXTOUTW"; + case EMR_POLYBEZIER16: return "POLYBEZIER16"; + case EMR_POLYGON16: return "POLYGON16"; + case EMR_POLYLINE16: return "POLYLINE16"; + case EMR_POLYBEZIERTO16: return "POLYBEZIERTO16"; + case EMR_POLYLINETO16: return "POLYLINETO16"; + case EMR_POLYPOLYLINE16: return "POLYPOLYLINE16"; + case EMR_POLYPOLYGON16: return "POLYPOLYGON16"; + case EMR_POLYDRAW16: return "POLYDRAW16"; + case EMR_CREATEMONOBRUSH: return "CREATEMONOBRUSH"; + case EMR_CREATEDIBPATTERNBRUSHPT: return "CREATEDIBPATTERNBRUSHPT"; + case EMR_EXTCREATEPEN: return "EXTCREATEPEN"; + case EMR_POLYTEXTOUTA: return "POLYTEXTOUTA"; + case EMR_POLYTEXTOUTW: return "POLYTEXTOUTW"; + case EMR_SETICMMODE: return "SETICMMODE"; + case EMR_CREATECOLORSPACE: return "CREATECOLORSPACE"; + case EMR_SETCOLORSPACE: return "SETCOLORSPACE"; + case EMR_DELETECOLORSPACE: return "DELETECOLORSPACE"; + case EMR_GLSRECORD: return "GLSRECORD"; + case EMR_GLSBOUNDEDRECORD: return "GLSBOUNDEDRECORD"; + case EMR_PIXELFORMAT: return "PIXELFORMAT"; + case EMR_DRAWESCAPE: return "DRAWESCAPE"; + case EMR_EXTESCAPE: return "EXTESCAPE"; + case EMR_STARTDOC: return "STARTDOC"; + case EMR_SMALLTEXTOUT: return "SMALLTEXTOUT"; + case EMR_FORCEUFIMAPPING: return "FORCEUFIMAPPING"; + case EMR_NAMEDESCAPE: return "NAMEDESCAPE"; + case EMR_COLORCORRECTPALETTE: return "COLORCORRECTPALETTE"; + case EMR_SETICMPROFILEA: return "SETICMPROFILEA"; + case EMR_SETICMPROFILEW: return "SETICMPROFILEW"; + case EMR_ALPHABLEND: return "ALPHABLEND"; + case EMR_ALPHADIBBLEND: return "ALPHADIBBLEND"; + case EMR_TRANSPARENTBLT: return "TRANSPARENTBLT"; + case EMR_TRANSPARENTDIB: return "TRANSPARENTDIB"; + case EMR_GRADIENTFILL: return "GRADIENTFILL"; + case EMR_SETLINKEDUFIS: return "SETLINKEDUFIS"; + case EMR_SETTEXTJUSTIFICATION: return "SETTEXTJUSTIFICATION"; + default: + // Yes, return a pointer to a static buffer. This is a very + // local debugging output function, so no big deal. + static char buffer[11]; + sprintf(buffer, "0x%08" SAL_PRIxUINT32, nRecType); + return buffer; + } +#endif +} + #ifdef OSL_BIGENDIAN // little endian <-> big endian switch static float GetSwapFloat(SvStream& rStream) @@ -516,7 +654,7 @@ bool EnhWMFReader::ReadEnhWMF() bFlag = false; - SAL_INFO ("vcl.emf", "0x" << std::hex << (nNextPos - nRecSize) << "-0x" << nNextPos << " record type: " << std::dec << nRecType << " size: " << nRecSize << std::dec); + SAL_INFO ("vcl.emf", "0x" << std::hex << (nNextPos - nRecSize) << "-0x" << nNextPos << " " << record_type_name(nRecType) << " size: " << nRecSize << std::dec); if( bEnableEMFPlus && nRecType == EMR_GDICOMMENT ) { sal_uInt32 length; commit 388e2d5224cf8d0a3820bf02602165f5caf36431 Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 19:13:25 2014 +0300 Use CG_TRACE consistently Change-Id: Icff6aa906b0c470afdc4c632896fa5087eeeffb0 diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 4df173c..4848fd3 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -145,8 +145,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath, aCP1 += aHalfPointOfs; aCP2 += aHalfPointOfs; } - SAL_INFO( "vcl.cg", - "CGPathAddCurveToPoint(" << xPath << ",NULL," << aCP1.getX() << "," << aCP1.getY() << "," << + CG_TRACE( "CGPathAddCurveToPoint(" << xPath << ",NULL," << aCP1.getX() << "," << aCP1.getY() << "," << aCP2.getX() << "," << aCP2.getY() << "," << aPoint.getX() << "," << aPoint.getY() << ")" ); CGPathAddCurveToPoint( xPath, NULL, aCP1.getX(), aCP1.getY(), aCP2.getX(), aCP2.getY(), aPoint.getX(), aPoint.getY() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits