From 53603317af854a352e75fd2c5f0f0eeaacc5293c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 11 Jan 2023 20:17:58 +0100 Subject: vcl: introduce a BitmapEx::DumpAsPng() This is mostly useful for ad-hoc debugging, so you don't need to manually create an SvFileStream, a vcl::PngImageWriter & connect them, but you can step through code in the debugger and call DumpAsPng() at random code locations. The filename type is intentionally a 'const char*', so you can call DumpAsPng(0) from gdb; that would not be possible for a 'const OUString&' parameter type. Change-Id: I7e6c9bfe8410892969a1cbd1f827e2d62f409400 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145361 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/vcl/bitmapex.hxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 45f54d016a74..5838ef8d6e40 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -449,6 +449,8 @@ public: SAL_DLLPRIVATE std::shared_ptr const & ImplGetBitmapSalBitmap() const { return maBitmap.ImplGetSalBitmap(); } + /// Dumps the pixels as PNG in bitmap.png. + void DumpAsPng(const char* pFileName = nullptr) const; private: friend class ImpGraphic; -- cgit