summaryrefslogtreecommitdiff
path: root/vcl/inc/headless
AgeCommit message (Collapse)Author
2023-08-23tdf#146619 Remove unused includes from vcl/incGabor Kelemen
Change-Id: I8fbe02547d5045cfdb5021720b10ddd10106209a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155750 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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>
2023-07-31all drawPolyPolygon variants return true nowCaolán McNamara
since: commit 4998de76ed1da4039e30718941d50d6f1dfe4f82 Date: Sun Jul 30 07:40:48 2023 +0000 tdf#156230: Drop freshly unused GenPspGfxBackend Change-Id: I7fc2a068f807777ed392c5d58772d130bf7f51c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155076 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-25Convert internal vcl bitmap formats transparency->alpha (II)Noel Grandin
(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-05loplugin:finalclassesNoel Grandin
Change-Id: I62b094a3bd9a4f630cebdf538c04391e2920ff2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154064 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-03Rename and move header next to other font headersKhaled Hosny
Change-Id: I5485817b5a6c2e9538ed6fb00893663d09e7fa26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153869 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-03Rename ImplFontMetricData -> FontMetricDataKhaled Hosny
Change-Id: I0f8753a5ef1865f4ea0431125e74d0f52aa1c396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153868 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-18tdf#63130 reduce duplicated work when pixel snappingNoel Grandin
Cache the calculations so we don't repeat work unnecessarily. Shaves 5% off load time. Change-Id: Iffbdd08768fea5b25ac83926b812067f52cba3a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151883 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-30Fix iOS build errorsPL
Recent code reorganization and macOS changes caused the iOS build to fail. This change fixes the build errors and updates the iOS code to use the same headless data structures as other headless builds. Change-Id: I9c5329eb6376120d6789447f991c93eb9839d595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146265 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-01-12move drawTransformedBitmap to CairoCommon and reuse for X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I9b03d2ec973e2dab28358d7e8041b9d26705e700 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145352 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-12merge duplicate CairoTextRender implsCaolán McNamara
drop getSurfaceOffset because both impls just set these to 0, so its a no opt Change-Id: Ie4f28d57fb8a170c7a46d3cafceef3e049c26e2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145325 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-12this is never a X11SalBitmap anymoreCaolán McNamara
Change-Id: I9f645128709bce93be1c8548614b5e72e6667844 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145292 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-11use SvpSalBitmap for X11/gen alsoCaolán McNamara
and move bitmap draw/get into CairoCommon and reuse from X11CairoSalGraphicsImpl Change-Id: Ic1faf85b78a298e603279e6d318bab9240d67e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145288 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-11move GetBitCount into CairoCommonCaolán McNamara
Change-Id: I1afc900ec10a9a8f5db29400666fcc78d7bc8f48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-10move invert into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I4fb52ed1a9d6d9405a76f5d06ca0770bf9b750e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145256 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-10reuse ROP and XOR solutionsCaolán McNamara
Change-Id: I52ba669921a4145f02c69ff90e0d8668c4698ad5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145255 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-10reorg to share more code more simplyCaolán McNamara
Change-Id: If598a94397a2a04ecd4121d7a532c81ef66b5d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145253 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-07move drawRect into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I1d9f1dc96788530eb6a226a53a67764918348100 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145139 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-06move drawPolygon into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: Ifb7514a72f7bc3a65f7f1ad51707405b1a2bd127 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145137 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-06move drawPolyLine into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I141b12c99825c67e4698d53633a1fa720cc487be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145136 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-06use std::optional for SALCOLOR_NONENoel Grandin
instead of re-using an actual real color value, because it will totally not work when I convert vcl to use alpha instead of transparency Change-Id: I01f043e0b65ffd852989dfe28f2b9d5a43c9c3d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-06move drawPolyPolygon into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I8eee16f10f4241ced467e2bf73e518d066f9508d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145111 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-06move getPixel into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
2nd attempt. This reverts commit 8d0b7bdb8c9ae8254e5b77b533a158734affc4f5. Change-Id: I8901a1258e0b0d89170f4e056516c5211801456a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145109 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-06Revert "move getPixel into CairoCommon and reuse from X11CairoSalGraphicsImpl"Caolán McNamara
This reverts commit 00b62877fa2f900d1c2dcf7b721f7a956408f8a0. XIOError seen with vcldemo Change-Id: Id75497f8148964372beaed9432ee6097ec8afc47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145076 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move getPixel into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I5401cc87ec228d52d98fc65840f875cfb55e30c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145052 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move drawPixel into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I0638403ab54039793e851583937b09674f05c36d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145051 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move drawLine into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I6c667b4aa64c49ad18b7e9a2cd6cc43228369bd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145050 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move hasFastDrawTransformedBitmap into CairoCommon and reuseCaolán McNamara
Change-Id: I5c70f657fe885da54caf9514bdddf868e9cf8c1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145029 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move drawAlphaRect into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: Ic9155117dd8586db5738cd7a620818af8bb28f81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145028 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-05move drawGradient into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I249afbc4cf6318fd9ed42fef0a2aa71d1a76d9ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145024 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-04move implDrawGradient into CairoCommon and reuse from X11CairoSalGraphicsImplCaolán McNamara
Change-Id: I341e0b1e3cccd18193c3f9798b875a709fe4871f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144975 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-04move supportsOperation to CairoCommonCaolán McNamara
Change-Id: I754080c322ec76ec8e218f8c97b1649eaf922c74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-04make applyColor staticCaolán McNamara
Change-Id: I69cdc922488351d8bd7c0facf9c7209f56f24291 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145027 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-02Use std synchronisation APIs instead of a pipeTor Lillqvist
The immediate reason for this is that pipes are broken in the Emscripten runtime, see https://github.com/emscripten-core/emscripten/issues/13214. But if we can drop the use of a pipe for other platforms, too, why not. Without this, when attemting to run Collabora Online as WASM, I get: Aborted(Assertion failed: nRet == 1, at: .../vcl/headless/svpinst.cxx,538,DoYield) It is quite possible that the code could be simplified drastically. I only replaced the use of a pipe with hopefully equivalent use of a queue, a condition variable, and a mutex. Change-Id: I9259ba36afeabce6474a1aec827d01bcbbd4412b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144944 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
2022-12-21initial Experimental System-Dependent PrimitiveRenderer for CairoCaolán McNamara
just some partial pieces export TEST_SYSTEM_PRIMITIVE_RENDERER=1 and the simple drawing shapes work Change-Id: I3e01501a1cb21ec86d6fe8f5637a23e7358ffc86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144632 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-21No need for bool return value hereNoel Grandin
all of the implementations of this method return true. Change-Id: I6dc02499af1809110edd482a48d9f6d5d42ead19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-02loplugin:unusedfields make some fields privateNoel Grandin
Change-Id: I1dfa1818f607fbc35a17bf13590fae47994df89d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143530 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-14split CairoCommon XOR code into its own methodNoel Grandin
Change-Id: If615f08a44a083d53c75f58af3578e59634f9a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-18Move access to SystemDependentDataHolder to Bitmap (2)Armin Le Grand (allotropia)
I was too positive thinking that SalBitmap would be fine, but it's locked to vcl. To be able to add system-dependent BitmapBuffering I move the access to Bitmap now. This is no functional change, but offers the same access as e.g. B2DPolygon/B2DPolyPolygon offer already. Also cleaned up usage/access to SystemDependentDataManager which removes quite some code in constructors and makes things easier in general. Change-Id: I2baa40a12479fab0fe66063a018f058c6b8f5597 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141507 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-10-17Move access to SystemDependentDataHolder to SalBitmapArmin Le Grand (allotropia)
To be able to buffer BitmapData which is created based on Bitmap class data, move the access to basegfx::SystemDependentDataHolder from classes where it was used until now (WinSalBitmap and SvpSalBitmap) up to SalBitmap which is accessible outside vcl. This is a reorder plus a virtual access method to detect/access that helper layer, no functional change. It will be needed for system-dependent renderers when they want to use that standard buffering e.g. already used in the headless & windows backends. Change-Id: Ib30e7b98e722b977bb0c87ad253e3ffc1841e87e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141456 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-10-01vcl: Use PhysicalFontFace::GetRawFontData() for font embeddingKhaled Hosny
Change-Id: I6f7c4508f7cef022eaf65a998cb242078d3771c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140826 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-09-27Fix some headless window sizes on Windows, to make `make check` more reliableStephan Bergmann
...by making it more resilient against varying screen sizes. On my 2560x1600 Windows laptop, three `make check` tests systematically failed, and apparently all of them were caused by that larger-than-average screen (similar to what has been detailed in the commit message of 3db6a93c558c55eed085b4386228f9951bb08936 "Compute a better GetDefaultCenterPos"): * CppunitTest_sw_layoutwriter > test/source/xmltesttools.cxx:191:testTdf134298::TestBody > equality assertion failed > - Expected: 2 > - Actual : 3 > - In <>, XPath '/root/page' number of nodes is incorrect * CppunitTest_sw_ooxmlexport12 > sw/qa/extras/ooxmlexport/ooxmlexport12.cxx:526:testObjectCrossReference::TestBody > equality assertion failed > - Expected: Text 2 > - Actual : 2 * CppunitTest_sw_uiwriter2 > sw/qa/extras/uiwriter/uiwriter2.cxx:2702:testTdf122942::TestBody > equality assertion failed > - Expected: 2 > - Actual : 1 Those tests are all run with both SAL_USE_VCLPLUGIN=svp and --headless. But svp is only present on Linux and is thus ignored on Windows. And --headless, while preventing any windows from actually being shown, nevertheless uses the GUI code to set up window sizes. So the idea here is to hack the Windows backend in strategic places so that it uses "appropriate" window sizes in --headless mode to make `make check` succeed. The Linux svp backend has a single place in vcl/headless/svpframe.cxx where it hardcodes the number of monitors to 1 and the screen size to 1024x768. However, for the Windows backend, code determining and using those values is somewhat spread, but it turned out that there is one strategic place in ImplSalGetWorkArea that does what we want (without touching the reported number of monitors at all), without (it appears) negatively affecting other scenarios. (It appears that macOS, also not supporting an svp backend, is similarly affected. But it looks harder there to come up with such a strategic place to hardcode --headless window sizes, and at least my own macOS build's `make check` is unaffected as I use a default scaled 1829x1080 screen resolution there instead of the "raw" 3840x2160.) Change-Id: I822241f81497b9f6bed8e9688eddbe7d798c6b34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140588 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-14Resolves: tdf#144583 reuse lok hidpi icon scheme for gtkCaolán McNamara
Change-Id: I91dc9f7123b878e49a1ad57e5f40b6741ab04487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139945 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-11vcl: Move CreateFontSubset() to PhysicalFontFaceKhaled Hosny
Having it in SalGraphics is not necessary as the code now depends on PhysicalFontFace for accessing raw font data, and this consolidates all the near identical copies of this code into one. Change-Id: I8a411f102fd2188a456bdeb8a0d794078d74e47b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139762 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-09-06vcl: Drop unused SalGraphics::CreateFontSubset() argumentKhaled Hosny
pWidths is always nullptr. Change-Id: I1c666f146865786269e9513cbb6c8ffdc7df96e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139461 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-09-06vcl: Drop now unused SalGraphics::GetGlyphWidths()Khaled Hosny
Change-Id: Iec8974d6fc67d9d599c5e92aa325225963da0021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139459 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-08-14ofz#50202 Direct-leakCaolán McNamara
detect and flag as error failure to sucessfully create a cairo surface Change-Id: I6981ec3058e37f4f4f196f6136f1d81865623c52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138238 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-13clang-tidy modernize-pass-by-value in vclNoel Grandin
Change-Id: I9ddb786eb88213c53cf53067ced6899ca40ac6e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137000 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-23Revert "svp: don't directly yield in main thread"Stephan Bergmann
This reverts commit d2de55c93f94bbccff51fa7715b613341f1f4ae6 for now, because it appears to have caused a massive uptick in hung UITest_impress_tests (sd/qa/uitest/impress_tests/save_readonly_with_password.py, line 95) and UITest_writer_test6 (sw/qa/uitest/writer_tests6/save_readonly_with_password.py, line 54) tests across Jenkins, see the comments starting at <https://gerrit.libreoffice.org/c/core/+/117900/8#message-e439f5f2b9ed7a24d6f47fd640defe14dc392eb5> "svp: don't directly yield in main thread". Change-Id: Id114a0d904580024352e4acf37e2558f9f0ae6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136250 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-22svp: don't directly yield in main threadJan-Marek Glogowski
AKA svp: always release SolarMutex on yield, v2 Implement the TODO when yielding a non-main thread: "use a SolarMutexReleaser here and drop the m_bNoYieldLock usage" This whole concept of "deferred yield" is prone to spurious "deadlocks", if DoYield spawns a nested event loop. This will not only block one yielding threads, but all indefinitly. And not releasing the SolarMutex is also not fair for any other threads waiting. That whole m_nNoYieldLock hack is just needed to defer GUI processing to the main thread without releasing the SolarMutex, the exact opposite of what yielding does. While we can't do anything for the main thread as long as the whole nested event loop concept prevails, we can prevent the yielding thread deadlock using conditionals. With all the special m_nNoYieldLock gone from SvpSalYieldMutex there isn't any reason to keep it around. Change-Id: I87c006ad36b4959f7e0dd18dda99a58c4e25032d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117900 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>