diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-10-05 17:38:22 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-10-05 20:21:05 +0300 |
commit | 528057887e92b46e26d91639d82e2b15a747ccad (patch) | |
tree | 474c414b185ab1cd7e31ab08e43f5653effd47f3 /vcl/quartz | |
parent | 5b37c499986aab625c9eaaeb742ae492ba5b6c37 (diff) |
SAL_WRN and SAL_INFO tweaks
Also add an assertion and some verbose debug output (in #if 0).
Change-Id: If4907a682ee7359d71078f72ca2f483c80fc4a58
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salgdi.cxx | 38 | ||||
-rw-r--r-- | vcl/quartz/salvd.cxx | 2 |
2 files changed, 38 insertions, 2 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 36569d626d3b..b9cdd2c5195a 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -396,7 +396,7 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) #ifdef IOS if (!CheckContext()) { - SAL_WARN("vcl.cg", "AquaSalGraphics::DrawTextLayout() without context"); + SAL_WARN("vcl.quartz", "AquaSalGraphics::DrawTextLayout() without context"); return; } #endif @@ -404,7 +404,10 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) const CoreTextStyle& rStyle = *static_cast<const CoreTextStyle*>(&rLayout.GetFont()); const FontSelectPattern& rFontSelect = rStyle.GetFontSelectPattern(); if (rFontSelect.mnHeight == 0) + { + SAL_WARN("vcl.quartz", "AquaSalGraphics::DrawTextLayout(): rFontSelect.mnHeight is zero!?"); return; + } CTFontRef pFont = static_cast<CTFontRef>(CFDictionaryGetValue(rStyle.GetStyleDict(), kCTFontAttributeName)); CGAffineTransform aRotMatrix = CGAffineTransformMakeRotation(-rStyle.mfFontRotation); @@ -443,13 +446,39 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) } if (aGlyphIds.empty()) + { + SAL_WARN("vcl.quartz", "aGlyphIds is empty!?"); return; + } + + assert(aGlyphIds.size() == aGlyphPos.size()); +#if 0 + std::cerr << "aGlyphIds:["; + for (unsigned i = 0; i < aGlyphIds.size(); i++) + { + if (i > 0) + std::cerr << ","; + std::cerr << aGlyphIds[i]; + } + std::cerr << "]\n"; + std::cerr << "aGlyphPos:["; + for (unsigned i = 0; i < aGlyphPos.size(); i++) + { + if (i > 0) + std::cerr << ","; + std::cerr << aGlyphPos[i]; + } + std::cerr << "]\n"; +#endif + SAL_INFO("vcl.cg", "CGContextSaveGState(" << mrContext << ") " << ++mnContextStackDepth ); CGContextSaveGState(mrContext); // The view is vertically flipped (no idea why), flip it back. + SAL_INFO("vcl.cg", "CGContextScaleCTM(" << mrContext << ",1,-1)"); CGContextScaleCTM(mrContext, 1.0, -1.0); CGContextSetShouldAntialias(mrContext, !mbNonAntialiasedText); + SAL_INFO("vcl.cg", "CGContextSetFillColor(" << mrContext << "," << maTextColor << ")"); CGContextSetFillColor(mrContext, maTextColor.AsArray()); auto aIt = aGlyphOrientation.cbegin(); @@ -462,15 +491,22 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) size_t nStartIndex = std::distance(aGlyphOrientation.cbegin(), aIt); size_t nLen = std::distance(aIt, aNext); + SAL_INFO("vcl.cg", "CGContextSaveGState(" << mrContext << ") " << ++mnContextStackDepth ); CGContextSaveGState(mrContext); if (rStyle.mfFontRotation && !bUprightGlyph) + { + SAL_INFO("vcl.cg", "CGContextRotateCTM(" << mrContext << "," << rStyle.mfFontRotation << ")"); CGContextRotateCTM(mrContext, rStyle.mfFontRotation); + } + SAL_INFO("vcl.cg", "CTFontDrawGlyphs() @" << nStartIndex << ":" << nLen << "," << mrContext); CTFontDrawGlyphs(pFont, &aGlyphIds[nStartIndex], &aGlyphPos[nStartIndex], nLen, mrContext); + SAL_INFO("vcl.cg", "CGContextRestoreGState(" << mrContext << ") " << mnContextStackDepth-- ); CGContextRestoreGState(mrContext); aIt = aNext; } + SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << mrContext << ") " << mnContextStackDepth-- ); CGContextRestoreGState(mrContext); } diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx index 7b3c68155ffe..77fee8f13d8a 100644 --- a/vcl/quartz/salvd.cxx +++ b/vcl/quartz/salvd.cxx @@ -208,7 +208,7 @@ void AquaSalVirtualDevice::ReleaseGraphics( SalGraphics* ) bool AquaSalVirtualDevice::SetSize( long nDX, long nDY ) { SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::SetSize() this=" << this << - " (" << nDX << "x" << nDY << ") mbForeignContext=" << mbForeignContext ); + " (" << nDX << "x" << nDY << ") mbForeignContext=" << (mbForeignContext ? "YES" : "NO")); if( mbForeignContext ) { |