543 Commits
Author SHA1 Message Date
Mike Kaganski c3cae7d482 drawinglayer,svx: ask for an artifact instead of faking a tag
I9431c460cade3d432cb7abf76930e23f8106a7f1 ("tdf#168462 svx: mark the
slide background as an artifact") left page decoration reaching its
/Artifact by a lie: VclMetafileProcessor2D emitted one only for a
background image, and dropped a tag naming NonStructElement, so the
tag claimed to be a Division and an image. Decoration now says so
itself: the artifact decision reads the decorative flag, and the
caller passes NonStructElement and no image and means them. A
background image keeps its own path to an artifact.
isTaggedSdrObject() becomes opensStructureElement(); its comment
still claimed every one of these primitives comes from an SdrObject.

The exported file is unchanged. The one call that goes away with the
old predicate, alternative text on a tag that opens an artifact,
could not reach the file either: setAlternateText writes nothing
without m_bEmitStructure, and checkEmitStructure() is false inside a
NonStructElement. operator== now compares the element and the
decorative flag, which decide what comes out and were not compared.

Letting a master slide's own shapes out as artifacts does not follow
from treating every background as decoration. A background object can
hold tagged children, and a Paragraph begun inside an artifact opens
no marked content at all; tried on testTdf135192, three pieces of its
content came out in no marked-content section. Something narrower has
to tell the two apart.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Id0fc0d9bee36e8182702d77e9ac9647709a63f68
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12321
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9353a1cac3e8056d175acc29dbeecc79ff1cdcd4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211170
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-09-21 00:20:39 +02:00
Andrea Gelmini 9c704826bb Fix typos
Change-Id: Ief7455c1b1955c292022f6a6e3b8c601a34bd8a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210442
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-03 08:53:27 +02:00
Andrea Gelmini 30cc365def Fix typos
Change-Id: I42e6c0c272cd5b83bb2747d938049a64d4b19936
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210443
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-09-03 08:50:28 +02:00
Andrea Gelmini 4f86cfa577 Fix typos
Change-Id: Ic09e8f2877a7106eb074586662d1733828d85197
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209422
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2026-08-21 14:19:46 +02:00
Tomaž Vajngerl 03f0efdd07 svgio: fix rendering, which makes SVG images 1px bigger
We added a rectangle using PolygonHairlinePrimitive2D to the
HiddenGeometryPrimitive2D, so we can mark the boundary of the
SVG image. The problem with using the hairline primitive for this
is that the hairline size is grown by 0.5 in each direction
(implGrowHairline, which is called in getB2DRange), which also makes
our SVG size 1px bigger than it should be.

Using FilledRectanglePrimitive2D instead fixes this problem as the
rectangle isn't grown in size.

Also needed to change a lot of tests that were using SVG images
and asserted the size of the image in ome way.

Change-Id: Ic2aa98b3df1f0746e4cfbd3474b6a93d0f4072ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200440
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit aa2c07951b565cd5464a36a2b0721f888ab8531c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200433
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-19 09:28:32 +02:00
AsmatZahra-code 13fe616b01 tdf#143148 use pragma once in drawinglayer headers
Replace include guards with #pragma once in drawinglayer headers
under attribute/, geometry/, processor2d/, processor3d/, tools/.

Change-Id: Ib638a2602ecb60d62dafb556f480b0955c33858c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204556
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-01 22:56:57 +02:00
Khaled Hosny a9dc959cc9 vcl: Rename vcl::FontVariation to vcl::font::Variation
For consistncy, similar to vcl::font::Feature.

Change-Id: Idf3673bf1a1690e0ec64b6459925abef6e41b40d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203272
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2026-04-07 05:20:00 +02:00
Khaled Hosny 8672c952eb tdf#171624: Carry font variations through drawinglayer text primitives
Change-Id: I6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203248
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-06 17:13:36 +02:00
Andrea Gelmini 1a70694e33 Fix typo "then"->"than" + "its" -> "it's"
Change-Id: I5386ca02fdcd415eb56f9a593d180ac991d88656
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202914
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-03-29 09:50:27 +02:00
Krunal Baraskar 034df68d3d tdf#143148 Use pragma once instead of include guards
Change-Id: I4392148bcc1b90a8343af5ae2145be8fa8deef03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201583
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-03-13 12:35:52 +01:00
Samuel Mehrbrodt 341a1e34a6 tdf#168135 Fix text highlight for superscript/subscript
Text highlight for superscript/subscript now has the same size
as 'normal' text

Change-Id: If2bce2abd1cc1188f542a7de8c7b55d27c2cecc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201010
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201543
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
Tested-by: Jenkins
2026-03-13 08:45:54 +01:00
Khaled Hosny 5825e9cfdb tdf#153368: Support optical size for variable fonts, part 8
Channel optical sizing option through drawing layer, otherwise it
doesn’t work in Draw/Impress.

Change-Id: I96cd3177dcf816b5c1e065663d4a8c90f187704f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200765
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-03-02 21:46:13 +01:00
Gabor Kelemen eb087d25b3 tdf#146619 Use more forward declarations in include/drawinglayer
Change-Id: I5911dfb1cfc2bfd291758334b69123cfbce559a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199387
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-22 12:08:33 +01:00
Simon Chenery 7114e4c2c9 tdf#143148 include guards to pragma once in include/drawinglayer/primitive3d
Change-Id: Ic32106456f52ca594d5ca994bfded6be2317853c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198776
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-02-12 23:30:45 +01:00
Gabor Kelemen f8dad0daf9 tdf#146619 Use more forward declarations in include/vcl/svapp.hxx
this was skipped in previous runs, since it contains some code behind #if

After inspecting these, it seems like the removals should not cause trouble.

Change-Id: If1e3e3c7c0fc14ed6e8b51174a0e7f1220fdbc8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197496
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-25 13:31:57 +01:00
Noel Grandin abfe481b06 BufferedDecompositionFlusher speed up shutdown
use a condition_variable to speed up termination,
or we could spend up two seconds waiting to join the background thread

Change-Id: I775a21f01eb55c7529304b5a9da3db157610be83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192904
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-10-24 10:12:35 +02:00
Caolán McNamara f2e8dc899d prevent BufferedDecomposition[Group]Primitive2D from being resurrected
The BufferedDecompositionFlusher thread is waiting for the SolarMutex
and has accumulated a bunch of rtl::References to Primitive2Ds in
aRemoved[1|2] created from direct pointers to Primitive2Ds during the
earlier phase.

Thread 6 (Thread 0x7fd2e27fe6c0 (LWP 3729389)):
 #0  0x00007fd313d3012b in  () at /lib/x86_64-linux-gnu/libc.so.6
 #1  0x00007fd313d364da in pthread_mutex_lock () at /lib/x86_64-linux-gnu/libc.so.6
 #2  0x00007fd3140a75f1 in osl_acquireMutex(oslMutex) (pMutex=0x556f87223470) at sal/osl/unx/mutex.cxx:93
         nRet = 32723
 #3  0x00007fd30e02be53 in osl::Mutex::acquire() (this=0x556f87223968) at include/osl/mutex.hxx:63
         pInst = 0x556f87223830
         __PRETTY_FUNCTION__ = "virtual void SvpSalYieldMutex::doAcquire(sal_uInt32)"
 #4  SvpSalYieldMutex::doAcquire(unsigned int) (this=0x556f87223960, nLockCount=1) at vcl/headless/svpinst.cxx:376
         pInst = 0x556f87223830
         __PRETTY_FUNCTION__ = "virtual void SvpSalYieldMutex::doAcquire(sal_uInt32)"
 #5  0x00007fd312bcd4fc in comphelper::SolarMutex::acquire(unsigned int) (this=<optimized out>, nLockCount=nLockCount@entry=1) at include/comphelper/solarmutex.hxx:86
         __PRETTY_FUNCTION__ = "void comphelper::SolarMutex::acquire(sal_uInt32)"
 #6  0x00007fd312bcd6bd in osl::Guard<comphelper::SolarMutex>::Guard(comphelper::SolarMutex*) (this=<optimized out>, pT_=<optimized out>) at include/osl/mutex.hxx:137
 #7  0x00007fd312bccd53 in drawinglayer::primitive2d::BufferedDecompositionFlusher::run() (this=0x7fd2d4159230) at drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx:154
         aGuard = {pT = 0x556f87223960}
         aNow = {__d = {__r = 64556205175663173}}
         aRemoved1 = std::__debug::vector of length 1155, capacity 2048 =

The active thread 1 asserts that the reference count of a
SimpleReferenceObject isn't zero during dtor.

Thread 1 (Thread 0x7fd2e2fff6c0 (LWP 3726667)):
 #21 0x00007fd313c2760a in salhelper::SimpleReferenceObject::~SimpleReferenceObject() (this=this@entry=0x7fd2d62f51f0, __in_chrg=<optimized out>) at salhelper/source/simplereferenceobject.cxx:29
 #22 0x00007fd312bcbc57 in drawinglayer::primitive2d::BasePrimitive2D::~BasePrimitive2D() (this=this@entry=0x7fd2d62f51f0, __in_chrg=<optimized out>) at drawinglayer/source/primitive2d/baseprimitive2d.cxx:34
 #23 0x00007fd312bcc368 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::~BufferedDecompositionPrimitive2D() (this=this@entry=0x7fd2d62f51f0, __in_chrg=<optimized out>) at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:69
 #24 0x00007fd310300136 in drawinglayer::primitive2d::SdrGrafPrimitive2D::~SdrGrafPrimitive2D() (this=0x7fd2d62f51f0, __in_chrg=<optimized out>) at svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx:29
 #25 0x00007fd310300141 in drawinglayer::primitive2d::SdrGrafPrimitive2D::~SdrGrafPrimitive2D() (this=0x7fd2d62f51f0, __in_chrg=<optimized out>) at svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx:29
 #26 0x00007fd312bcc5d3 in salhelper::SimpleReferenceObject::release() (this=<optimized out>) at include/salhelper/simplereferenceobject.hxx:83
 #27 0x00007fd312bd1e63 in rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D>::~Reference() (this=0x7fd2d62f4b10, __in_chrg=<optimized out>) at include/rtl/ref.hxx:126
 #28 std::destroy_at<rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> >(rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D>*) (__location=0x7fd2d62f4b10) at /usr/include/c++/12/bits/stl_construct.h:88
 #29 std::_Destroy<rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> >(rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D>*) (__pointer=0x7fd2d62f4b10) at /usr/include/c++/12/bits/stl_construct.h:149

So, what if a BufferedDecompositionPrimitive2D was registered with
BufferedDecompositionFlusher, so a direct pointer to it exists.

On Thread 0 the BufferedDecompositionPrimitive2D ref count hits 0,
dtoring starts.

Meanwhile Thread 6 merrily spins its loop, creates a rtl::Reference from
the BufferedDecompositionPrimitive2D, ref count goes back up to 1.

BufferedDecompositionPrimitive2D::dtor gets around to unregistering
itself from BufferedDecompositionFlusher, but that doesn't matter
because the rtl::Reference to the primitive already exists in aRemoved,
dtor hits assert that refcount isn't 0

Change-Id: Iac0a03bb7cbadf949ba1ac00d69cf15cc2505e18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192674
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-10-23 15:46:19 +02:00
Noel Grandin 5707b5dce7 tdf#101083 speed up SVG rendering with pattern fill (2)
This is the same thing I did in

    commit 3cbe3a0259
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Mon Jun 14 15:05:59 2021 +0200
    tdf#101083 speed up SVG rendering with pattern fill

but cut and paste from the VclPixelProcessor2D to the CairoPixelProcessor2D code.

Which makes this SVG render in reasonable time when using the cairo backend.

We can probably do even better by cutting out the usage of VCL here, but this
is good enough for now.

Change-Id: I959539741eef627b25702c91cad3e5f8ee2b3176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192394
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-10-15 10:38:31 +02:00
Gabor Kelemen becdd99f2c tdf#146619 Run IWYU again on include/[d-e]*
Change-Id: Iec01747b87d93a0a7c6907ea1518dec026f38836
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191911
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-10-14 11:02:17 +02:00
Caolán McNamara 153b4dc2e0 drop some more COVERITY stuff
Change-Id: I5964880c3eb62875c45e3262a9c657f7bade236d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191946
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-10-06 11:22:01 +02:00
Noel Grandin 98a41e2c7b loplugin:unnecessaryvirtual
Change-Id: Ifdd8b4c156d9d4a14e76b51c22cf915ef0b0237e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191609
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-29 14:14:41 +02:00
Khaled Hosny 1bdf1e2d52 tdf#168371: Disable ligatures in Impress/Draw with character spacing
This is follow up to commit:

commit b9f0caad5d
Author: Khaled Hosny <khaled@aliftype.com>
Date:   Tue Aug 23 04:13:28 2022 +0200

    tdf#66819: Disable ligatures with character spacing

Even though editengine was applying letter spacing, when drawing with
drawinglayer, letter spacing was not propagated which caused VCL to not
disable the ligature features.

Change-Id: Ia8bf2231478720262484a757e16fe5afec3cd28e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191512
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2025-09-25 18:52:49 +02:00
Noel Grandin 6d0e5ddede remove BitmapEx
all use-sites have been converted to Bitmap

Change-Id: I1a8842217a266eef100bd387ab013b004e532256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190618
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-09-05 19:45:45 +02:00
Noel Grandin fc124142eb BitmapEx->Bitmap in various comments
leftovers from earlier conversions

Change-Id: Ia6df2a70eb1eed25dbdcc45654a6466177f0ddfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190610
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-05 11:18:39 +02:00
Noel Grandin d00361bbb9 loplugin:unusedmethods
Change-Id: I89922f71f6bc7120410a8710e51240dd548f0fd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190578
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-09-04 17:59:37 +02:00
Noel Grandin 7caf45bc06 BitmapEx->Bitmap in HitTestProcessor2D
now that Bitmap supports transparency

Change-Id: Iae2f30e9acdbbf1ed7d7ca700f8c75810f8849f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189616
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-15 07:21:49 +02:00
Noel Grandin 50ec3c43d6 use Bitmap in createTileImage
now that Bitmap supports transparency

Change-Id: I751c3a1ae79eb448f7668a76353483cd55db365f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-15 07:21:39 +02:00
Noel Grandin f3522ba36c use Bitmap in extractBitmapFromBaseProcessor2D
now that Bitmap supports transparency

Change-Id: Ia4e15cfee6b4d223d3fd4324c6c8f7a9186cd4ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-14 18:06:26 +02:00
Noel Grandin cbd59a9897 use Bitmap in drawinglayer::convertToBitmap
now that Bitmap supports transparency

Change-Id: Ib35d91c1742c2126bef878251eb0ea4de87d425d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189596
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-14 18:06:16 +02:00
Noel Grandin 2e8c9aeb10 use Bitmap for convertPrimitive2DContainerToBitmapEx
now that Bitmap can support transparency

Change-Id: I507d1451e0643ec941f2a72a32db56cccda40b0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189591
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-14 16:31:52 +02:00
Noel Grandin 873a848cad BitmapEx->Bitmap in BitmapAlphaPrimitive2D
now that Bitmap supports transparency

Change-Id: Ia0ce9eff727a67326d218eb8f3dfd1e926db2c2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189137
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-11 21:36:17 +02:00
Noel Grandin 0655d5b6b5 BitmapEx->Bitmap in BitmapPrimitive2D
now that Bitmap supports transparency

Change-Id: If3646b64712836c09a274d6b1bcdd7367ce54a6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-11 21:17:56 +02:00
Noel Grandin 0e45308b44 BitmapEx->Bitmap in DiscreteShadow
now that Bitmap supports transparency

Change-Id: Ic8ea9d519378b73e7b97c2fbca3f50c53be29a70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189071
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-08 09:02:21 +02:00
Noel Grandin 2cb59865f7 BitmapEx->Bitmap in DiscreteBitmapPrimitive2D
now that Bitmap supports transparency

Change-Id: I2f15d5385fa01d5814bccb628d47ac6d85475538
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189070
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-08 09:02:09 +02:00
Noel Grandin bacd1b5dc4 BitmapEx->Bitmap in FillGraphicPrimitive2D
now that Bitmap supports transparency

Change-Id: I9762dadae840e8eaec37526f82068183474c7962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189069
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-07 22:04:36 +02:00
Noel Grandin ec177c313c BitmapEx->Bitmap in ScenePrimitive2D
now that Bitmap can handle transparency

Change-Id: Ie0ffa2cc8f74232be7770c5f8813536980084d67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189068
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-07 16:16:11 +02:00
Noel Grandin 8806772d4d BitmapEx->Bitmap in GridPrimitive2D
now that Bitmap supports transparency

Change-Id: Icdeb1c51f0681675087c49f52a534b11a9ec4e02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189067
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-07 15:25:46 +02:00
Noel Grandin a04bef2419 BitmapEx->Bitmap in MarkerArrayPrimitive2D
now that Bitmap supports transparency

Change-Id: I72f649ab39388281834682efe9325e0698734fee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189025
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-08-07 10:42:59 +02:00
Armin Le Grand (collabora) a841f2fd0d Added DrawModeFlags to ViewInformation2D
This allows setting/using DrawModeFlags system-independent
(or: renderer-independent). Changing and applying to a
PrmitiveRenderer will apply that (if needed) to the target
renderer.

Change-Id: Id95d018f95d1b2ff065da5e4d05ba385b22cdbb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188704
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
2025-08-01 16:13:53 +02:00
Noel Grandin b046e5f160 BitmapEx->Bitmap in SdrExchangeView
now that Bitmap can handle transparency

Change-Id: Id54be05c5d026bfc35d131ce62e496268ee0c8ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188660
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-07-31 20:14:24 +02:00
Armin Le Grand (collabora) d569a6b335 tdf#167511 Added use of DrawModeFlags to CairoSDPR
Did the necessary now, despite it would be better to apply
that where the geometry gets created (primitives) or painted
(older direct-apints to OutputDevice).
Instead it's in Outputevice where care is taken to apply
changes based on DrawModeFlags. Remember that this is then
done in the renderer.
This will need to be done in every renderer in the future
then. It is traditionally done in OutputDevice, completely
missing in PresentationMode and added now to CairoSDPR.

Problem is that it is not defined how to apply that, e.g.
(even in OutDev) painting text may lead to decompose and
fill the resulting polygons, so the ::*Fill flags are
applied while I think the ::*Text ones should be used.

I looked a lot at OutDev and what it does and tried to
mimic it as good as possible, but cannot give guarantees,
as mentioned in the example above.

If we assume that (as usual) the definition of what should
happen is the existing stuff when using OutDev this might
cause some further errors/regressions in HighContrast
and Black/White/Gray/Settings stuff. Luckily most of that
seems to be used in UI/Button rendering when using
OutDev, so should not lead to big problems. OTOH if
we want to use SDPRs for that in the future we would need
that anyways...

One more note: the fixes already applied may be removed
again after this is applied.

Change-Id: Ie6eb1cd4ee51c62beb950030a0a5d00d3705be61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188527
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2025-07-31 16:51:35 +02:00
Armin Le Grand (collabora) a7c39fb097 Allow changing ViewInformation2D in BaseProcessor2D
In OverlayManager rendering AA state is set at the target
OutputDevice, this obviously only works if the target
renderer *is* an OutputDevice, thus not with e.g. CairoSDPR.

Thus I added changing ViewInformation2D in BaseProcessor2D
directly. This simplifies if changes to a primitive renderer
have to be made while it's lifetime.

All other aspects of ViewInformation2D can of course also
be changed. There were occasions in the past where working
around this was needed, this is then obsolete.

Since e.g. setting AA at the target renderer which
may not always be an OutputDevice makes this also target
device independent - the primitive renderer is the instance
that knows how to apply this correctly.

Change-Id: I1836d08d0844dfed81bb84e8fccbe3fabe2831c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188220
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2025-07-23 15:06:36 +02:00
Noel Grandin 0f625fb713 tsan: fix data race in BufferedDecompositionFlusher
WARNING: ThreadSanitizer: data race (pid=271122)
  Write of size 8 at 0x7244000becc0 by main thread (mutexes: write M0):
    #0 drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /home/noel/libo-tsan/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:90 (libdrawinglayercorelo.so+0xb986)
    #1 drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/baseprocessor2d.cxx:43 (libdrawinglayerlo.so+0x1284cf)
    #2 drawinglayer::processor2d::CairoPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx:4230 (libdrawinglayerlo.so+0x7a370)
    #3 drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/baseprocessor2d.cxx:67 (libdrawinglayerlo.so+0x1286f1)
    #4 drawinglayer::processor2d::CairoPixelProcessor2D::processMaskPrimitive2D(drawinglayer::primitive2d::MaskPrimitive2D const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx:1919 (libdrawinglayerlo.so+0x6fbd9)
    #5 drawinglayer::processor2d::CairoPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx:4103 (libdrawinglayerlo.so+0x7a33c)
    #6 drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/baseprocessor2d.cxx:67 (libdrawinglayerlo.so+0x1285f1)
    #7 drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/baseprocessor2d.cxx:54 (libdrawinglayerlo.so+0x1285f1)
    #8 drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const /home/noel/libo-tsan/include/drawinglayer/primitive2d/groupprimitive2d.hxx:76 (libdrawinglayercorelo.so+0x1c51b)
    #9 drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /home/noel/libo-tsan/drawinglayer/source/primitive2d/groupprimitive2d.cxx:53 (libdrawinglayercorelo.so+0x1c51b)
    #10 drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /home/noel/libo-tsan/drawinglayer/source/processor2d/baseprocessor2d.cxx:43 (libdrawinglayerlo.so+0x1284cf)

  Previous read of size 8 at 0x7244000becc0 by thread T299 (mutexes: write M1):
    #0 std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::time_since_epoch() const /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/chrono.h:950 (libdrawinglayercorelo.so+0xcd6f)
    #1 std::common_type<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >::type std::chrono::operator-<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/chrono.h:1143 (libdrawinglayercorelo.so+0xcd6f)
    #2 drawinglayer::primitive2d::BufferedDecompositionFlusher::run() /home/noel/libo-tsan/drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx:133 (libdrawinglayercorelo.so+0xcd6f)
    #3 threadFunc /home/noel/libo-tsan/include/osl/thread.hxx:189 (libdrawinglayercorelo.so+0xe0ee)
    #4 osl_thread_start_Impl(void*) /home/noel/libo-tsan/sal/osl/unx/thread.cxx:237 (libuno_sal.so.3+0x6b419)

Change-Id: Ie7afe0501d0d562117fc4418a3fe24853397aefe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187238
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-07-01 16:28:58 +02:00
Noel Grandin b17e0bb5ca tdf#166922 reduce memory usage in BufferedDecompositionFlusher
which was keeping stuff alive for too long.

regression from
    commit 8a17b7f0a6
    Author: Noel Grandin <noelgrandin@gmail.com>
    Date:   Thu Mar 13 18:37:54 2025 +0200
    tdf#131595 Improve drawinglayer flushing mechanism.

Change-Id: I82c3e11d027b22a969d2ce786a0945fea2deb6b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186389
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-06-12 10:22:45 +02:00
Noel Grandin 4db0dedc52 loplugin:finalclasses
Change-Id: I56ba3f1d6a3bf90f1b3923ef54745a1582d6c85e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185541
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-05-20 13:25:08 +02:00
Caolán McNamara ac6c7b4f82 ofz#409354664 Heap-use-after-free
there is no DeInitVCL in fuzzing, so if the BufferedDecompositionFlusher
thread is started nothing causes it to exit before _exit.

Change-Id: I62463ce8126a0cf0c67f4218bdf66a140f3a021d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184731
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-04-29 09:32:19 +02:00
Manish e23e0132d5 tdf#143148 Use #pragma once instead of include guards
Change-Id: I1a7a8b924fcd3f5e909ab42f560efb6f8d87654e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183415
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2025-03-28 12:00:59 +01:00
Noel Grandin 6fd5570cc9 fix BufferedDecompositionFlusher some more
if the onShot() method is processing a lot of work, and at the same
time teardown happens, it might managed to restart itself after teardown.

What ended up being easiest is making this its own thread, and calling
shutdown() on that thread from DeInitVCL.

See notes in BufferedDecompositionFlusher.cxx.

Change-Id: I70fecb259c6e74d2c102065696f7ae2bed15cab6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183320
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-03-26 12:48:33 +01:00
Noel Grandin 8b21dd5ce3 loplugin:constparam in drawinglayer
Change-Id: I7921dc085e348945f8f14c12a15ed6c5414f298e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183294
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-25 13:16:26 +01:00
Armin Le Grand (Collabora) 7a1de78ec2 tdf#165706 additional taking care in CairoSDPR
The task is fixed with the previous commit for this tdf
number, but convinced me to do also some more safe stuff
in the CairoSDPR implementation.

The associated OutputDevice *is* now handed over to
CairoSDPR and some stuff being done in the helper to
create the SDPR is now done directly in the CairoSDPR
constructors.

Also the FormControl rendering is now closer to what the
VCLPrimitiveRenderer does, to be on the safe side. It
is still just the FormControl rendering that indirectly
uses the associated OutputDevice, but more convenient.

The CairoSDPR now also (as VCLRenderer) resets the
MapMode in the associated OutputDevice for the time
using it - just in case there might be other *indirect*
usages like the FormControl one.

Change-Id: I5029788655ff81bf360d98312d417b7886208e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183204
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
2025-03-24 10:55:52 +01:00