Commit graph

2211 commits

Author SHA1 Message Date
anonymotter
7a12424df2 tdf#158068 Replace string literals with OUString literals in canvas
Change-Id: I7bbcc08786843d6d289b3170248ce2696e57f3b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177602
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2024-12-03 20:46:51 +01:00
Xisco Fauli
d991795635 canvas: simplify calcTransformedRectBounds
Change-Id: Ia0314a985ae2183727587ad254faec12ee49b66c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176769
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-19 16:14:13 +01:00
Xisco Fauli
b20156432f canvas: simplify calcRectToOriginTransform
Change-Id: I851d9d11c9d3f3c34353913a146ad168a98dc3d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176771
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-11-19 15:48:30 +01:00
Xisco Fauli
e289fdedeb canvas: simplify getViewStateTransform/getRenderStateTransform
Change-Id: If9487aff0d80f7ee9d368cd97bc2828a856cc392
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176766
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-11-19 15:45:34 +01:00
Noel Grandin
193207c5ab improve loplugin passparamsbyref
I think I managed to disable this when I converted it to
use the shared plugin infrastructure.

So fix that, and then make it much smarter to avoid various
false positives.

Change-Id: I0a4657cff3b40a00434924bf764d024dbfd7d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-19 07:46:25 +01:00
Noel Grandin
08ed26c3b8 clang-tidy: performance-unnecessary-copy-initialization in canvas
Change-Id: I1d08cfe979529614ab2c66702c33a9045b026f23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176391
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-11 15:47:08 +01:00
Mike Kaganski
1180b3473a com::sun::star -> css
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-10 10:50:15 +01:00
Noel Grandin
b61e0f2b53 loplugin:reftotemp in canvas
Change-Id: I0a038cf32e05dab59b1cedcf06ecd38b48d76feb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176257
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-08 13:23:57 +01:00
Noel Grandin
91106b5b61 loplugin:passstuffbyref in avmedia..canvas
Change-Id: I916a6431eb0720af16dcb5aa46b758f92dbe4ec4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176179
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-07 10:03:42 +01:00
Bogdan Buzea
38dc12033f tdf#163486: PVS: Identical branches
Change-Id: I65edd548d9ed4fbc5589f354280dbfb90e2a9064
V1037: Two or more case-branches perform the same actions. Check lines: 171, 177
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175148
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-02 01:00:21 +01:00
Noel Grandin
11b1557147 convert KernArray from sal_Int32 to double
which allows us to eliminate a bunch of rounding at various layers, and
consequently maintain a lot more precision

Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-31 12:10:52 +01:00
Chris Sherlock
bc2ff9daf5 vcl: move bitmap filter headers into vcl/bitmap global header directory
Use #pragma once instead of header guards

Change-Id: Iba43f2103628ed184933cf2611991e7aef9f0173
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173369
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2024-10-21 09:45:21 +02:00
Mike Kaganski
12e08b3cba tdf#163145: revert commit 6f224a17db
I can't reproduce the problem from tdf#136933 anymore (using kf5
and qt5), while it's reproducible using v.7.0 bibisect repo with
qt5. I conclude, that the problem got resolved in the meanwhile.
So it seems to make sense to just revert the problematic commit.
The incorrect line drawing still may need to be fixed eventually.

There seem to be no way to test SlideImpl::getCurrentSlideBitmap,
which eventually calls CanvasHelper::strokePolyPolygon. So this
change has no unit test, unfortunately.

Change-Id: I1d82b6f734a4f69d93c9d61732f55ef8158cfbe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173933
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-25 18:36:49 +02:00
Caolán McNamara
c93eb54c87 cid#1557618 COPY_INSTEAD_OF_MOVE
and

