[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/primitive2d/glowprimitive2d.cxx | 24 - drawinglayer/source/primitive2d/shadowprimitive2d.cxx | 22 - drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 218 -- drawinglayer/source/processor2d/vclhelperbufferdevice.hxx | 75 drawinglayer/source/tools/converters.cxx | 127 ++-- include/drawinglayer/converters.hxx | 12 solenv/clang-format/excludelist |2 7 files changed, 395 insertions(+), 85 deletions(-) New commits: commit 7614859e5738cdf3789f3f99cc4379f2333e8870 Author: Armin Le Grand (allotropia) AuthorDate: Thu Sep 15 15:50:03 2022 +0200 Commit: Armin Le Grand CommitDate: Mon Sep 19 09:56:19 2022 +0200 Make impBufferDevice faster again When the Primitives for the Glow-Effects were added (modified ShadowPrimitive2D, SoftEdgePrimitive2D and GlowPrimitive2D) a modified version of impBufferDevice was created and used. That lowered the speed for drawing objects with transparence by about factor 2.5 and was unfortunately not only done for these Primitives, but for transprent objects in general. For the mentioned factor refer to: Patch to demonstrate former and now repaint differences https://gerrit.libreoffice.org/c/core/+/129301 After having reworked those Primitives to use another mechanism and being decomposed so they will work in all now and future renderers, it is possible to go back to that easier and faster method to render Transparency. For extended information, please take a look at the added comments, mainly in vclhelperbufferdevice.hxx Identified a still bad behaviour when objects use a TransparenceGradient. Corrected that and added (at this opportunity) a method 'createAlphaMask' along with 'convertToBitmapEx' which is now used in the GlowPrimitive2D & ShadowPrimitive2D which only need the AlphaMask to do their job anyways (I had commented there that thjis is possible before). That will be faster for visualizing those Primitives. Change-Id: Ieac880384de26960c2c4b8740a1dee1e15d7ac9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140022 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx b/drawinglayer/source/primitive2d/glowprimitive2d.cxx index 44a97c536fb2..956a6f94eb82 100644 --- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx @@ -155,24 +155,22 @@ void GlowPrimitive2D::create2DDecomposition( // limitation to be safe and not go runtime/memory havoc. Use a pretty small // limit due to this is glow functionality and will look good with bitmap scaling // anyways. The value of 250.000 square pixels below maybe adapted as needed. -// NOTE: This may be further optimized. Only the alpha channel is needed, so -// convertToBitmapEx may be split in tooling to have a version that only -// creates the alpha channel. Potential win is >50% for the alpha pixel -// creation step ('>' because alpha painting uses a ColorStack and thus -// often can used simplified rendering) const basegfx::B2DVector aDiscreteClippedSize(rViewInformation.getObjectToViewTransformation() * aClippedRange.getRange()); const sal_uInt32 nDiscreteClippedWidth(ceil(aDiscreteClippedSize.getX())); const sal_uInt32 nDiscreteClippedHeight(ceil(aDiscreteClippedSize.getY())); const geometry::ViewInformation2D aViewInformation2D; const sal_uInt32 nMaximumQuadraticPixels(25); -const BitmapEx aBitmapEx(::drawinglayer::convertToBitmapEx( + +// I have now added a helper that just creates the mask without having +// to render the content, use it, it's faster +const AlphaMask aAlpha(::drawinglayer::createAlphaMask( std::move(xEmbedSeq), aViewInformation2D, nDiscreteClippedWidth, nDiscreteClippedHeight, nMaximumQuadraticPixels)); -if (!aBitmapEx.IsEmpty()) +if (!aAlpha.IsEmpty()) { -const Size& rBitmapExSizePixel(aBitmapEx.GetSizePixel()); +const Size& rBitmapExSizePixel(aAlpha.GetSizePixel()); if (rBitmapExSizePixel.Width() > 0 && rBitmapExSizePixel.Height() > 0) { @@ -183,7 +181,7 @@ void GlowPrimitive2D::create2DDecomposition( if (static_cast(rBitmapExSizePixel.Width()) != nDiscreteClippedWidth || static_cast(rBitmapExSizePixel.Height()) != nDiscreteClippedHeight) { -// scale in X and Y should be the same (see fReduceFactor in convertToBitmapEx), +// scale in X and Y should be the same (see fReduceFactor in createAlphaMask), // so adapt numerically to a single scale value, they are integer
[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 746 -- include/drawinglayer/primitive2d/textlayoutdevice.hxx | 166 +--- solenv/clang-format/excludelist |2 3 files changed, 423 insertions(+), 491 deletions(-) New commits: commit 9f7999c6281293d01f143e899056d72496868345 Author: Tomaž Vajngerl AuthorDate: Sun Oct 18 21:55:51 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Nov 23 08:30:16 2020 +0100 remove textlayoutdevice.{hxx,cxx} from clang-format excludelist Change-Id: Ia80a0331246b4e25cdc3387c50bd97c6befc4ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106382 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 43afce5d0f1e..c842517b3e72 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -36,473 +36,423 @@ #include #include - // VDev RevDevice provider namespace { -class ImpTimedRefDev; +class ImpTimedRefDev; -//the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor -//or disposing of the default XComponentContext which causes the underlying -//OutputDevice to get released +//the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor +//or disposing of the default XComponentContext which causes the underlying +//OutputDevice to get released -//The ImpTimerRefDev itself, if the timeout ever gets hit, will call -//reset on the scoped_timed_RefDev to release the ImpTimerRefDev early -//if it's unused for a few minutes -class scoped_timed_RefDev : public comphelper::unique_disposing_ptr +//The ImpTimerRefDev itself, if the timeout ever gets hit, will call +//reset on the scoped_timed_RefDev to release the ImpTimerRefDev early +//if it's unused for a few minutes +class scoped_timed_RefDev : public comphelper::unique_disposing_ptr +{ +public: +scoped_timed_RefDev() +: comphelper::unique_disposing_ptr( + (css::uno::Reference( + ::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW))) { -public: -scoped_timed_RefDev() : comphelper::unique_disposing_ptr((css::uno::Reference(::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW))) -{ -} -}; +} +}; -class the_scoped_timed_RefDev : public rtl::Static {}; +class the_scoped_timed_RefDev : public rtl::Static +{ +}; -class ImpTimedRefDev : public Timer -{ -scoped_timed_RefDev&mrOwnerOfMe; -VclPtr mpVirDev; -sal_uInt32 mnUseCount; - -public: -explicit ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe); -virtual ~ImpTimedRefDev() override; -virtual void Invoke() override; - -VirtualDevice& acquireVirtualDevice(); -void releaseVirtualDevice(); -}; - -ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe) -: Timer( "drawinglayer ImpTimedRefDev destroy mpVirDev" ), -mrOwnerOfMe(rOwnerOfMe), -mpVirDev(nullptr), -mnUseCount(0) -{ -SetTimeout(3L * 60L * 1000L); // three minutes -Start(); -} +class ImpTimedRefDev : public Timer +{ +scoped_timed_RefDev& mrOwnerOfMe; +VclPtr mpVirDev; +sal_uInt32 mnUseCount; + +public: +explicit ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe); +virtual ~ImpTimedRefDev() override; +virtual void Invoke() override; + +VirtualDevice& acquireVirtualDevice(); +void releaseVirtualDevice(); +}; + +ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe) +: Timer("drawinglayer ImpTimedRefDev destroy mpVirDev") +, mrOwnerOfMe(rOwnerOfMe) +, mpVirDev(nullptr) +, mnUseCount(0) +{ +SetTimeout(3L * 60L * 1000L); // three minutes +Start(); +} -ImpTimedRefDev::~ImpTimedRefDev() -{ -OSL_ENSURE(0 == mnUseCount, "destruction of a still used ImpTimedRefDev (!)"); -const SolarMutexGuard aSolarGuard; -mpVirDev.disposeAndClear(); -} +ImpTimedRefDev::~ImpTimedRefDev() +{ +OSL_ENSURE(0 == mnUseCount, "destruction of a still used ImpTimedRefDev (!)"); +const SolarMutexGuard aSolarGuard; +mpVirDev.disposeAndClear(); +} + +void ImpTimedRefDev::Invoke() +{ +// for obvious reasons, do not call anything after this +mrOwnerOfMe.reset(); +} -void ImpTimedRefDev::Invoke() +VirtualDevice& ImpTimedRefDev::acquireVirtualDevice() +{ +if (!mpVirDev) { -// for obvious reasons, do not call anything after this -mrOwnerOfMe.reset(); +mpVirDev = VclPtr::Create(); +mpVirDev->SetReferenceDevice(VirtualDevice::RefDevMode::MSO1); } -VirtualDevice& ImpTimedRefDev::acquireVirtualDevice() +if (!mnUseCount) { -
[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx | 931 ++-- include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx | 729 - solenv/clang-format/blacklist |2 3 files changed, 838 insertions(+), 824 deletions(-) New commits: commit ab931bf1148123ac262633f195efebb7babf9ce1 Author: Tomaž Vajngerl AuthorDate: Wed Apr 1 13:05:16 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Apr 3 16:08:37 2020 +0200 remove polypolygonprimitive2d.{hxx,cxx} from clang-format blacklist Change-Id: I3be7b8668dbf93a3a14b7b136dbe6057bfaf2f92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91495 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx index 1a521ab65243..959ae69a2159 100644 --- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx @@ -31,531 +31,534 @@ #include #include - using namespace com::sun::star; - namespace drawinglayer::primitive2d { -void PolyPolygonHairlinePrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const -{ -const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); -const sal_uInt32 nCount(aPolyPolygon.count()); - -if(nCount) -{ -for(sal_uInt32 a(0); a < nCount; a++) -{ -rContainer.push_back(new PolygonHairlinePrimitive2D(aPolyPolygon.getB2DPolygon(a), getBColor())); -} -} -} - -PolyPolygonHairlinePrimitive2D::PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor) -: BufferedDecompositionPrimitive2D(), -maPolyPolygon(rPolyPolygon), -maBColor(rBColor) -{ -} - -bool PolyPolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const -{ -if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) -{ -const PolyPolygonHairlinePrimitive2D& rCompare = static_cast(rPrimitive); - -return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon() -&& getBColor() == rCompare.getBColor()); -} - -return false; -} +void PolyPolygonHairlinePrimitive2D::create2DDecomposition( +Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const +{ +const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); +const sal_uInt32 nCount(aPolyPolygon.count()); -basegfx::B2DRange PolyPolygonHairlinePrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const +if (nCount) +{ +for (sal_uInt32 a(0); a < nCount; a++) { -// return range -return basegfx::utils::getRange(getB2DPolyPolygon()); +rContainer.push_back( +new PolygonHairlinePrimitive2D(aPolyPolygon.getB2DPolygon(a), getBColor())); } +} +} + +PolyPolygonHairlinePrimitive2D::PolyPolygonHairlinePrimitive2D( +const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor) +: BufferedDecompositionPrimitive2D() +, maPolyPolygon(rPolyPolygon) +, maBColor(rBColor) +{ +} -// provide unique ID -sal_uInt32 PolyPolygonHairlinePrimitive2D::getPrimitive2DID() const { return PRIMITIVE2D_ID_POLYPOLYGONHAIRLINEPRIMITIVE2D; } - -void PolyPolygonMarkerPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const -{ -const basegfx::B2DPolyPolygon aPolyPolygon(getB2DPolyPolygon()); -const sal_uInt32 nCount(aPolyPolygon.count()); +bool PolyPolygonHairlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const +{ +if (BufferedDecompositionPrimitive2D::operator==(rPrimitive)) +{ +const PolyPolygonHairlinePrimitive2D& rCompare += static_cast(rPrimitive); -if(nCount) -{ -for(sal_uInt32 a(0); a < nCount; a++) -{ -rContainer.push_back( -new PolygonMarkerPrimitive2D( -aPolyPolygon.getB2DPolygon(a), -getRGBColorA(), -getRGBColorB(), -getDiscreteDashLength())); -} -} -} +return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon() +&& getBColor() == rCompare.getBColor()); +} -PolyPolygonMarkerPrimitive2D::PolyPolygonMarkerPrimitive2D( -const
[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/geometry/viewinformation2d.cxx | 705 +--- include/drawinglayer/geometry/viewinformation2d.hxx | 289 solenv/clang-format/blacklist |2 3 files changed, 490 insertions(+), 506 deletions(-) New commits: commit 9d1f294bb889c7fe4a3bd1771509dd8d7f4dfc11 Author: Tomaž Vajngerl AuthorDate: Sat Mar 7 10:37:36 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Sat Mar 7 14:40:01 2020 +0100 remove viewinformation2d.{cxx,hxx} from clang-format blacklist Change-Id: I48db10a10157db11cc4de6b9ec4b66e6d3e3c444 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90148 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx index acc076c4e846..d06e9d596f2d 100644 --- a/drawinglayer/source/geometry/viewinformation2d.cxx +++ b/drawinglayer/source/geometry/viewinformation2d.cxx @@ -28,452 +28,423 @@ #include #include - using namespace com::sun::star; - namespace drawinglayer::geometry { - namespace { -constexpr OUStringLiteral g_PropertyName_ObjectTransformation ="ObjectTransformation"; -constexpr OUStringLiteral g_PropertyName_ViewTransformation ="ViewTransformation"; -constexpr OUStringLiteral g_PropertyName_Viewport ="Viewport"; -constexpr OUStringLiteral g_PropertyName_Time ="Time"; -constexpr OUStringLiteral g_PropertyName_VisualizedPage = "VisualizedPage"; -constexpr OUStringLiteral g_PropertyName_ReducedDisplayQuality = "ReducedDisplayQuality"; +constexpr OUStringLiteral g_PropertyName_ObjectTransformation = "ObjectTransformation"; +constexpr OUStringLiteral g_PropertyName_ViewTransformation = "ViewTransformation"; +constexpr OUStringLiteral g_PropertyName_Viewport = "Viewport"; +constexpr OUStringLiteral g_PropertyName_Time = "Time"; +constexpr OUStringLiteral g_PropertyName_VisualizedPage = "VisualizedPage"; +constexpr OUStringLiteral g_PropertyName_ReducedDisplayQuality = "ReducedDisplayQuality"; } -class ImpViewInformation2D -{ -private: -// ViewInformation2D implementation can change refcount, so we have only -// two memory regions for pairs of ViewInformation2D/ImpViewInformation2D -friend class ::drawinglayer::geometry::ViewInformation2D; +class ImpViewInformation2D +{ +private: +// ViewInformation2D implementation can change refcount, so we have only +// two memory regions for pairs of ViewInformation2D/ImpViewInformation2D +friend class ::drawinglayer::geometry::ViewInformation2D; -protected: -// the object transformation -basegfx::B2DHomMatrix maObjectTransformation; +protected: +// the object transformation +basegfx::B2DHomMatrix maObjectTransformation; -// the view transformation -basegfx::B2DHomMatrix maViewTransformation; +// the view transformation +basegfx::B2DHomMatrix maViewTransformation; -// the ObjectToView and it's inverse, both on demand from ObjectTransformation -// and ViewTransformation -basegfx::B2DHomMatrix maObjectToViewTransformation; -basegfx::B2DHomMatrix maInverseObjectToViewTransformation; +// the ObjectToView and it's inverse, both on demand from ObjectTransformation +// and ViewTransformation +basegfx::B2DHomMatrix maObjectToViewTransformation; +basegfx::B2DHomMatrix maInverseObjectToViewTransformation; -// the visible range and the on-demand one in ViewCoordinates -basegfx::B2DRange maViewport; -basegfx::B2DRange maDiscreteViewport; +// the visible range and the on-demand one in ViewCoordinates +basegfx::B2DRange maViewport; +basegfx::B2DRange maDiscreteViewport; -// the DrawPage which is target of visualisation. This is needed e.g. for -// the view-dependent decomposition of PageNumber TextFields. -// This parameter is buffered here, but mainly resides in mxExtendedInformation, -// so it will be interpreted, but held there. It will also not be added -// to mxExtendedInformation in impFillViewInformationFromContent (it's there already) -uno::Reference< drawing::XDrawPage >mxVisualizedPage; +// the DrawPage which is target of visualisation. This is needed e.g. for +// the view-dependent decomposition of PageNumber TextFields. +// This parameter is buffered here, but mainly resides in mxExtendedInformation, +// so it will be interpreted, but held there. It will also not be added +// to mxExtendedInformation in impFillViewInformationFromContent (it's there already) +uno::Reference
[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/primitive2d/bitmapprimitive2d.cxx | 59 +++-- include/drawinglayer/primitive2d/bitmapprimitive2d.hxx | 18 ++--- solenv/clang-format/blacklist |2 3 files changed, 35 insertions(+), 44 deletions(-) New commits: commit a334f77792dfff92e3c97f7f61f59d01fc9338cf Author: Tomaž Vajngerl AuthorDate: Sun Feb 2 21:58:04 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Mon Feb 3 23:23:49 2020 +0100 remove bitmapprimitive2d.{cxx,hxx} from clang-format blacklist Change-Id: I9d9d7cd8bba489c71a5c1ac0b23755d572696e10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87904 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx index 4da17e185260..1953a36a71ac 100644 --- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx @@ -20,48 +20,43 @@ #include #include - using namespace com::sun::star; - namespace drawinglayer::primitive2d { -BitmapPrimitive2D::BitmapPrimitive2D( -const BitmapEx& rBitmapEx, -const basegfx::B2DHomMatrix& rTransform) -: BasePrimitive2D(), -maBitmapEx(rBitmapEx), -maTransform(rTransform) -{ -} +BitmapPrimitive2D::BitmapPrimitive2D(const BitmapEx& rBitmapEx, + const basegfx::B2DHomMatrix& rTransform) +: BasePrimitive2D() +, maBitmapEx(rBitmapEx) +, maTransform(rTransform) +{ +} -bool BitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const -{ -if(BasePrimitive2D::operator==(rPrimitive)) -{ -const BitmapPrimitive2D& rCompare = static_cast(rPrimitive); +bool BitmapPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const +{ +if (BasePrimitive2D::operator==(rPrimitive)) +{ +const BitmapPrimitive2D& rCompare = static_cast(rPrimitive); -return (getBitmapEx() == rCompare.getBitmapEx() -&& getTransform() == rCompare.getTransform()); -} +return (getBitmapEx() == rCompare.getBitmapEx() +&& getTransform() == rCompare.getTransform()); +} -return false; -} +return false; +} -basegfx::B2DRange BitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const -{ -basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); -aRetval.transform(maTransform); -return aRetval; -} +basegfx::B2DRange +BitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const +{ +basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); +aRetval.transform(maTransform); +return aRetval; +} -sal_Int64 SAL_CALL BitmapPrimitive2D::estimateUsage() -{ -return getBitmapEx().GetSizeBytes(); -} +sal_Int64 SAL_CALL BitmapPrimitive2D::estimateUsage() { return getBitmapEx().GetSizeBytes(); } -// provide unique ID -ImplPrimitive2DIDBlock(BitmapPrimitive2D, PRIMITIVE2D_ID_BITMAPPRIMITIVE2D) +// provide unique ID +ImplPrimitive2DIDBlock(BitmapPrimitive2D, PRIMITIVE2D_ID_BITMAPPRIMITIVE2D) } // end of namespace diff --git a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx index 41d76e6549ba..747e9e571c21 100644 --- a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx @@ -28,7 +28,6 @@ namespace drawinglayer::primitive2d { - /** BitmapPrimitive2D class This class is the central primitive for Bitmap-based primitives. @@ -40,18 +39,16 @@ class DRAWINGLAYER_DLLPUBLIC BitmapPrimitive2D final : public BasePrimitive2D { private: /// the RGBA Bitmap-data -BitmapExmaBitmapEx; +BitmapEx maBitmapEx; /** the object transformation from unit coordinates, defining size, shear, rotate and position */ -basegfx::B2DHomMatrix maTransform; +basegfx::B2DHomMatrix maTransform; public: /// constructor -BitmapPrimitive2D( -const BitmapEx& rBitmapEx, -const basegfx::B2DHomMatrix& rTransform); +BitmapPrimitive2D(const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform); /// data read access const BitmapEx& getBitmapEx() const { return maBitmapEx; } @@ -61,13 +58,14 @@ public: virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; /// get range -virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; - -/// provide unique ID -DeclPrimitive2DIDBlock() +virtual basegfx::B2DRange +getB2DRange(const
[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer solenv/clang-format
drawinglayer/source/primitive2d/baseprimitive2d.cxx | 666 ++- include/drawinglayer/primitive2d/baseprimitive2d.hxx | 540 --- solenv/clang-format/blacklist|2 3 files changed, 664 insertions(+), 544 deletions(-) New commits: commit a3569c7b89a7ddee06149ece91ce608b1252fa82 Author: Tomaž Vajngerl AuthorDate: Tue Dec 31 13:39:33 2019 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jan 1 20:58:56 2020 +0100 drawinglayer: clang-format BasePrimitive2D + remove from blacklist No functional change was made, only formatting of the code. The code was formatted with clang-format and moves the files baseprimitve2d.{cxx,hxx} out of blacklist so it will be auto formatted with every change from now on. Change-Id: If49ec94f91e58825f7aa94dc54cff8374467aa30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86078 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx index 4db80991dd93..72b0f33734ee 100644 --- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx @@ -28,349 +28,433 @@ #include #include - using namespace com::sun::star; - namespace drawinglayer { -namespace primitive2d -{ -Primitive2DDecompositionVisitor::~Primitive2DDecompositionVisitor() {} - -BasePrimitive2D::BasePrimitive2D() -: BasePrimitive2DImplBase(m_aMutex) -{ -} - -BasePrimitive2D::~BasePrimitive2D() -{ -} - -bool BasePrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const -{ -return (getPrimitive2DID() == rPrimitive.getPrimitive2DID()); -} +namespace primitive2d +{ +Primitive2DDecompositionVisitor::~Primitive2DDecompositionVisitor() {} -namespace { - -// Visitor class to get the B2D range from a tree of Primitive2DReference's -// -class B2DRangeVisitor : public Primitive2DDecompositionVisitor { -public: -const geometry::ViewInformation2D& mrViewInformation; -basegfx::B2DRange maRetval; -B2DRangeVisitor(const geometry::ViewInformation2D& rViewInformation) : mrViewInformation(rViewInformation) {} -virtual void append(const Primitive2DReference& r) override { -maRetval.expand(getB2DRangeFromPrimitive2DReference(r, mrViewInformation)); -} -virtual void append(const Primitive2DContainer& r) override { -maRetval.expand(r.getB2DRange(mrViewInformation)); -} -virtual void append(Primitive2DContainer&& r) override { -maRetval.expand(r.getB2DRange(mrViewInformation)); -} -}; +BasePrimitive2D::BasePrimitive2D() +: BasePrimitive2DImplBase(m_aMutex) +{ +} -} +BasePrimitive2D::~BasePrimitive2D() {} -basegfx::B2DRange BasePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const -{ -B2DRangeVisitor aVisitor(rViewInformation); -get2DDecomposition(aVisitor, rViewInformation); -return aVisitor.maRetval; -} +bool BasePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const +{ +return (getPrimitive2DID() == rPrimitive.getPrimitive2DID()); +} -void BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVisitor*/, const geometry::ViewInformation2D& /*rViewInformation*/) const -{ -} +namespace +{ +// Visitor class to get the B2D range from a tree of Primitive2DReference's +// +class B2DRangeVisitor : public Primitive2DDecompositionVisitor +{ +public: +const geometry::ViewInformation2D& mrViewInformation; +basegfx::B2DRange maRetval; +B2DRangeVisitor(const geometry::ViewInformation2D& rViewInformation) +: mrViewInformation(rViewInformation) +{ +} +virtual void append(const Primitive2DReference& r) override +{ +maRetval.expand(getB2DRangeFromPrimitive2DReference(r, mrViewInformation)); +} +virtual void append(const Primitive2DContainer& r) override +{ +maRetval.expand(r.getB2DRange(mrViewInformation)); +} +virtual void append(Primitive2DContainer&& r) override +{ +maRetval.expand(r.getB2DRange(mrViewInformation)); +} +}; +} -css::uno::Sequence< ::css::uno::Reference< ::css::graphic::XPrimitive2D > > SAL_CALL BasePrimitive2D::getDecomposition( const uno::Sequence< beans::PropertyValue >& rViewParameters ) -{ -const geometry::ViewInformation2D aViewInformation(rViewParameters); -Primitive2DContainer aContainer; -get2DDecomposition(aContainer, aViewInformation); -return