diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-17 13:03:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-23 14:25:59 +0000 |
commit | c43a3a58677b467274ce6c21d7db1a6c0cc65cb4 (patch) | |
tree | 3bb61dc498bd5ff72df4be4e0003ab284b0cc655 /include | |
parent | b0f5416d7ee7c988d316df7ffa0318fa6514e4de (diff) |
establish that Virtual Devices either match Physical Device depth or ...
are 1 or (rarely) 8 bit and lock that down.
Change-Id: I3d946ebef34ffb71c5adea7aa420af50e9584e05
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/salgtype.hxx | 2 | ||||
-rw-r--r-- | include/vcl/virdev.hxx | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx index 8a340099a11d..59654f6595d5 100644 --- a/include/vcl/salgtype.hxx +++ b/include/vcl/salgtype.hxx @@ -22,6 +22,8 @@ #include <sal/types.h> +enum class DeviceFormat { NONE = -1, FULLCOLOR = 0, BITMASK = 1, GRAYSCALE = 8 }; + typedef sal_uInt32 SalColor; #define MAKE_SALCOLOR( r, g, b ) ((SalColor)(((sal_uInt32)((sal_uInt8)(b))))|(((sal_uInt32)((sal_uInt8)(g)))<<8)|(((sal_uInt32)((sal_uInt8)(r)))<<16)) #define SALCOLOR_RED( n ) ((sal_uInt8)((n)>>16)) diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 740b9bf7db24..76076ba657fd 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -22,6 +22,7 @@ #include <basebmp/bitmapdevice.hxx> #include <vcl/dllapi.h> +#include <vcl/salgtype.hxx> #include <vcl/outdev.hxx> class SalVirtualDevice; @@ -39,10 +40,11 @@ private: VclPtr<VirtualDevice> mpNext; sal_uInt16 mnBitCount; bool mbScreenComp; - sal_Int8 mnAlphaDepth; + DeviceFormat meFormat; + DeviceFormat meAlphaFormat; sal_uInt8 meRefDevMode; - SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = nullptr ); + SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, long nDX, long nDY, DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ); SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer ); SAL_DLLPRIVATE bool ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, @@ -76,7 +78,7 @@ public: indicate: take default screen depth. Only 0, 1 and 8 are allowed here, with 1 denoting binary mask and 8 a graylevel mask. */ - explicit VirtualDevice( sal_uInt16 nBitCount = 0 ); + explicit VirtualDevice(DeviceFormat eFormat = DeviceFormat::FULLCOLOR); /** Create a virtual device of size 1x1 @@ -87,8 +89,8 @@ public: Bit depth of the generated virtual device. Use 0 here, to indicate: take default screen depth. */ - explicit VirtualDevice( const OutputDevice& rCompDev, - sal_uInt16 nBitCount = 0 ); + explicit VirtualDevice(const OutputDevice& rCompDev, + DeviceFormat eFormat = DeviceFormat::FULLCOLOR); /** Create a virtual device of size 1x1 with alpha channel @@ -106,14 +108,14 @@ public: are allowed here, with 1 denoting binary mask. */ explicit VirtualDevice( const OutputDevice& rCompDev, - sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount ); + DeviceFormat eFormat, DeviceFormat 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, - sal_uInt16 nBitCount); + DeviceFormat eFormat); virtual ~VirtualDevice(); virtual void dispose() override; |