cid#1557535 COPY_INSTEAD_OF_MOVE
cid#1557520 COPY_INSTEAD_OF_MOVE
cid#1557513 COPY_INSTEAD_OF_MOVE
cid#1557503 COPY_INSTEAD_OF_MOVE
cid#1557487 COPY_INSTEAD_OF_MOVE
cid#1557483 COPY_INSTEAD_OF_MOVE
cid#1557479 COPY_INSTEAD_OF_MOVE
cid#1557474 COPY_INSTEAD_OF_MOVE
cid#1557461 COPY_INSTEAD_OF_MOVE
cid#1557446 COPY_INSTEAD_OF_MOVE
cid#1557445 COPY_INSTEAD_OF_MOVE
cid#1557441 COPY_INSTEAD_OF_MOVE
cid#1557435 COPY_INSTEAD_OF_MOVE
cid#1557433 COPY_INSTEAD_OF_MOVE
cid#1557429 COPY_INSTEAD_OF_MOVE
cid#1557375 COPY_INSTEAD_OF_MOVE
cid#1557372 COPY_INSTEAD_OF_MOVE
cid#1557356 COPY_INSTEAD_OF_MOVE
cid#1557350 COPY_INSTEAD_OF_MOVE
cid#1557344 COPY_INSTEAD_OF_MOVE
cid#1557339 COPY_INSTEAD_OF_MOVE
cid#1557332 COPY_INSTEAD_OF_MOVE
cid#1557330 COPY_INSTEAD_OF_MOVE
cid#1557328 COPY_INSTEAD_OF_MOVE
cid#1557323 COPY_INSTEAD_OF_MOVE
cid#1557315 COPY_INSTEAD_OF_MOVE
cid#1557313 COPY_INSTEAD_OF_MOVE
cid#1557304 COPY_INSTEAD_OF_MOVE
cid#1557297 COPY_INSTEAD_OF_MOVE
cid#1557291 COPY_INSTEAD_OF_MOVE
cid#1557290 COPY_INSTEAD_OF_MOVE
cid#1557271 COPY_INSTEAD_OF_MOVE
cid#1557266 COPY_INSTEAD_OF_MOVE
cid#1557262 COPY_INSTEAD_OF_MOVE
cid#1557259 COPY_INSTEAD_OF_MOVE
cid#1557246 COPY_INSTEAD_OF_MOVE
cid#1557242 COPY_INSTEAD_OF_MOVE
cid#1557241 COPY_INSTEAD_OF_MOVE
cid#1557236 COPY_INSTEAD_OF_MOVE
cid#1557228 COPY_INSTEAD_OF_MOVE
cid#1557225 COPY_INSTEAD_OF_MOVE
cid#1557221 COPY_INSTEAD_OF_MOVE
cid#1557217 COPY_INSTEAD_OF_MOVE
cid#1557213 COPY_INSTEAD_OF_MOVE
cid#1557211 COPY_INSTEAD_OF_MOVE
cid#1557209 COPY_INSTEAD_OF_MOVE
cid#1557205 COPY_INSTEAD_OF_MOVE
cid#1557204 COPY_INSTEAD_OF_MOVE
cid#1557193 COPY_INSTEAD_OF_MOVE
cid#1556082 COPY_INSTEAD_OF_MOVE

Change-Id: I07f195a79a69d4bac0d14317854efc88d6fe94d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171927
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-16 09:30:37 +02:00
Caolán McNamara
59768e6051 cid#555593 COPY_INSTEAD_OF_MOVE
and

cid#1555849 COPY_INSTEAD_OF_MOVE
cid#1555936 COPY_INSTEAD_OF_MOVE
cid#1555951 COPY_INSTEAD_OF_MOVE
cid#1555955 COPY_INSTEAD_OF_MOVE
cid#1555960 COPY_INSTEAD_OF_MOVE
cid#1555964 COPY_INSTEAD_OF_MOVE
cid#1555965 COPY_INSTEAD_OF_MOVE
cid#1555975 COPY_INSTEAD_OF_MOVE
cid#1555979 COPY_INSTEAD_OF_MOVE
cid#1555987 COPY_INSTEAD_OF_MOVE
cid#1555990 COPY_INSTEAD_OF_MOVE
cid#1555991 COPY_INSTEAD_OF_MOVE
cid#1556002 COPY_INSTEAD_OF_MOVE
cid#1556008 COPY_INSTEAD_OF_MOVE
cid#1556011 COPY_INSTEAD_OF_MOVE
cid#1556015 COPY_INSTEAD_OF_MOVE
cid#1556017 COPY_INSTEAD_OF_MOVE
cid#1556023 COPY_INSTEAD_OF_MOVE

