summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-08-30 14:14:50 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-08-30 15:26:55 +0200
commit28223ab9198e693a1cb4e344f14f8f5d5fbf127a (patch)
treef1ab33e3e5b09859e82100375d67f6c6d13d14bd /drawinglayer
parent9ddbae9c65e795e9122c43eea0b4fa3a4d118939 (diff)
Unify the two places dumping bimaps for debugging
Using the environment variable allows me to use a directory where no "access denied" happens on write access. Change-Id: Iffdd9b8566f2d794a6741b71d736d14d4643576c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139033 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx24
1 files changed, 8 insertions, 16 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 4a29344023b1..a0807e83f72b 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -359,15 +359,12 @@ void impBufferDevice::paint(double fTrans)
mpContent->EnableMapMode(false);
#ifdef DBG_UTIL
- if (bDoSaveForVisualControl)
+ // VCL_DUMP_BMP_PATH should be like C:/path/ or ~/path/
+ static const OUString sDumpPath(OUString::createFromAscii(std::getenv("VCL_DUMP_BMP_PATH")));
+
+ if (!sDumpPath.isEmpty() && bDoSaveForVisualControl)
{
- SvFileStream aNew(
-#ifdef _WIN32
- "c:\\content.bmp",
-#else
- "~/content.bmp",
-#endif
- StreamMode::WRITE | StreamMode::TRUNC);
+ SvFileStream aNew(sDumpPath + "content.bmp", StreamMode::WRITE | StreamMode::TRUNC);
Bitmap aContent(mpContent->GetBitmap(aEmptyPoint, aSizePixel));
WriteDIB(aContent, aNew, false, true);
}
@@ -383,15 +380,10 @@ void impBufferDevice::paint(double fTrans)
AlphaMask aAlphaMask(mpAlpha->GetBitmap(aEmptyPoint, aSizePixel));
#ifdef DBG_UTIL
- if (bDoSaveForVisualControl)
+ if (!sDumpPath.isEmpty() && bDoSaveForVisualControl)
{
- SvFileStream aNew(
-#ifdef _WIN32
- "c:\\transparence.bmp",
-#else
- "~/transparence.bmp",
-#endif
- StreamMode::WRITE | StreamMode::TRUNC);
+ SvFileStream aNew(sDumpPath + "transparence.bmp",
+ StreamMode::WRITE | StreamMode::TRUNC);
WriteDIB(aAlphaMask.GetBitmap(), aNew, false, true);
}
#endif