summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2019-12-04 04:06:34 +1100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2019-12-14 21:04:28 +0100
commitfb24d11ff207d1127dcc16e9a3b5ead6b92c556d (patch)
treed244a6ab23efb7060b3098baa67b20360fed1cbb /drawinglayer
parent504d9e75f663497e7ba08ea4124c8a1b06d658ce (diff)
drawinglayer: improve logging for EmfPlusSetTextRenderingHint
Change-Id: I68a371c8465bf3b13e5626d9f5d59fea48414304 Reviewed-on: https://gerrit.libreoffice.org/84452 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx52
-rw-r--r--drawinglayer/source/tools/emfphelperdata.hxx10
2 files changed, 43 insertions, 19 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index f8bade29f9e6..72e7e9fa58ca 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -129,6 +129,20 @@ namespace emfplushelper
return "";
}
+ static OUString TextRenderingHintToString(sal_uInt16 nHint)
+ {
+ switch (nHint)
+ {
+ case TextRenderingHint::TextRenderingHintSystemDefault: return "TextRenderingHintSystemDefault";
+ case TextRenderingHint::TextRenderingHintSingleBitPerPixelGridFit: return "TextRenderingHintSingleBitPerPixelGridFit";
+ case TextRenderingHint::TextRenderingHintSingleBitPerPixel: return "TextRenderingHintSingleBitPerPixel";
+ case TextRenderingHint::TextRenderingHintAntialiasGridFit: return "TextRenderingHintAntialiasGridFit";
+ case TextRenderingHint::TextRenderingHintAntialias: return "TextRenderingHintAntialias";
+ case TextRenderingHint::TextRenderingHintClearTypeGridFit: return "TextRenderingHintClearTypeGridFit";
+ }
+ return "";
+ }
+
EMFPObject::~EMFPObject()
{
}
@@ -952,7 +966,10 @@ namespace emfplushelper
break;
}
- SAL_INFO("drawinglayer", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);
+ SAL_INFO("drawinglayer", "EMF+ " << emfTypeToName(type));
+ SAL_INFO("drawinglayer", "EMF+\t record size: " << size);
+ SAL_INFO("drawinglayer", "EMF+\t flags: 0x" << std::hex << flags << std::dec);
+ SAL_INFO("drawinglayer", "EMF+\t data size: " << dataSize);
if (bIsGetDCProcessing)
{
@@ -1536,7 +1553,6 @@ namespace emfplushelper
case EmfPlusRecordTypeSetPageTransform:
{
rMS.ReadFloat(mfPageScale);
- SAL_INFO("drawinglayer", "EMF+ SetPageTransform");
SAL_INFO("drawinglayer", "EMF+\tscale: " << mfPageScale << " unit: " << flags);
if ((flags == UnitTypeDisplay) || (flags == UnitTypeWorld))
@@ -1560,14 +1576,15 @@ namespace emfplushelper
}
case EmfPlusRecordTypeSetTextRenderingHint:
{
+ sal_uInt8 nTextRenderingHint = (flags & 0xFF) >> 1;
+ SAL_INFO("drawinglayer", "EMF+\t Text rendering hint: " << TextRenderingHintToString(nTextRenderingHint));
SAL_INFO("drawinglayer", "TODO\t EMF+ SetTextRenderingHint");
break;
}
case EmfPlusRecordTypeSetAntiAliasMode:
{
bool bUseAntiAlias = (flags & 0x0001);
- sal_uInt8 nSmoothingMode = ((flags & 0xFE00) >> 1);
- SAL_INFO("drawinglayer", "EMF+ EmfPlusRecordTypeSetAntiAliasMode");
+ sal_uInt8 nSmoothingMode = (flags & 0xFE00) >> 1;
SAL_INFO("drawinglayer", "EMF+\t Antialiasing: " << (bUseAntiAlias ? "enabled" : "disabled"));
SAL_INFO("drawinglayer", "EMF+\t Smoothing mode: " << SmoothingModeToString(nSmoothingMode));
SAL_INFO("drawinglayer", "TODO\t EMF+ SetAntiAliasMode");
@@ -1580,7 +1597,7 @@ namespace emfplushelper
}
case EmfPlusRecordTypeSetPixelOffsetMode:
{
- SAL_INFO("drawinglayer", "EMF+ SetPixelOffsetMode: " << PixelOffsetModeToString(flags));
+ SAL_INFO("drawinglayer", "EMF+\t Pixel offset mode: " << PixelOffsetModeToString(flags));
SAL_WARN("drawinglayer", "TODO\t EMF+ SetPixelOffsetMode");
break;
}
@@ -1593,7 +1610,7 @@ namespace emfplushelper
{
sal_uInt32 stackIndex;
rMS.ReadUInt32(stackIndex);
- SAL_INFO("drawinglayer", "EMF+ Save stack index: " << stackIndex);
+ SAL_INFO("drawinglayer", "EMF+\t Save stack index: " << stackIndex);
GraphicStatePush(mGSStack, stackIndex);
@@ -1603,7 +1620,7 @@ namespace emfplushelper
{
sal_uInt32 stackIndex;
rMS.ReadUInt32(stackIndex);
- SAL_INFO("drawinglayer", "EMF+ Restore stack index: " << stackIndex);
+ SAL_INFO("drawinglayer", "EMF+\t Restore stack index: " << stackIndex);
GraphicStatePop(mGSStack, stackIndex, mrPropertyHolders.Current());
break;
@@ -1612,7 +1629,7 @@ namespace emfplushelper
{
sal_uInt32 stackIndex;
rMS.ReadUInt32(stackIndex);
- SAL_INFO("drawinglayer", "EMF+ Begin Container No Params stack index: " << stackIndex);
+ SAL_INFO("drawinglayer", "EMF+\t Begin Container No Params stack index: " << stackIndex);
GraphicStatePush(mGSContainerStack, stackIndex);
break;
@@ -1621,32 +1638,29 @@ namespace emfplushelper
{
sal_uInt32 stackIndex;
rMS.ReadUInt32(stackIndex);
- SAL_INFO("drawinglayer", "EMF+ End Container stack index: " << stackIndex);
+ SAL_INFO("drawinglayer", "EMF+\t End Container stack index: " << stackIndex);
GraphicStatePop(mGSContainerStack, stackIndex, mrPropertyHolders.Current());
break;
}
case EmfPlusRecordTypeSetWorldTransform:
{
- SAL_INFO("drawinglayer", "EMF+ SetWorldTransform, Post multiply: " << bool(flags & 0x2000));
+ SAL_INFO("drawinglayer", "EMF+\t SetWorldTransform, Post multiply: " << bool(flags & 0x2000));
readXForm(rMS, maWorldTransform);
mappingChanged();
- SAL_INFO("drawinglayer", "EMF+\t: " << maWorldTransform);
+ SAL_INFO("drawinglayer", "EMF+\t\t: " << maWorldTransform);
break;
}
case EmfPlusRecordTypeResetWorldTransform:
{
- SAL_INFO("drawinglayer",
- "EMF+ ResetWorldTransform");
maWorldTransform.identity();
- SAL_INFO("drawinglayer",
- "EMF+\t: " << maWorldTransform);
+ SAL_INFO("drawinglayer", "EMF+\t: " << maWorldTransform);
mappingChanged();
break;
}
case EmfPlusRecordTypeMultiplyWorldTransform:
{
- SAL_INFO("drawinglayer", "EMF+ MultiplyWorldTransform, post multiply: " << bool(flags & 0x2000));
+ SAL_INFO("drawinglayer", "EMF+\t MultiplyWorldTransform, post multiply: " << bool(flags & 0x2000));
basegfx::B2DHomMatrix transform;
readXForm(rMS, transform);
@@ -1673,7 +1687,7 @@ namespace emfplushelper
}
case EmfPlusRecordTypeTranslateWorldTransform:
{
- SAL_INFO("drawinglayer", "EMF+ TranslateWorldTransform, Post multiply: " << bool(flags & 0x2000));
+ SAL_INFO("drawinglayer", "EMF+\t TranslateWorldTransform, Post multiply: " << bool(flags & 0x2000));
basegfx::B2DHomMatrix transform;
float eDx, eDy;
@@ -1710,7 +1724,7 @@ namespace emfplushelper
transform.set(0, 0, eSx);
transform.set(1, 1, eSy);
- SAL_INFO("drawinglayer", "EMF+ ScaleWorldTransform Sx: " << eSx <<
+ SAL_INFO("drawinglayer", "EMF+\t ScaleWorldTransform Sx: " << eSx <<
" Sy: " << eSy << ", Post multiply:" << bool(flags & 0x2000));
SAL_INFO("drawinglayer",
"EMF+\t World transform matrix: " << maWorldTransform);
@@ -1739,7 +1753,7 @@ namespace emfplushelper
float eAngle;
rMS.ReadFloat(eAngle);
- SAL_INFO("drawinglayer", "EMF+ RotateWorldTransform Angle: " << eAngle <<
+ SAL_INFO("drawinglayer", "EMF+\t RotateWorldTransform Angle: " << eAngle <<
", post multiply: " << bool(flags & 0x2000));
// Skipping flags & 0x2000
// For rotation transformation there is no difference between post and pre multiply
diff --git a/drawinglayer/source/tools/emfphelperdata.hxx b/drawinglayer/source/tools/emfphelperdata.hxx
index ba608ed38a2e..70fa70253380 100644
--- a/drawinglayer/source/tools/emfphelperdata.hxx
+++ b/drawinglayer/source/tools/emfphelperdata.hxx
@@ -122,6 +122,16 @@ namespace emfplushelper
SmoothingModeAntiAlias8x8 = 0x05
};
+ enum TextRenderingHint
+ {
+ TextRenderingHintSystemDefault = 0x00,
+ TextRenderingHintSingleBitPerPixelGridFit = 0x01,
+ TextRenderingHintSingleBitPerPixel = 0x02,
+ TextRenderingHintAntialiasGridFit = 0x03,
+ TextRenderingHintAntialias = 0x04,
+ TextRenderingHintClearTypeGridFit = 0x05
+ };
+
enum UnitType
{
UnitTypeWorld = 0x00,