Change-Id: I8ab99d8e52a1780173a4272c59d408432c29de9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171572
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-06 22:31:35 +02:00
Caolán McNamara
4177e553e0 cid#1555587 COPY_INSTEAD_OF_MOVE
and

cid#1555589 COPY_INSTEAD_OF_MOVE
cid#1555593 COPY_INSTEAD_OF_MOVE
cid#1555596 COPY_INSTEAD_OF_MOVE
cid#1555602 COPY_INSTEAD_OF_MOVE
cid#1555608 COPY_INSTEAD_OF_MOVE
cid#1555610 COPY_INSTEAD_OF_MOVE
cid#1555620 COPY_INSTEAD_OF_MOVE
cid#1555623 COPY_INSTEAD_OF_MOVE
cid#1555625 COPY_INSTEAD_OF_MOVE
cid#1555626 COPY_INSTEAD_OF_MOVE
cid#1555634 COPY_INSTEAD_OF_MOVE
cid#1555638 COPY_INSTEAD_OF_MOVE
cid#1555667 COPY_INSTEAD_OF_MOVE
cid#1555682 COPY_INSTEAD_OF_MOVE
cid#1555686 COPY_INSTEAD_OF_MOVE
cid#1555702 COPY_INSTEAD_OF_MOVE
cid#1555710 COPY_INSTEAD_OF_MOVE
cid#1555750 COPY_INSTEAD_OF_MOVE
cid#1555752 COPY_INSTEAD_OF_MOVE
cid#1555761 COPY_INSTEAD_OF_MOVE
cid#1555762 COPY_INSTEAD_OF_MOVE
cid#1555771 COPY_INSTEAD_OF_MOVE
cid#1555772 COPY_INSTEAD_OF_MOVE
cid#1555784 COPY_INSTEAD_OF_MOVE
cid#1555785 COPY_INSTEAD_OF_MOVE

Change-Id: Ib9724230c05b2027b4edf64e6a0bb5e22a270a88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171274
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-31 17:37:14 +02:00
Caolán McNamara
f090247246 cid#1598237 Uncaught exception
Change-Id: Iab0a585048d028fda27a8b3edaad666edd0f55b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167796
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-18 16:27:04 +02:00
Noel Grandin
6555238fc6 use more officecfg in CanvasFactory
Change-Id: I3d2b09a0e951a7901af85108537485fdea1dbc43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167640
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-15 08:01:56 +02:00
Mike Kaganski
ccdb98c0e5 Drop some uses of css::uno::Sequence::getConstArray
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I64683093afc48ddf2307dc1dee2302cf0b3cbecc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167110
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-05-12 05:04:57 +02:00
Noel Grandin
f840d3c939 loplugin:ostr in canvas
Change-Id: I6fe0ed24a42394936975e763aba9dc3625a373ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167205
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06 21:31:14 +02:00
Caolán McNamara
a2623abe07 WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I498c10e8bc134b41e3606d8a05cf3103a9274735
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166937
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-30 22:04:11 +02:00
Mike Kaganski
8755c80018 Drop uses of css::uno::Sequence::getConstArray in canvas .. connectivity
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I9467028fd1a7eeafad7f0dd776a91a9a40770b48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166816
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-29 23:15:33 +02:00
Mike Kaganski
690526f95e Generalize basegfx::fround for templated return type
And use it when assigning to tools::Long

Change-Id: I0814d7bac9cdd48191ba69c64e3b12a4973b3417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166071
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-15 06:34:33 +02:00
Noel Grandin
62d5b1ae8d convert CanvasFont to comphelper::WeakComponentImplHelper
Change-Id: I91aab0365aa57670d484228797f97a2675894cd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165573
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-30 18:01:34 +01:00
Rafał Dobrakowski
c8b8a2c2cb tdf#141908 - CppUnittests: replace usage of sal_Int32 with colors
Conversion of hex/dec colour notation
(example entry Color( 255, 255, 255), Color(0xFFFFFF) - COL_WHITE)
For the other available colour definitions.

