summaryrefslogtreecommitdiff
path: root/drawinglayer/source
AgeCommit message (Collapse)Author
2022-01-14Recheck modules d* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I916f42c46efa1b6cfd7744a189b79659b2867431 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128196 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-12tdf#145538 - Use range based for loopsdtm
Change-Id: Ib16c742b39af62694ef591dcdaa975b9a720b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127203 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-01-08Optimise a range-based for loopRamreiso Kashung
This patch is an extension of https://gerrit.libreoffice.org/c/core/+/127734 related to comment made by Mike Kaganski Change-Id: Ia7a6480dba2a0752a52ae4f9655c345af9f3ba64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128134 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2022-01-03loplugin:unusedmethodsNoel Grandin
Change-Id: I922778e8ced0ad922d90a153b0eda47abbec94ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127868 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-30tdf#145538 : Using range-based for loopsRamreiso Kashung
Change-Id: I9674eff3e2572ffef7ee19af12befc8a9b6b1c06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127734 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2021-12-24new comphelper::WeakImplComponentHelperNoel Grandin
to replace the cppu:: equivalent with a lightweight version that uses std::mutex instead of osl::Mutex Change-Id: I1b7873a0c2d9cda21f529e43a4ac2fa7574c91a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127335 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-23Split BasePrimitive2D UNO interface into separate objectNoel Grandin
Rather than make all the BasePrimitive2D classes bear the cost of being an UNO object, we just wrap the top level BasePrimitive2D in this class when we need to pass them over UNO. This reduces the locking overhead when doing normal drawinglayer operations, and reduces the size of drawinglayer objects and the cost of initialising them, which shaves 5% off the load/display time of a large barchart. Add new drawinglayer::convertPrimitive2DContainerToBitmapEx utility method to avoid needing to convert to Sequence<XPrimitive2D> Change-Id: I553eaa4c16ba016b098cb21f6c55f5008f0d9b53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126487 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21loplugin:flatten in desktop..drawinglayerNoel Grandin
Change-Id: Ie6594c9961aba5517c6ff61fb3bc1142081b1197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-16Remove transitional header drawinglayer/primitive2d/polygonprimitive2d.hxxGabor Kelemen
follow up to commit 1103727fb24b368419ea0cfd2382560ef6b82f43 Change-Id: I227042f4703f3f4c18a8dc0355f044d2ad7dfb2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126838 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-15Recheck include/[a-d]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I42475b8e75951d5dcae2fe6b0ad0bca64441e7f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-04rename Primitive2DDecompositionVisitor methodsNoel Grandin
from "append" to "visit" The current naming comes from when I created this class as replacement for passing Primitive2DContainer around and the naming was meant to reduce code churn. But now that I'm using it more, the naming is an impediment to understanding the code. Change-Id: I4ee0156c7ffb534eac64f1c05eac6b8c67c25ab9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24tdf#145874: fix "Drop deg2rad/rad2deg conversions" for gradient export in a pdfJulien Nabet
Regression from: https://cgit.freedesktop.org/libreoffice/core/commit/?id=bc0ab08634f59e1a1814e575fe6ad5e50bf1aee1 Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversions Change-Id: I40089b166242d06e417b1877146d43df192d6225 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125791 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-11-23tdf#145538 Use range based for loops in EnhancedShapeDumper.cxxHarjot
Change-Id: I111f6c7ab5ab2033c08683a16adaf388eeabc9ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125577 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2021-11-23tdf#145538 Use range based for loopsHenrik Palomäki
* Used range based for loop in fillhatchprimitive2d.cxx + Goal: Better readability of the code Change-Id: Ie8ddaa9960e714b161ec530961b36a9935055ae0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125413 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2021-11-19Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversionsMike Kaganski
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-11-19Drop F_2PIMike Kaganski
Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19Use M_PI* instead of F_PI*Mike Kaganski
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-10Removed useless semicolonsAndrea Gelmini
Change-Id: I787150a7374ac116b3540788cbfa504ee0269a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124942 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-11-10osl::Mutex->std::mutex in TubeBufferNoel Grandin
Change-Id: I3e2ef9f8b34cbc5befe8b19fa2d68dfd518090c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-09rtl::Static to thread-safe staticNoel Grandin
Change-Id: Iff3489ee171cf2eaecbd1aad6f942a1468f76512 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124928 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-08extend XML dumpig for primitives to support fontwork objectsTomaž Vajngerl
This adds support for 3D drawinglayer primitive XML dumping and adds dumping support for many more primitives and attributes that were missing before. This is needed to be able to check the fontwork objects, which can be rendered in 3D. Change-Id: I0e78be4d4030a0cae3d2b952a1a38de8940ee310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124804 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-31crashtesting: failure on conversion of fdo74498-1.doc to pdfCaolán McNamara
noticable since... commit 894b4911ffb96ff667fdeb3aec7922316ab7230a Date: Thu Oct 28 09:27:29 2021 +0200 pass DX array around using o3tl::span instead of pointer but presumably a problem since... commit 793905906980e77a9853a8dd01fab95b65ca4f02 Date: Tue Sep 14 15:28:33 2010 +0200 filled-tab-editeng.diff: Filled tab wasn't filled in shapes n#564454 here I assume the right fix is to extend the DXArray (if non-empty) to match the new length using the value of the initial entry of the old DXArray Change-Id: I36a6040c2d05e108c7c6f9cdab9a33557036cd22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124528 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-31add o3tl::span ctor from std::vectorLuboš Luňák
Makes code simpler, and std::span can be constructed from std::vector too. Change-Id: Iae26b53c52148c19d9068a63126a7393d098d654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124507 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-10-30tools::Long->sal_Int32 in GetCaretPositionsNoel Grandin
Change-Id: Id3f037e132a4d07cb2b68dbb93dd24f7f6b33ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30tools::Long->sal_Int32 in the DX arraysNoel Grandin
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-29Prepare for removal of non-const operator[] from Sequence in drawinglayerMike Kaganski
Change-Id: I9cea42e100de6bb05a32edbf9611fbd05d91759e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124359 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29pass DX array around using o3tl::span instead of pointerNoel Grandin
so we get bounds checking in debug mode Note that I cannot just pass around the std::vectors involved because there is a place in editeng which calls with a subset of a vector. Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-27Move variable declaration to its use in if() conditionMike Kaganski
Helps understanding the condition more clearly. Change-Id: Ibb2b60283ea650bfac93621feb0333953cac8fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124188 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-19Use range based for loopsHossein
* Use range based for loops where it was possible in drawinglayer + Goal: Better readability of the code Change-Id: I188d27ce09c0d603e39d40ea63e91a8666e5d885 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123758 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-16Simplify vector initialization in drawinglayerJulien Nabet
Change-Id: Iee9c13149d3614ecd9f812cfbb85e4534c33c1be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123684 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-12loplugin:moveparam in variousNoel Grandin
Change-Id: Ifa7c8ff2b21f63d234c29c28303d0bacd376c1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-07Clean StringFormatFlags() in emfpstringformat.cxxHossein
* Fix: StringFormatDirectionVertical was missing, and another enum was used instead by mistake * Cleaned up StringFormatFlags() method + There was no need to check for each flag and add ", " + The method is only used for SAL_INFO + Just adding space in the end of each flag every time + Goal: Making code faster and also more readable Change-Id: I4be2d291611f2b5d3c8a4490a8b273d5a4511dfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123200 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-06loplugin:moveparam in drawinglayerNoel Grandin
Change-Id: I428116d96a011b061dda8376b6f27fb135a62964 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-03drop 'using namespace std' in drawinglayerJulien Nabet
Change-Id: I0221a05b82494971e9c557430dc2f8fe67e494ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123017 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-02new loplugin:moveparamNoel Grandin
Look for places where we can pass Primitive2DContainer by move reference and so avoid unnecessary copies. Change-Id: I1db167feba6d1a616ca6fc39778118ae20106bd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122964 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-01loplugin:constmethodNoel Grandin
Change-Id: I3ed657c5c5e6840e38e3c8505505b4b372125df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122910 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-26recursive_mutex -> mutex in BasePrimitive2DImplBaseNoel Grandin
Change-Id: I99e13b91afbf0d4d36b13e463fde2dec1c4d9e4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-24reduce copying in drawinglayerNoel Grandin
by passing PrimitiveContainer&& around. There are lots of place where we were preparing a local variable of type PrimitiveContainer, and then copying it someplace else, then throwing it away. Change-Id: Iacfd983640c9e55da25800ccc01734dfc8b4d64a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-23Related: tdf#144091 svx: fix interaction of transp cell fill and transp shadowMiklos Vajna
This is a follow-up to commit 37a52d30bbfcf1d073779b50139c4dafa507be4b (tdf#144091 svx: fix unwanted blur of shadow from table cell fill, 2021-09-20), where it turned out that the original bugdoc was just a special case of almost full transparency (80%), that's why avoiding the blur fixed the problem. A more general approach instead is to multiply the alpha or the cell fill of table shapes and the alpha of the shadow itself. The end result is the same (80% transparency) for the first bugdoc, but this gives back the blur on the second bugdoc. Change-Id: I63560e3a73473c70157ecee8365ec7154217f269 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122532 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-22reduce copying in BufferedDecompositionPrimitive2DNoel Grandin
Change-Id: I2393c45c064ea423b7ea1b70e1f16e1a4cea2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122419 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-21reduce cost of BasePrimitive2D (tdf#125892)Noel Grandin
the default WeakComponentImplHelper wants to allocate two child objects (osl::Mutex and BroadcastHelper). So use a custom re-implemenation that does not need to allocate any child objects. Change-Id: I288e58558398e39daa0d4b11e0b60a924445240d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122381 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-20tdf#144091 svx: fix unwanted blur of shadow from table cell fillMiklos Vajna
Initial render support for shadows of table shapes were added in commit a75bf43a8d6c5dec6dcc86908c142ceec541aa8c (tdf#129961 svx: add rendering for table shadow as direct format, 2020-12-02). That already noticed a trick with the shadow of table shapes: the shadow is generate from the cell fill and the border, but not from the text. An additional trick is that when blur is enabled for the table shape's shadow, then only the border should be blurred, not the cell fill. In the bug document's case, the effective cell background was gray, with a semi-transparent red shadow. We used to render cc0000 with blur and cccccc without blur, now we correctly render cca3a3, matching PowerPoint. Change-Id: I7326a5f6254cf19b2d05181084c78e734ff7a7b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122349 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák
Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-09-11clang:optin.performance.PaddingNoel Grandin
Excessive padding in 'struct ValueSetItem' (8 padding bytes, where 0 is optimal). Excessive padding in 'struct framework::CommandInfo' (12 padding bytes, where 4 is optimal). Optimal fields order: aIds, nId, nImageInfo, consider reordering the fields or adding explicit padding members [optin.performance.Padding] Excessive padding in 'class drawinglayer::attribute::ImpFillGradientAttribute' (10 padding bytes, where 2 is optimal). Excessive padding in 'class drawinglayer::attribute::ImpSdrLineAttribute' (8 padding bytes, where 0 is optimal). Change-Id: I606f2bfc2c0c51b386182b900401dd15b5404451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-09fix std::move same object more than onceNoel Grandin
after commit 8104d771b10a5c8b15eae4b67aa112ae2ef77b5b tdf#144052 reduce Primitive2D copying spotted by mikekanganski Change-Id: I97e4675a9042cfafa3f9f6c053ba2f50aeea2183 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121852 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-09tdf#144052 reduce Primitive2D copyingNoel Grandin
when creating charts, by using a Primitive2DContainer&& parameter in the GroupPrimitive2D constructor, which forces the call sites to pass a temporary, and at most call sites, we can std::move in an existing local variable. Change-Id: I531970918800c6832ab606b5a4ff5fd2d47ccf5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121844 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-08no need to call expand() hereNoel Grandin
we can just return the value directly Change-Id: Ia4a79ebe668dd426edbe95baee8d8cf91d4bc3f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-04use std::vector for fetching DX array dataNoel Grandin
because I'm trying to track down a related heap corruption, and that is much easier if the access to the array is checked by the std::vector debug runtime Change-Id: Ia665f5cebb7f14d88942e88b4b400ad3c28ef5d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>