diff options
Diffstat (limited to 'include/vcl/virdev.hxx')
-rw-r--r-- | include/vcl/virdev.hxx | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 06121aca050a..f608b5797844 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -50,12 +50,12 @@ private: VclPtr<VirtualDevice> mpNext; sal_uInt16 mnBitCount; bool mbScreenComp; - DeviceFormat meFormat; - DeviceFormat meAlphaFormat; + const DeviceFormat meFormat; + const DeviceFormat meAlphaFormat; RefDevMode meRefDevMode; bool mbForceZeroExtleadBug; - SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ); + SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, const SystemGraphicsData *pData = nullptr ); SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase, sal_uInt8* pBuffer ); SAL_DLLPRIVATE bool ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, @@ -74,6 +74,24 @@ protected: virtual bool AcquireGraphics() const override; virtual void ReleaseGraphics( bool bRelease = true ) override; + /** Create a virtual device of size 1x1 + + @param pCompDev + The generated vdev will be compatible to this device. + If it's the nullptr, it uses Application::GetDefaultDevice(). + + @param eFormat + Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to + indicate: take default screen depth. Only DeviceFormat::BITMASK + is the other possibility to denote a binary mask. + + @param eAlphaFormat + Device format of the generated virtual device. Use DeviceFormat::DEFAULT here, to + indicate: take default screen depth. Only DeviceFormat::BITMASK + is the other possibility to denote a binary mask. + */ + explicit VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, DeviceFormat eAlphaFormat); + public: /** Create a virtual device of size 1x1 @@ -83,7 +101,8 @@ public: indicate: take default screen depth. Only DeviceFormat::BITMASK is the other possibility to denote a binary mask. */ - explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::DEFAULT); + explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::DEFAULT) + : VirtualDevice(nullptr, eFormat, DeviceFormat::NONE) {} /** Create a virtual device of size 1x1 @@ -95,8 +114,9 @@ public: indicate: take default screen depth. Only DeviceFormat::BITMASK is the other possibility to denote a binary mask. */ - explicit VirtualDevice(const OutputDevice& rCompDev, - DeviceFormat eFormat = DeviceFormat::DEFAULT); + explicit VirtualDevice(const OutputDevice& rCompDev, + DeviceFormat eFormat = DeviceFormat::DEFAULT) + : VirtualDevice(&rCompDev, eFormat, DeviceFormat::NONE) {} /** Create a virtual device of size 1x1 with alpha channel @@ -113,15 +133,16 @@ public: indicate: take default screen depth. Only DeviceFormat::BITMASK is the other possibility to denote a binary mask. */ - explicit VirtualDevice( const OutputDevice& rCompDev, - DeviceFormat eFormat, DeviceFormat eAlphaFormat); + explicit VirtualDevice(const OutputDevice& rCompDev, + DeviceFormat eFormat, DeviceFormat eAlphaFormat) + : VirtualDevice(&rCompDev, eFormat, eAlphaFormat) {} /** Create a virtual device using an existing system dependent device or graphics context Any rendering will happen directly on the context and not on any intermediate bitmap. Note: This might not be supported on all platforms ! - */ - explicit VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, - DeviceFormat eFormat); + */ + explicit VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, + DeviceFormat eFormat); virtual ~VirtualDevice() override; virtual void dispose() override; |