summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)AuthorFilesLines
2017-12-08tdf#109340 Improve performance by reducing matrix multiplicationBartosz Kosiorek2-5/+5
Multiplication of two B2DHomMatrix with operator* is very CPU expensive, because 24 of double-precision floating point multiplication needs to be performed. With this patch I have reduced Multiplication of matrix, by creating combined Scale and Transform matrix at once. It allows to reduce matrix multiplication by one, and improve import time. Change-Id: I85fde6354e458659a0214514c6e05b8e2ee04185 Reviewed-on: https://gerrit.libreoffice.org/45828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Patrick Jaap <patrick.jaap@tu-dresden.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-22Make loplugin:unnecessaryparen warn about (x) ? ... : ... after allStephan Bergmann1-1/+1
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-21tdf#112500 Store world transform during graphic saveBartosz Kosiorek1-0/+2
Change-Id: Iefa51dcca6d6b896fbd41cefc0a115c501c45675 Reviewed-on: https://gerrit.libreoffice.org/44923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Patrick Jaap <patrick.jaap@tu-dresden.de> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-18tdf#111486 Multiply by whole base transformation, and not only by scale of itBartosz Kosiorek1-1/+2
Change-Id: Ib50fa1ac36f06dbd7e5e921f9c13c5d5ac8bb138 Reviewed-on: https://gerrit.libreoffice.org/44869 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-17tdf#111486 Use buildin methods for displaying matrixBartosz Kosiorek1-11/+2
Change-Id: I0f40f7178be126229c8963b56e6a15313acc19a7 Reviewed-on: https://gerrit.libreoffice.org/44868 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-17tdf#113451 Fix misplacing of lines by adding mappingChangedBartosz Kosiorek1-16/+9
Change-Id: I9b381f456d4c96369fdf7e94f161fde2723ebead Reviewed-on: https://gerrit.libreoffice.org/44842 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-17tdf#113704 EMF+ Add support for EmfPlusRecordTypeFillRegion recordBartosz Kosiorek2-18/+23
Change-Id: I60366d4a27fdf5a3cc020ca54f4a2aa9b974db5e Reviewed-on: https://gerrit.libreoffice.org/44795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-16tdf#113704 Implement proper reading of the EmfPlusRegionNodeBartosz Kosiorek8-138/+131
Regions are specified as a binary tree of region nodes, and each node must either be a terminal node or specify one or two child nodes. Nodes contains two child nodes: RegionNodeDataTypeAnd = 0x00000001, RegionNodeDataTypeOr = 0x00000002, RegionNodeDataTypeXor = 0x00000003, RegionNodeDataTypeExclude = 0x00000004, RegionNodeDataTypeComplement = 0x00000005, Terminal nodes: RegionNodeDataTypeRect = 0x10000000, RegionNodeDataTypePath = 0x10000001, RegionNodeDataTypeEmpty = 0x10000002, RegionNodeDataTypeInfinite = 0x10000003 RegionNode must contain at least one element. Change-Id: I668e5892701b979f09bcf5bbce44a43226676192 Reviewed-on: https://gerrit.libreoffice.org/44324 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-14tdf#113758 EMF+ Add mapping of clipped region to the world space.Bartosz Kosiorek1-3/+10
OffsetClip record applies a translation transform on the current clipping region for the world space. Change-Id: I5d23f6aac944e4f23ea7c51e47fb551a20166446 Reviewed-on: https://gerrit.libreoffice.org/44699 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-13tdf#113758 EMF+ Add support to OffsetClip recordBartosz Kosiorek2-3/+21
OffsetClip record applies a translation transform on the current clipping region for the world space. Change-Id: Iac024a3c2eaba58edc5bb59d817796b6022f559f Reviewed-on: https://gerrit.libreoffice.org/44597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-09tdf#113707 EMF+ Add support for ResetClip recordBartosz Kosiorek2-1/+12
Change-Id: I00ab6ac7a5e157cff469c2afd5e14d5f06f01bd0 Reviewed-on: https://gerrit.libreoffice.org/44432 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-09tdf#77229 tdf#113635 EMF+ Add support for Clip Union, Exclude and ComplementBartosz Kosiorek1-28/+37
Union: Replaces the existing region with the union of the existing and new regions. Exclude: Replaces the existing region with the part of itself that is not in the new region. Complement: Replaces the existing region with the part of the new region that is not in the existing region. Change-Id: Iabbe0ddfa082a332e94dd85b6444b234d1bdee35 Reviewed-on: https://gerrit.libreoffice.org/44380 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-06loplugin:constparams in cppcanvas,drawinglayerNoel Grandin10-14/+14
Change-Id: I15cac1411c985afe8d7cb9439214a8092702bdb8 Reviewed-on: https://gerrit.libreoffice.org/44343 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-06loplugin:finalclasses in drawinglayerNoel Grandin1-3/+1
Change-Id: I8922fc85ab23453791e3ce0b639d4ffafd31e967 Reviewed-on: https://gerrit.libreoffice.org/44315 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-04tdf#113635 Add support for Clip Intersect and XORBartosz Kosiorek2-26/+63
Change-Id: Iff2bb06a209a6c089fec12b5f888ca4ef7c38c1b Reviewed-on: https://gerrit.libreoffice.org/44289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-04loplugin:constparams in various(1)Noel Grandin1-1/+1
Change-Id: Ic80ca59abc3e104c7adf0c1eff1d16addf48bc8b Reviewed-on: https://gerrit.libreoffice.org/44261 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-03tdf#111486 Fix component names in SAL_INFOsBartosz Kosiorek1-38/+24
Change-Id: I22a6747446d5571a883555db748ca3d40579cb13 Reviewed-on: https://gerrit.libreoffice.org/44222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-03loplugin:constmethod in drawinglayerNoel Grandin9-27/+27
Change-Id: I6a33765f6589fc2941162eb2dcaa4e0a2d9e46e1 Reviewed-on: https://gerrit.libreoffice.org/44214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-01loplugin:constantparam in basegfxNoel Grandin1-1/+1
Change-Id: Ieabdd6f8d76cfc2ed75f2ec618def6591a9adc93 Reviewed-on: https://gerrit.libreoffice.org/44130 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-01loplugin:constantparam in d*Noel Grandin3-8/+7
Change-Id: I65c395157d2b68a549a6fecf9abf1fd46446d960 Reviewed-on: https://gerrit.libreoffice.org/44109 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-30Revert "tdf#113197 Add MaskPrimitive (clip) to EMF/WMF if needed"Thorsten Behrens1-25/+35
This reverts commit bdb9cc1702d4e125db8c379f3b535bbd9f845b95. Breaks Mac unit tests in sw_ooxmlexport4
2017-10-28tdf#106084 EMF+ Add support for RotateWorldTransform recordBartosz Kosiorek2-1/+19
Change-Id: If5ce156b7d60d30be8451902beb8330b7177b26e Reviewed-on: https://gerrit.libreoffice.org/43858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-10-28tdf#113197 Add MaskPrimitive (clip) to EMF/WMF if neededArmin Le Grand1-35/+25
When the content of an imported EMF/WMF overlaps the defined size in PrefMapMode/PrefSize, add clipping to hide it. This was done in imports before EMF+ changes and is done in SVG, too. If needed, orig contained size and content still accessible using MetafilePrimitive2D::accessMetafile Change-Id: Id86ff3c0a9820637e3601c0c4f489a2d67d190d0 Reviewed-on: https://gerrit.libreoffice.org/43746 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-10-27remove GetSwapFloat nonsense from all 3 EMF readersMichael Stahl1-23/+0
SvStream::ReadFloat already does that, and SvStream is initialised to SvStreamEndian::LITTLE by default. Change-Id: I5859e43014533bcebef9d4b8f0678c516193b92e
2017-10-26vcl: make MapMode constructor explicitMichael Stahl3-4/+4
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-26blind attempt to fix build on big endianDavid Tardon1-0/+15
Change-Id: I4dc2d5a5fbbded5f4c7a1417c150fe6b1a73a69d
2017-10-26tdf#111486 Fix description of SAL_ macros after EMF+ refactorBartosz Kosiorek10-217/+217
Change-Id: If235956228d7f807817d9ffff3da652bd6485ffa Reviewed-on: https://gerrit.libreoffice.org/43834 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-10-24Resolves: tdf#49253 set an initial mask backgroundCaolán McNamara1-0/+4
the gif in question has gif disposal mode "previous" set on the first frame Change-Id: I5234b0bd810af9e8e858dabac373fc4651dbb52e Reviewed-on: https://gerrit.libreoffice.org/43613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-23loplugin:includeform: drawinglayerStephan Bergmann31-46/+46
Change-Id: I52693e59a37e36fa0bb21732efe90af84fe6d6c6
2017-10-21loplugin:redundantcast handle dynamic_castNoel Grandin1-1/+0
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb Reviewed-on: https://gerrit.libreoffice.org/43621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-18use std::unique_ptr in wmfemfhelper::TargetHolderNoel Grandin3-61/+54
Change-Id: I2fab3b9a111513ac711a6480eb240de99eea1991 Reviewed-on: https://gerrit.libreoffice.org/43486 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-16tdf#31814 Resolve TODO from EMF+ DrawImage and DrawImagePointsBartosz Kosiorek1-39/+40
Change-Id: I1b128aa467286b5ae5e0d3cc298ee59f3e6ec12d Reviewed-on: https://gerrit.libreoffice.org/43408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Patrick Jaap <patrick.jaap@tu-dresden.de> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-10-15tdf#31814 Fix for EMF+ DrawString and DrawImagePatrick Jaap1-43/+52
DrawString: The value 'fontAttribute' is optional and may be null, results in missing characters. DrawImage: The case of 'metafile' was missing and leads to low resolution rendering. Change-Id: I81566d884975fda832f4a5af6663c837f355c383 Reviewed-on: https://gerrit.libreoffice.org/43367 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-10-01drawinglayer: remove commented out codeChris Sherlock1-70/+1
Change-Id: I20fd2665f9fed59b45127dd4aa3dbce0fc58ac17 Reviewed-on: https://gerrit.libreoffice.org/43006 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-10-01tdf#31814 drawinglayer: dump EmfPlusRecordTypeComment recordsChris Sherlock2-1/+30
When we get an EMF+ comment record (which is NOT an EMF comment record, EMF has comment records which is how you store EMF+ records, EMF+ records also have comment records for "private data") then if we are a debug build then dump the private data to stdout. To make this work, set: SAL_LOG=+INFO.cppcanvas.emf+WARN.cppcanvas.emf Change-Id: I293875f45b692971379a5945ff7feb273bc54c73 Reviewed-on: https://gerrit.libreoffice.org/42558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-10-01drawinglayer: should be warning, not info SAL_LOG messagesChris Sherlock1-12/+5
We should warn if EMF+ record < 12 bytes. Similarly, if the record size is less than 12 bytes, that's evidence of a corrupted EMF+ record, same with if the length or datasize is too long. Thus we should warn at this point. Also - if an if statement is not part of another if/else block then best to have a newline separating them so they don't look like they are part of that block. Change-Id: I914c754fe7437d6d4b6f2e4aec2d28475eaf5d70 Reviewed-on: https://gerrit.libreoffice.org/43004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-10-01simplify some OUString compareTo callsMuhammet Kara1-2/+2
to either startsWith or == or != Change-Id: I595dd9d89d32134827980c4ba10f88584430137d Reviewed-on: https://gerrit.libreoffice.org/42988 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-29convert GfxLink::IsEqual to operator==Noel Grandin1-1/+1
exactly one use site Change-Id: Id0a75d46c459be213e81b47aa6c1194c87aec848 Reviewed-on: https://gerrit.libreoffice.org/42891 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-28tdf#112012 EMF+ dashed lines: correct dash lengthPatrick Jaap1-10/+9
Since the first guess of the right transformation seemed to be wrong, here is the next try. The pure float value is multiplied with the pen width. This is way more intuitive for me and renders the EMF files from the bugtracker exactly like in MSO. See 588c5b0cff9bbdb2efbdfb259268154b0074e7e6 for the previous patch. Change-Id: I74e82a0f9800d950e0d989184765a53e520b48e6 Reviewed-on: https://gerrit.libreoffice.org/42810 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist73-287/+287
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-24tdf#96505 Get rid of cargo cult "long" integer literals66kesara993-19/+19
Remove unnecessary "Long" literals in multiple locations Change-Id: Icc44546f10fed841683053eee01b788274e0add1 Reviewed-on: https://gerrit.libreoffice.org/42683 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-22Remove include of converters.hxx from precompiled_drawinglayer.hxxMike Kaganski1-1/+0
Commit cf48347e7a56c38c000e657965f25f4c7e7b4803 didn't take into account commit 632edfabe8065cd59a237d975ee03468ce4d868b landed before it. Change-Id: I108027a460943b14194adcff4af2a41b7720f3be Reviewed-on: https://gerrit.libreoffice.org/42677 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22Fresh run of bin/update_pch.shMike Kaganski1-6/+22
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22Put definition of _CRT_RAND_S into bin/update_pchMike Kaganski10-34/+34
so it doesn't get removed again from sal/inc/pch/precompiled_sal.hxx (see commit 4af9612f2be9e023e762831207cbdb1d5f25906f). Also make necessary changes to some of the files that start to fail building after running bin/update_pch.sh, so that the patch is self-contained and leaves the tree in fully functional state. tools namespace had to be prepended with :: to disambiguate from drawinglayer::tools vcl/inc/window.h includes were amended, because ExtTextInputAttr is from vcl/commandevent.hxx, and enum class ShowTrackFlags is from vcl/window.hxx Change-Id: I47179622350754cba2f95d26a1bafd3dfbbc935b Reviewed-on: https://gerrit.libreoffice.org/42559 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-22<drawinglayer/tools/converters.hxx> can be internal to drawinglayerTor Lillqvist6-112/+153
And while moving it, get rid of the 'drawinglyer::tools' subnamespace. Less potential confusion with the global 'tools' namespace. Change-Id: Iab3c25be0cec7f3d182228d122837e9f2ac9a529 Reviewed-on: https://gerrit.libreoffice.org/42619 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2017-09-18maPrimitiveColor in Shadow3DExtractingProcessor unusedNoel Grandin1-3/+2
since commit 9927e1ca23c8353c880a3ae0a196caabdf747c4b Date: Wed Aug 9 16:00:16 2006 +0000 #i39532# Change-Id: I1db3db2c4860d6ad71085cc3cfdeb202eec7e24a
2017-09-15Fix typosAndrea Gelmini2-2/+2
Change-Id: I78653129638b25f16e0816b6fff11e02100c85e7 Reviewed-on: https://gerrit.libreoffice.org/42321 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2017-09-15borderline: Extended decomposeArmin Le Grand1-9/+112
Decompose of BorderLinePrimitive2D extended to take care of non-perpendicular line endings for matching. Improved matching, one error in calc fixed Change-Id: I869a75385711b58e6725daba0f22be8a98158ad9
2017-09-15borderline: extended the expand logicArmin Le Grand1-83/+0
Extended and checked the expand logic for creating the line extends. Now creating quite the right lines, will need to check some speccial cases. Also some cleanups. Change-Id: I3a3bd4d23c7017ecd873147df2d93af61de39fa6
2017-09-15borderline: Added merge BorderLinePrimitive2DArmin Le Grand1-6/+21
Added BorderLinePrimitive2D merges for Writer and fixes.