summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2024-12-05lok: slideshow: handle text object in edit modeMarco Cecchetti
This patch allows to render a text object in edit mode by decomposing a TextHierarchyEditPrimitive2D instance in place of using TextEditDrawing. That avoids to have artifacts displayed while playing the slideshow such as a tiny rectangle around the edited text shape. Moreover it allows to animate a single paragraph even when the related text object is in edit mode. Change-Id: I0c27dc0953dd1b0fb7ae70f41e569587f3a623ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177755 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-10-26tdf#157240: also set font color together with fontMike Kaganski
Commit b008831a5545e5a777d77547ef96b9798d795f30 (tdf#152990 set the font after the MapMode is (potentially) set, 2023-01-14) had moved setting of font forward, but left setting the font color behind. This fixed that. Change-Id: I73fadc7c139da3b6f84b7fc875c585d02fc1c719 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166654 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 1112a2bea0cb260fd64360b679c3f0f5c495e16e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175486 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 69d8872fafbc6eab9f895f5c84355fa77e71ca3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175612 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2024-10-10slideshow: Render each animated paragraph in its own layerTomaž Vajngerl
We need to render each animated paragraph of a SdrTextObj in its own layer. This is not easy to do, so modify the PrimitiveContainer after rendering and turn off all the paragraphs that shouldn't be rendered. In addition also turn off rendering of the object itself (the fill and stroke). This can be done by setting the newly added setVisible method on the desired TextHierarchyParagraphPrimitive2D to false (and others to true), and turning the primitives to render the object to setVisible = false. If the primitive is not "visible" it will be skipped in the when rendering with VclPixelProcessor2D. Also changes the SlideshowLayerRenderer to take into account the rendering of paragraphs. We remember all the paragraphs for an text object that are animated, then we take this into account when we do render passes. We also need to take care of the paragraph hash, which needs to be set consistently for all animated paragraphs (so the layers can be identified correctly for animated paragraphs). Change-Id: Ice3b9e1f586c3fca81cf5da809fa88c4b9c87c37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173939 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-07-16tdf#161990: take MapMode's origin point into accountMike Kaganski
Regression from commit cc3663bbaed4f65d64154e5f9abb51a5f622f710 (tdf#160702: improve text positioning, 2024-04-20). Change-Id: I03f461d7f03c3e67ccdb8c4376720feb69903d6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170432 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit ccc3996cfcbebe14e9d5f3511906cfc64ddf3452) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170466 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2024-07-03crashtesting: divide by zeroCaolán McNamara
since: commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9 Date: Fri Jun 21 12:28:30 2024 +0200 tdf#161086 bitmap location wrong with SVG with an embedded PNG bodge it by using the requested width/height and not the possibly zero on fail actual sizes Change-Id: Ic55ba6ce3cc14fa598299cdd1f844ee7c63fb174 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169800 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins (cherry picked from commit af2175bb87b8e8a7184916e110e2b22ec542357d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169815 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-06-29tdf#161086 bitmap location wrong with SVG with an embedded PNGNoel Grandin
we need to transform the location of the wallpaper rect to match where we want the wallpaper to start tiling from. regression from commit 3cbe3a0259bea4dec70e72191ec3c03441926a07 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 Change-Id: I624edd63135875fdc9526015f0f5642d5c694934 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169485 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-27tdf#161222: LOK: do not fine-tune text scaling for tile renderingMike Kaganski
For unclear reason, this shifts text on all tiles except the top left one. I wasn't able to track where the coordinate is changed: it seems that the pixel offset of the virtual device, its MapMode's origin, as well as the start point passed to the DrawTextArray method, are all only changed by a tiny amount, if at all, so it should be no more than a pixel off compared to before commit cc3663bbaed4f65d64154e5f9abb51a5f622f710 (tdf#160702: improve text positioning, 2024-04-20). However, it is already more than half the tile size (more than 128 pixel) offset in 75% scale case for the second tile; and it's completely off the tile for all the rest (third+ in a row), and for greater scales (100%+) even for second tile. Change-Id: I64dc24bea4bab0cac90f11f2500bba0fd9bc7855 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168041 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins (cherry picked from commit c9571914b8170128a68496ec2dd299e21243d1c1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168055 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-05-08Fix a thinko in 8a97f1ba8d9ccb65b2c89106de20666311d90c30Mike Kaganski
Change-Id: I07bb67e9384470269d1fd3df087acee377cce729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166490 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167052 (cherry picked from commit d1c31e3857b7f0c6b3fb72da0c967bfa2bdef015)
2024-05-08tdf#160773: handle 0-size font heightMike Kaganski
Regression from commit cc3663bbaed4f65d64154e5f9abb51a5f622f710 (tdf#160702: improve text positioning, 2024-04-20), where I didn't know yet that this was possible :-) Change-Id: I1316db48b8acbacd077eeb4a8989c3dbf7e4a7b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166425 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167051 (cherry picked from commit 14c7b4249e822c218f912fcd3707226081363f7a)
2024-05-08tdf#160702: improve text positioningMike Kaganski
Opening an SVG with text in different elements (e.g., tspans) in the same text element performs calculations to position the parts properly (i.e., the next part will start where the previous part ended, unless the position in overridden explicitly). These calculations require to know the text widths. The first problem leas here: the text width was calculated for a typically small text size (numerically equal to the pixel size defined in the SVG), but these calculations aren't truly linear, because font rendering may change depending on font height. Additionally, the rounding gives much higher error in smaller sizes than in larger. There was already a workaround for a similar problem in ViewRedirector::createRedirectedPrimitive2DSequence, where a large font (with 100 times greater height) was used to increase correctness. This was also used here, with the same large height (50000) used as a reference. Then, at the time of wrawing the text at different zoom levels, the code in VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D creates a font of a calculated size, and uses it to output the text. But the font is always created with an integral height, which means, that for a wanted height of 2.5 (in a zoomed out view), the really used height will be 3, which is 20% larger; or for wanted height of 2.4, the actual height will be 2 (20% smaller). This resulted in odd jumps of the text widths, when the text may overlap the following part, or conversely, create a big gap before the next gap. To try to mitigate that, the function now takes the difference between the wanted and the actual font size into account, and adjusts the MapMode accordingly. This doesn't fix the jumping completely (e.g., because of the mentioned special handling of small font sizes in the fonts thenselves, like hinting), but still makes the calculations much more stable, decreasing the amount of jumping. Similar changes are made in TextLayouterDevice. Use of the functions that return text size as a double, not rounded value, should additionally help improving stability. Change-Id: I455845d8ca43ee9c06a0fc980947f35d8a25797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166238 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166468 (cherry picked from commit 5a25899a9c5c0c4e6fb92ca355ea1e24cec3a747)
2024-05-08tdf#160622: Let SalLayout::GetBoundRect return basegfx::B2DRectangleMike Kaganski
This avoids premature rounding in TextLayouterDevice::getTextBoundRect. The box in D2DWriteTextOutRenderer::performRender needs to be expanded to allow room for the line width (which now will be guaranteed on all sides; previously, the rounding could happen to give no room on some side, even prior to commit 8962141a12c966b2d891829925e6203bf8d51852). Fixes some lines partially cut off in smaller text (or zoomed out). Change-Id: I07335136021f894cf045363b4d736bfab06c64d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167014 (cherry picked from commit aa2df54f37926cf95261eefade1b87da3229cfd7)
2024-03-27tdf#159094 sc: fix failure when exporting media files to PDFTibor Nagy
Change-Id: I948190b31f45cf05ba24d1fbc4a84dfe91eb3876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164557 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164976
2024-03-07tdf#159515 rename impGetTransparence() to impGetAlpha()Patrick Luby
Commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 makes impGetTransparence() return alpha instead of transparence. So, rename the function and skip reverting the result to obtain the alpha value. Change-Id: Ied3bf8ae4a0de2ae36074dba9f78ccc93480b15a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164322 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Patrick Luby <guibomacdev@gmail.com> (cherry picked from commit b4caea04cb63cbdc25bab871a5b20aa16e2f3a77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164371 Tested-by: Jenkins
2024-02-28if a SdrTextObj is being edited then TextHierarchyEditPrimitive2D existsCaolán McNamara
instead of the usual content, so actively edited shapes are different. Change-Id: I8c65a59b1724152d488f3b0ca83ec744207b0fa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164031 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
2024-02-23optimize the text drawing, that's what we do most ofCaolán McNamara
maybe the alternative branch should be dropped, turned into a debugging option because it is obscure and presumably doesn't result in better results that using the platform text rendering Change-Id: Ief6882f7acf8737ca64b10e74e5d94aade60d71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163811 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-23Drop some wrapper methods from SvtOptionsDrawinglayerGabor Kelemen
just use the wrapped officecfg methods instead of: IsSolidDragCreate IsRenderDecoratedTextDirect IsRenderSimpleTextDirect GetQuadratic3DRenderLimit GetQuadraticFormControlRenderLimit IsTransparentSelection Change-Id: Ie0f3ec0f8fdbbf08facfff1a372c666c8a0c8979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160654 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163792 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-23split TextAsPolygonExtractor2D for more general reuseCaolán McNamara
Change-Id: I102ccab2a423c38b0414c9565fec349aa6ffb5af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163725 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 006a8e3186c26c43560b2d616dde453437a49b47) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163766 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2024-02-06tdf#108037 Reduce time and memory consumed exporting to PDFNoel Grandin
by avoiding making multiple copies of the Primitive2D container that we pass to TransformPrimitive2D. Instead, make TransformPrimitive2D store its children using a GroupPrimitive2D, which means we can share the GroupPrimitive2D among all the TransformPrimitive2D instances we create. Change-Id: I8a4398f9db6a6ab013ee24ad53836975fba6f3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 1ae7a81e542c9b072e519d0ea0d4773ed26ca251) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162908 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-16chart2: Make automatic area coloring for charts work for tiled renderingofftkp
Charts now get a temporary colored applied to the area property set if their color was set to automatic, which is done by default in tiled rendering mode. Change-Id: Ic6bd19b97d2a0ffa2a1ad516cfa202e2f4921db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160659 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-01-153D SW-Renderer: Add functionality to balance quality/speedArmin Le Grand (allotropia)
For this purpose allow reduced 3D quality in some circumstances and make a compromize between quality and speed. This is balanced between those two targets, fine-tuning/experimenting can be done with some static local values if needed. Change-Id: Ib00b6e9c3c3ff165d82ff12d23bf15196f0a0ee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160467 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-05tdf#158743 use maCurrentTransformation for embeddingArmin Le Grand (allotropia)
Seems to be an error in the preparation to Bitmap conversion in VclMetafileProcessor2D::processTransparencePrimitive2D. While for calculating the LogicRange maCurrentTransformation is used (and that is correct) it is *not* used in the embedding for calling convertToBitmapEx. It is correct to get back to logic/world coordinates for calculating the embedding, but maCurrentTransformation is needed to define the correct full embedding. I might have overlooked that in the original change because maCurrentTransformation is local to the VclMetafileProcessor2D in action right at that moment and is usually empty for simple cases, but - as can be seen - not always. Change-Id: Ib2deaa2c8328655ecc80964ba2e23e67964ac3ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161409 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 4bea19cf84c125ab3f66dbb40d2379f2d385a865) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161429 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-12-29Related: tdf#158807 mutex must be locked when disposing a VirtualDevicePatrick Luby
If the following .ppt document is opened in a debug build and the document is left open for a minute or two without changing any content, this destructor will be called on a non-main thread with the mutex unlocked: https://bugs.documentfoundation.org/attachment.cgi?id=46801 This hits an assert in VirtualDevice::ReleaseGraphics() so explicitly lock the mutex and explicitly dispose and clear the VirtualDevice instances variables. Change-Id: I5d371a4e99fca4aae2b6edc8b53eca10cb143aef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161243 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@libreoffice.org> (cherry picked from commit 0f8ad0f55e118f1f016b250de0c7940c7e21062a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161218 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin
(*) 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-06make AlphaMask separate from BitmapNoel Grandin
Having it subclass Bitmap encourages confusion in passing it around, and I need the extra type-safety for my work on merged-alpha Change-Id: I35819f9b8ee609cbdaf865563c78531e397b529b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160235 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-03Split the *Bitmap::CopyPixel functionsNoel Grandin
into the two entire separate cases they want to handle, there is no reason to mix the two different cases like this. Change-Id: I38e99e7ad6168a84e7a744f61407887825158902 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160248 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-03ProcessAndBlurAlphaMask should take an AlphaMask as paramNoel Grandin
Change-Id: I9235e74499d95750ca93da050014657b418c27d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-27tdf#158302 fix build against system-libxml-2.12Miklos Vajna
Seen in a fedora:40 container, using --with-system-libcmis, --with-system-liblangtag and --with-system-xmlsec. Change-Id: I9d748d3dc0b70dbfdfcb6b99c9ce8440bda6f326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159980 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-21tdf#157558 invert and remove blended white colorPatrick Luby
Before commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, RemoveBlendedStartColor(COL_BLACK, aAlpha) would darken the bitmap when running a slideshow, printing, or exporting to PDF. To get the same effect, the alpha mask must be inverted, RemoveBlendedStartColor(COL_WHITE, aAlpha) called, and the alpha mask uninverted. Change-Id: I8e81b11aab05954c821f833f4a2fc77eec7b7701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159742 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-20Extended loplugin:ostr: drawinglayerStephan Bergmann
Change-Id: If37d6fac8e1cabd7c1609c26259366fb0d3d81ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159716 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-05tdf#158014 Skia adds filled white areas in .svg when exporting to PDFNoel Grandin
So my strategy here is to assume that ProcessAndBlurAlphaMask was doing the right thing before commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) but the subsequent naiving changing of its logic undermines it because of some subtle interaction. So take the brute force approach of reverting most of the code to its prior state (i.e. working in the transparency domain), and doing an Invert() before and after the original code. This seems to fix all of the test files I have on hand for this situation for both Skia and non-Skia cases. Change-Id: If4c4d4c5351a4ec55897bed96b57d28eda88f5dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158793 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-28Fix variable names according to documentationBartosz Kosiorek
Change-Id: I8a5b675a124b3f229ec71fc56aae27038aeedeb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158558 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-10-26tdf#157083 Artifacts in logos (gen)Noel Grandin
regression from commit commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Author: Noel Grandin <noelgrandin@gmail.com> Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I1c269bcfa9b565258bc99c2810e960ae965f9b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158491 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: drawinglayerStephan Bergmann
Change-Id: I668041773862b380772d0425ac4eab1d37d310e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158189 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-18tdf#157792 followupNoel Grandin
avoid doing some extra Invert() operations by creating an AlphaMask instead of a Bitmap to pass to the BitmapEx constructor. Change-Id: I1af3a5e65010b346fa0d0c56836d567e51c9b58b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158106 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-12drawinglayer,svx: PDF/UA export: put Form SE into anchor paragraph SEMichael Stahl
This is like commit d467f1aa3d028f399826c97e2eecedcd79efcf65 and commit 6e5d59c2ca6969e9491f97cd7a00d094fc62cfb3 but for the form controls, which have their own special ControlPrimitive2D. Change-Id: I4b4ac45e81f490a7b625acd9e8753300d10bf119 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157847 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-09tdf#157502 and tdf#157652 invert alpha maskPatrick Luby
Due to the switch from transparency to alpha in commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, invert the alpha mask. Change-Id: Ib6df3523be36ba5d5aaf3887557d4a6a8fa6098c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157731 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-09vcl: render scaled fonts for LOKPranam Lashkari
problem: In online calc when fonts are not scaled, text box disappears when not active Change-Id: I9c8fdb3c0d14a3e7ed502ddb2b46c0769a855280 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153624 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 6460c685c3bc3f4929263c7681080056b59948fe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153654 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
2023-10-04vcl,drawinglayer,sw: PDF/UA export: footnote-container-in-list problemMichael Stahl
The problem is that if there is a footnote in a list, the footnote container becomes a child of the LI element that contains the footnote anchor, which is of course nonsense. This is because SwTaggedPDFHelper::CheckReopenTag() stopped using SetCurrentStructureElement(), but unfortunately it's required so that once the list ends, the correct parent element is restored for whatever follows the list. There is a similar problem in VclMetafileProcessor2D. (regression from commit d467f1aa3d028f399826c97e2eecedcd79efcf65) Change-Id: I03dee5dc2e11accb97279e5f325808c5b85507a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157501 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-09-29Use less libxml2 external headers dependencyGabor Kelemen
Change-Id: I1749628e0104dff856161bc0bdfd343ef0db208e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156784 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-09-14tdf#156808 force an alpha mask to be created even if it has no alphaPatrick Luby
We need an alpha mask, even if it is totally opaque, so that drawinglayer::primitive2d::ProcessAndBlurAlphaMask() can be called. Otherwise, blurring of edges will fail in cases like running in a slideshow or exporting to PDF. Change-Id: If03b32a8a22ed960f1475710a9831cab33799b60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156903 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-09-12tdf#157086 invert the blur mask instead of the alpha maskPatrick Luby
An invert is needed to fix tdf#156808 but inverting the alpha mask causes tdf#157086 so invert the blur mask instead. Change-Id: Id695d04f008932caadb0fc2b477b0a4b152fa66c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156854 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-09-08XPrimitive2DRenderer does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and + void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } + Change-Id: I2b3c0cfd43a3437a1376e64421a66c595083e486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156661 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-28tdf#156808 soft edge effect makes image (except for soft edge) disappearNoel Grandin
This is clearly fallout from commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) And it clearly fixes the problem, but I'm not sure __why__ it fixes the problem. Change-Id: I805ed85dd22b2124328e6b4dba098c5f093aec55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156198 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-21split to allow getting decoration on its ownCaolán McNamara
Change-Id: Ib65750245906de0852c39e4a4bdaa85a2f822282 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155899 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-17Simplify a bitMike Kaganski
Change-Id: I4cc8f6dbaec0edd8a7a761f03868035350e01734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155760 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-13Related tdf#156630 and tdf#156629 force snapshot of alpha maskPatrick Luby
On macOS, with Skia/Metal or Skia/Raster with a Retina display (i.e. 2.0 window scale), the alpha mask gets upscaled in certain cases. This bug appears to be caused by pending scaling of an existing SkImage in the bitmap parameter. So, force the SkiaSalBitmap to handle its pending scaling. This change consolidates the three duplicate fixes added in the following commits into the AlphaMask(const Bitmap&) constructor. commit 12fd870113a663dde5ceb38c61f1986a34095d0e commit ce2d9f5dd4b6a26847c4779bce4866d969ff4400 From my light testing, the bitmap's SkImage is not scaled except when running macOS with a Retina display. The only exception is that this fix will be triggered on all platforms when exporting to PDF images with an alpha mask. Change-Id: Iea5afd55aac984ca606b2b4b44e457d81d76fac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155568 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-10tdf#156630 eliminate opaque parts when drawing animated PNG imagesPatrick Luby
Due to the switch from transparency to alpha in commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, flip the background colors for the VirtualDevices and invert an alpha mask. On macOS, with Skia/Raster with a Retina display (i.e. 2.0 window scale), the alpha mask gets upscaled. Also, when Skia is enabled, the alpha mask gets inverted in the first export to PDF after launching the application. These two bugs appear to be caused by asynchronous rendering of the returned bitmap. So, we force a copy of the alpha mask in case it changes before the bitmap is actually drawn. Lastly, respect system animation settings when determining if the image should be animated. Change-Id: I8144691a6c99bf8361b301b88d22172991463f26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155429 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-05Related tdf#156508 fix rendering of the About dialog .svgPatrick Luby
After 0e7d4ea64f84bdc62c10692dcd97c3a32e72e16e, white polygons are drawn in the LibreOffice about .svg in both the About dialog and with the .svg in a document. Creating the mask with COL_WHITE instead of COL_BLACK appears to fix this without causing tdf#156508 to reoccur. Change-Id: I886451245126c2b7f936e30275965148bf029627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155362 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-08-04tdf#156508 Blur shadow is solid in edit and presentation modeNoel Grandin
regression from commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Author: Noel Grandin <noelgrandin@gmail.com> Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I14f62547e3301cab0eff79716bf7bc2a51ead563 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>