diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2020-05-11 07:28:22 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-05-14 10:13:23 +0200 |
commit | 6da4777b647157aa7ed65e271778bb00373098a0 (patch) | |
tree | 9e4dff150a54a0a8c1526fcbfcde49099aacf911 /include | |
parent | 879d293d2f7734d7de51e57532743a24a3dd322d (diff) |
vcl: move transparency checks into MetaAction and GDIMetaFile
I want to remove the final bits of meOutDevType but need to refactor
the function OutputDevice::RemoveTransparenciesFromMetaFile(). This
is the start.
Change-Id: I7c5330540fb396f033b40831b24028c7bfec4832
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93940
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/gdimtf.hxx | 2 | ||||
-rw-r--r-- | include/vcl/metaact.hxx | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index 661caf863a22..3727f6531eff 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -118,6 +118,8 @@ public: void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); void Clip( const tools::Rectangle& ); + bool HasTransparentActions() const; + /* get the bound rect of the contained actions * caveats: * - clip actions will limit the contained actions, diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 92592bd209dc..fad89ec4b838 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -88,6 +88,10 @@ public: virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); MetaActionType GetType() const { return mnType; } + /** \#i10613# Extracted from Printer::GetPreparedMetaFile. Returns true + if given action requires special transparency handling + */ + virtual bool IsTransparent() const { return false; } public: static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData ); @@ -768,6 +772,7 @@ public: const BitmapEx& GetBitmapEx() const { return maBmpEx; } const Point& GetPoint() const { return maPt; } + bool IsTransparent() const override { return GetBitmapEx().IsTransparent(); } }; class VCL_DLLPUBLIC MetaBmpExScaleAction final : public MetaAction @@ -801,6 +806,7 @@ public: const BitmapEx& GetBitmapEx() const { return maBmpEx; } const Point& GetPoint() const { return maPt; } const Size& GetSize() const { return maSz; } + bool IsTransparent() const override { return GetBitmapEx().IsTransparent(); } }; class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaBmpExScalePartAction final : public MetaAction @@ -839,6 +845,7 @@ public: const Size& GetDestSize() const { return maDstSz; } const Point& GetSrcPoint() const { return maSrcPt; } const Size& GetSrcSize() const { return maSrcSz; } + bool IsTransparent() const override { return GetBitmapEx().IsTransparent(); } }; class SAL_DLLPUBLIC_RTTI MetaMaskAction final : public MetaAction @@ -1523,6 +1530,8 @@ public: const tools::PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } sal_uInt16 GetTransparence() const { return mnTransPercent; } + + bool IsTransparent() const override { return true; } }; class SAL_DLLPUBLIC_RTTI MetaFloatTransparentAction final : public MetaAction @@ -1558,6 +1567,7 @@ public: const Point& GetPoint() const { return maPoint; } const Size& GetSize() const { return maSize; } const Gradient& GetGradient() const { return maGradient; } + bool IsTransparent() const override { return true; } }; class VCL_DLLPUBLIC MetaEPSAction final : public MetaAction |