summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2021-02-23update pchesCaolán McNamara
Change-Id: I44424081b7f55710c4db7f10d1829de1ae08be76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111363 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-22loplugin:refcounting in drawinglayerNoel
Change-Id: Ia7bf3a4811a47180ce2a92852a01b613ff16279a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-19update pchesCaolán McNamara
Change-Id: Ic4586057346b6de700c1bb6ff4cd759a11bb3e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111231 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-19Some more unit conversion unificationMike Kaganski
Change-Id: I8f0afb93ffb8bd1b88efca802fad5e9aeb447021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111168 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-18loplugin:referencecasting add check for new rtl::Reference operatorNoel
rtl::Reference now has a conversion operator to uno::Reference, so look for places where we can simplify the code and use that. Change-Id: Ic81db50d670bed5e875300577d4bf5f3599cc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-11loplugin:refcounting generalise type checkingNoel
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-01tdf#39674 Replace QuadratAntje Kazimiers
Change-Id: Icdc27fa9ab33a6c5a442760a9491e82000883ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110177 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-30this method should be pure virtualNoel Grandin
otherwise there is no point in subclassing this helper class Change-Id: I141d32ec84e782003cb41c6ca7abc27fd9a16860 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110167 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-17cppcheck: Prefer prefix ++/-- operators for non-primitive typesJulien Nabet
Change-Id: I866665b596a37c1e111fad8afeb9d4cb4d75c257 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109469 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-01-16make the Color constructors explicitly specify transparencyNoel
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16transparency->alpha in BitmapExNoel Grandin
Change-Id: I631f4ca5a2bdcb8c7691a9a8c71d3de15377213b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109390 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-13transparency->alpha in GraphicAttrNoel
Change-Id: I1fe9311871724ff8b7b8960f5dba6e890198565c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109211 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-12transparency->alpha in tools::ColorNoel
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08use more IsTransparentNoel
Change-Id: Ice7904f2531dba98101c5f7a05d14702fa897053 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108971 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08opacity->alpha in BPixelNoel
They are basically the same thing, but alpha is the preferred term these days. Also improve the mixing algorithm, 1 - opacity is 255 - opacity not 256 - opacity since the range of sal_uInt8 is 0..255 Change-Id: I8788ac79285ab25c8d322b05817dffd3745fd699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108963 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-08use more IsTransparentNoel Grandin
Change-Id: I3ef18a2601a51d56614b5da9b56e871bd33ec79e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-26vcl: use Color:IsTransparent() where appropriateChris Sherlock
Change-Id: I37bbab5f22f91faad65be8ef79734ce1ee6355d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24custom literal for Degree10Noel Grandin
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24vcl: move access functions into appropriate bitmap access filesChris Sherlock
Split class functions into BitmapInfoAccess.cxx, BitmapReadAccess.cxx and BitmapWriteAccess.cxx Split header files into BitmapInfoAccess.hxx and BitmapReadAccess.hxx Change-Id: I7dcbe1d26c5b64d297658a6b809c93d7ad7f053d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108039 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-17Fix typoAndrea Gelmini
Change-Id: I1790f37a3d0a6d4921f819b27c29cc6ee59ce00c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107854 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-12-16tdf#131281 Always draw FormControls when TiledRenderingArmin Le Grand (allotropia)
When FormControls are not in layout mode it would be necessary to have real VCL ChildWindows in the client (usually the office). While this is done in the office itself and thus the visualization of FormControls (and their usage) is guaranteed, this is currently not the case for existing clients of TiledRendering. The big solution would be an API for the TiledRendering client to get infos for FormControls and create these locally (what would allow to have these editable/interactive and in the style of the client system). As long as this is not the case, I add this fallback to render the FormControls as content to the tiles to get them visualized at all. Change-Id: I0f7a5e7dc028373145a6a19b639ce82bdafc149d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107735 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-12-11Adapt the remaining OUString functions to std string_viewStephan Bergmann
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-07move various notebookbar widgets into vclCaolán McNamara
and we can drop their factories then Change-Id: I1e261886dd7700710ba628da4bbeeba65efa1531 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107134 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-04update pchesCaolán McNamara
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01do not unnecessarily explicitly force gradient step count (tdf#138581)Luboš Luňák
Toolkits usually do not provide the ability to specify gradient steps, which means VCL falls back to its algorithm, which at least with Skia sometimes causes poor results. Change-Id: I35dbf87e77d5ed36d8f257db877135a2a0be2ffe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106971 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-11-23remove fontattribute.cxx from clang-format excludelistTomaž Vajngerl
Change-Id: I3720692af45920a4d084fe6ca4dd08bc0598ac13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106385 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-23move the anonymous namespace into drawinglayer::primitive2dTomaž Vajngerl
Change-Id: I66f7e5602c7a47baeadccfe913b9be984f0a5177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106384 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-23simplify namespaces and clean-up for TextLayouterDeviceTomaž Vajngerl
Move anonymous namespace into drawinglayer::primitive2d and convert static function into anonymous functions. Change-Id: Id8ff161a5ec69154f053fadd1178265fa2675139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106383 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-23remove textlayoutdevice.{hxx,cxx} from clang-format excludelistTomaž Vajngerl
Change-Id: Ia80a0331246b4e25cdc3387c50bd97c6befc4ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106382 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-16replace std::max(std::min()) with std::clampNoel
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-14tdf#35986 tdf#92315 tdf#116335 tdf#116622 Add support for MapMode TEXTBartosz Kosiorek
To properly import some EMF files, the proper implementation of MapMode Text needs to be done according to MS documentation. I have also added regression tests. Change-Id: Id788294a498b93bebb62118d13ea545f80a60f01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105771 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-13tdf#123936 Formatting files in module drawinglayer with clang-formatPhilipp Hofer
Change-Id: I2dd9c385c89f05026227e82ce85cecbe36e2c51c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105662 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-12Revert "tdf#127471 Remove font width scaling hack"Aron Budea
This reverts commit 8891a2fc2a4bf86add68691b7ac167a07a8add84. Reason: Causes regression, tdf#136891 Revert #2 "-Werror,-Wunused-variable (clang-cl)" This reverts commit a879b15d59618e73797ad779666f72cd040ff99a. Reason: Variables are necessary for the other revert. Change-Id: Ic1c3efe22f5c069f666ea6ba3193612cb44203ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105620 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
2020-11-11disable O(U)String::concat for internal codeNoel Grandin
in favour of the more widely used, and better optimised, operator+ Change-Id: I6a1b37e0f3d253af1f7a0892443f59b620efea63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-10new loplugin:reducevarscopeNoel Grandin
Change-Id: Iefe922c2e0d605114d54673d63eccc5e4abd545d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-09tdf#42949 Fix new IWYU warnings in directories d*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8f3cd05dbd86bd22fd84d767adc44fc2b0c89404 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105468 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-29Revert "Revert "tdf#127471 Remove font width scaling hack""Stephan Bergmann
This reverts commit f39e4b6b6f8aa8b4af22b6eb30a52e98cd5a6455. Reason for revert: Breaks the build on Windows, see e.g. <https://ci.libreoffice.org//job/lo_tb_master_win/28613/> > C:/cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win/drawinglayer/source/primitive2d/textlayoutdevice.cxx(432): error C2065: 'bFontIsScaled': undeclared identifier > C:/cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win/drawinglayer/source/primitive2d/textlayoutdevice.cxx(438): error C2065: 'nWidth': undeclared identifier (<https://gerrit.libreoffice.org/c/core/+/104847/1> "Revert 'tdf#127471 Remove font width scaling hack'" had trivially succeeded to build on Jenkins, as it was base on the old 8891a2fc2a4bf86add68691b7ac167a07a8add84 "tdf#127471 Remove font width scaling hack" which it reverted, rather than on recent master.) Change-Id: I1060e5423f594894b15330ba6631a9af07a64634 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104958 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-29Revert "tdf#127471 Remove font width scaling hack"Samuel Mehrbrodt
This reverts commit 8891a2fc2a4bf86add68691b7ac167a07a8add84. Reason for revert: Causes regressions like tdf#136891 Change-Id: I940c447bec38231b666eeac4212f09e22117504e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104847 Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-10-28convert some more long -> tools::LongNoel
Change-Id: Ide9811c1a7582454b3fcf655b70ea106ed56509a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104914 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-28Extend loplugin:elidestringvar to OStringStephan Bergmann
(In VisitVarDecl, filtering out AbstractConditionalOperator avoids an unhelpful > ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:63:32: error: replace single use of literal 'rtl::OString' variable with a literal [loplugin:elidestringvar] > aXmlWriter.content(sPdfConformance); > ^~~~~~~~~~~~~~~ > ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:52:21: note: literal 'rtl::OString' variable defined here [loplugin:elidestringvar] > OString sPdfConformance = (mnPDF_A == 1) ? "A" : "B"; > ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) Change-Id: I7d0410f04827d79b4b526752917c37d33cad2671 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104911 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-10-28convert some more long -> tools::LongNoel
grepping for stuff in template params this time Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-26switching long to a 64-bit type on 64-bit windowsNoel
(*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-29disentangle AA and B2D use in VCL drawingLuboš Luňák
A number of powerful functions using B2D polygons such as OutputDevice::DrawPolyLineDirect() were used only if AA was enabled. So e.g. dashing for an AA-ed polyline could be drawn directly using the function, but with AA disabled had to be done manually by a number of polygon operations. Which doesn't make much sense, surely these powerful functions can also draw without AA if set so (and indeed that's mostly the case). And DrawPolyLineDirect() even had a flag to bypass the check. So simply try to use B2D-based drawing whenever possible, AA or not. The previous commit had already changed the naming of the AA option to not include B2D in the name. This seems to come from https://bz.apache.org/ooo/show_bug.cgi?id=88795, which doesn't explain why AA only. There are other bugreports such as https://bz.apache.org/ooo/show_bug.cgi?id=101491 and https://bz.apache.org/ooo/show_bug.cgi?id=98289 that are related, but there I cannot see any difference with this patch. And all unit tests pass. Change-Id: Ibb5938e8fff9b7452bac4bf12ed3e42fd3e5d645 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103354 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-28rename for disentangling AA and B2D use in VCL drawingLuboš Luňák
This renames AntialiasingFlags::EnableB2dDraw to just Enable, and the AntiAliasB2DDraw names to just AntiAlias. This is in preparation for a second commit that will actually separate the AA and B2D functionality of these flags. Change-Id: I9cc215c5752dfabce41e00e19d9074fc8dc3d4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-25forward axial and radial gradient types to VCL tooLuboš Luňák
VCL's drawGradient() can handle them all, at least using a fallback algorithm. And drawinglayer doesn't know which of them are handled directly by the VCL backend used. A catch is that the rendering of tdf#133477 is different, so keep using drawinglayer for the affected gradient types until somebody fixes that. Change-Id: I1719c67c15752c6d1c3431ddfa797ac94d039555 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103376 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-25use vcl lin. gradient drawing in drawinglayer + cairo impl.Tomaž Vajngerl
This adds a divert for drawing of linear gradients drawing, which can be implemented natively with a much higher quality and speed. This also adds a implementation of drawing linear gradients with cairo. Change-Id: I8c39915c3579e6eb88cdce8ae4ac9694ffdb4957 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103374 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-21update pchesCaolán McNamara
Change-Id: I41a204fbc5e2c9b819fb948c5288f8d7b4195489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103117 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13tdf#124176 Use #pragma once in drawinglayerGeorge Bateman
This commit was carried out by a Python script, source of which is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97. Change-Id: I196a60fda0fa88ea2d9ac438d5e9234fde46fb18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102574 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-09Move the validity check before color manipulationsMike Kaganski
Change-Id: Id4a7a15b7b88df888d2cd224e375c839c59b882f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102301 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>