Change-Id: I9eed0cd64adcbc8d25e1c22143a000906a457586
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163729
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-14 02:33:03 +01:00
Arnaud VERSINI
6a83118936 canvas : use more OUString literals
Change-Id: I539e1e6d04299154bfe1ad2cf0362bdf3d96537b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163051
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-08 04:37:27 +01:00
Sarper Akdemir
84055d875e tdf#156830: fix faulty transformation order in cairo canvas for patterns
Change-Id: Ib58e845c23dd14bbc3b96e5549a722b650d593a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162069
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2024-01-15 09:21:05 +01:00
Caolán McNamara
f1dc4e0d2a cid#1546414 COPY_INSTEAD_OF_MOVE
and

cid#1546408 COPY_INSTEAD_OF_MOVE
cid#1546367 COPY_INSTEAD_OF_MOVE
cid#1546283 COPY_INSTEAD_OF_MOVE
cid#1546268 COPY_INSTEAD_OF_MOVE

Change-Id: I8b6067f70bc0e8cce7117bb3f366227add279887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12 14:52:08 +01:00
Luv Sharma
54f2bd4534 tdf#145538 Use range based for loops
Change-Id: I0f028d48ccad4e1420e043eb0ab8aeab88ed0b88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161533
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-01-02 22:35:26 +01:00
Caolán McNamara
f0a8b5b81d move IsFuzzing to comphelper
and try something a bit more generic

Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30 12:45:45 +01:00
Noel Grandin
a214ac6774 simplify and modernise ScopedBitmapAccess
(*) Make all of it use a "Scoped" paradigm
(*) pass by value, no need to allocate on heap
(*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods.
(*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places.

Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-07 09:32:14 +01:00
Stephan Bergmann
46617d95f4 Extended loplugin:ostr: canvas
Change-Id: I7c5ee1eb15a4464c9dfc2e292df3e6adf71d3956
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159726
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 10:00:14 +01:00
Julien Nabet
d0b0908e62 c++20: use std::erase instead of std::removed followed by erase (part 2)
Change-Id: I0222f0f53f387dd57bd674b1e137b53487f4e1d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159611
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18 20:27:47 +01:00
Julien Nabet
be1093cce5 c++20: use std::erase instead of std::removed followed by erase
See https://en.cppreference.com/w/cpp/container/vector/erase2

Change-Id: I26744e74b34d1efa1524a1f88aa3af9e153bc9ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159515
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-17 08:29:04 +01:00
Patrick Luby
4cf636fab3 tdf#157790 invert alpha mask
Due to commit 81994cb2b8,
the alpha mask needs to be inverted.

Change-Id: I4771c5f6f3a08fb210b62a0533df895a4a476058
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158410
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-25 07:51:13 +02:00
Stephan Bergmann
6d1b241ab7 Drop o3tl::span, can use C++20 std::span directly now
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11 21:53:13 +02:00
Gabor Kelemen
7ac978c4d1 tdf#146619 Recheck include/basegfx with IWYU
Change-Id: I08dad6ceeaa9e5470491c09f06d819c4c27ec5f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156983
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-21 08:53:31 +02:00
Noel Grandin
aff6205058 replace set(nullptr) with clear()
It's a little easier to read, but mostly it makes an upcoming
loplugin easier to implement

Change-Id: I4ae7db8eda77795dab3255d1afd8ba4f20a8de76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156451
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-02 08:56:56 +02:00
Noel Grandin
7ffa7e56c0 loplugin: new global analysis locking2
look for methods where we don't need to guard access
to the field, because the field is never modified

Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-19 17:40:47 +02:00
Patrick Luby
f6cae6f1b6 tdf#144073 and tdf#147645: use bounds and angle for gradient
Passing an expanded, rotated polygon noticeably modifies the
drawing of the gradient in a slideshow due to moving of the
starting and ending colors far off the edges of the drawing
surface. So try another way and set the angle of the
gradient and draw only the unadjusted bounds.

Change-Id: I95441dfa3215396d5bc7edfa9f985335480b37de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155729
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-16 13:47:31 +02:00
Noel Grandin
5463f2a985 Revert "clang-tidy bugprone-parent-virtual-call in canvas"
This reverts commit eb6110aae0.

There are some odd things gone in with some of these changes that I do understand. Reverting until I have worked it out.

Change-Id: I3856b878cfaa6fd1b282a473965b2ec68779a616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-13 14:03:38 +02:00
Noel Grandin
eb6110aae0 clang-tidy bugprone-parent-virtual-call in canvas
Change-Id: Ibaaec56e7cb42d113be07bb719de3534de24833c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-11 20:32:35 +02:00
Thorsten Behrens
ad1f69d28d tdf#156540 invert alpha mask when drawing sprites
Due to the switch from transparency to alpha in commit
81994cb2b8, a sprite's
alpha mask needs to be inverted.

Additionally, fixes an oversight in vcl's alpha.cxx, where manual
blend math got mangled, also in
81994cb2b8.

Change-Id: I8ebbbc7fe624d8dfc8121d8814d30875c498870d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155378
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-06 12:23:07 +02:00
Patrick Luby
b3053b63c6 Revert "tdf#156540 invert alpha when drawing sprites"
This reverts commit 52637f46cc.

Reason for revert: A better fix is being worked on in https://gerrit.libreoffice.org/c/core/+/155378

Change-Id: I91c6ed96bdd202612d4b10458c015532b9162c1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155308
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Tested-by: Patrick Luby <plubius@neooffice.org>
2023-08-06 01:48:12 +02:00
Patrick Luby
52637f46cc tdf#156540 invert alpha when drawing sprites
Due to the switch from transparency to alpha in commit
81994cb2b8, a sprite's
alpha mask needs to be inverted when Skia is enabled and
the fAlpha value needs to be inverted when Skia is disabled.

Change-Id: Ie802924b07ddbab536a2eddb57bf82e5146cffe7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155358
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-05 22:58:28 +02:00
Noel Grandin
81994cb2b8 Convert internal vcl bitmap formats transparency->alpha (II)
(Second attempt at landing this)

Image formats and graphics APIs use alpha, not transparency,
so change our internal formats and data structures to work directly
with alpha, so we don't need to modify data before we push it to
graphics APIs.

Add a couple of new Color constants to make the intention
of the vcl code clearer.

Notes
(*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask
to more accurately reflect the requirements of the
CGImageCreateWithMask function seems to fix some
tests.

(*) The vcl code does not properly support gradients
with transparency. So the previous code was wrong, and this
change is going to result in slightly different wrongness.

Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-25 08:38:12 +02:00
Tomaž Vajngerl
f896bbcffe basegfx: replace typedef with a class B2ISize based on Size2D
Change-Id: Iaf7d02bb236f81a38a67a1430a718b6c3c78efae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139708
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-13 13:19:00 +02:00
Khaled Hosny
199dbff478 tdf#147999: Fix canvas font width for fallback fonts on Windows
For some reason we are getting the wrong font width for fallback fonts, which
results in rendering them squished. This happens only with VCL canvas, but not
with DX one, so it shows when hardware acceleration is disabled (either
explicitly or implicitly when Skia is enabled).

Change-Id: I5a45b1c1d68f4c6e6dd6b43371602af3330a7cd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154272
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-10 17:57:42 +02:00
Noel Grandin
13d7184351 make tools::Poly*gon single-arg constructors explicit
which will help avoid ambiguity in method calls in an upcoming patch

Change-Id: Ic7607ac7d95559e0942a84fb3226cfdd6ade22bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154146
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-06 20:28:05 +02:00
Noel Grandin
cea402a5ad ScanlineFormat::N1BitLsbPal is unused
ever since
    commit 4160be791d
    Author: Caolán McNamara <caolanm@redhat.com>
    Date:   Tue Jan 10 20:55:31 2023 +0000
    no more X11SalBitmap

Change-Id: I9dd55acdde6af1bf7501a71e92725ab739801b0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154060
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-06 08:43:13 +02:00