summaryrefslogtreecommitdiff
path: root/vcl/backendtest/outputdevice
AgeCommit message (Collapse)Author
2024-10-18tdf#163486: PVS: variable is assigned values twice successivelyXisco Fauli
V519 The 'eResult' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1604, 1606. Change-Id: I1f778153539ac126f47d502958179c32d41a5a59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175162 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-10loplugin:ostr in vclNoel Grandin
Change-Id: I5b6ee5bda0c5ff69d297f7f8e87d4c3f3d21791c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167470 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-03-13tdf#146619 Remove unused #includes from C/C++ filesRafał Dobrakowski
the 'vcl' module was cleaned. Change-Id: I3bc7470d08bd5eae46344975293a1f6ae30b30f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164637 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
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-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-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-04-21MCGR: Reduce diverse GradientStyle enums to single UNO API oneArmin Le Grand (allotropia)
Change-Id: Ie0cd26a308a75ddead9451c53e874a39cc6eeb63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150705 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-07improve readability of VirtualDevice constructorNoel Grandin
(a) It is not obvious what DeviceFormat::DEFAULT means (b) There are two parameters (each with two states), but only really 2 possible overall states So (1) use more useful names (2) combine the two parameters into one enum Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-16add a vcl backend test that draws a sheared bitmapLuboš Luňák
Change-Id: I06838e01ed41ac41c8b578fd6c7d984f1c073e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125298 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-16implement HiDPI support for Skia/Mac (tdf#144214)Luboš Luňák
The basic idea is the same as the 'aqua' backend, simply set up a scaling matrix for all drawing. That will take care of the basic drawing everything twice as large, which is twice the resolution. And then blit this data to the window, which expects data this way. Converting back from backing surface needs explicit coordinate conversions, and when converting to a bitmap the bitmap needs to be scaled down in order to appear normally sized. Fortunately I've already implemented delayed scaling, which means that if the bitmap is drawn later again without any modifications, no data would be lost (to be done in a follow-up commit). Unittests occassionally need special handling, as such scaling down to bitmap not being smoothed, because they expect exact color values. Change-Id: Ieadf2c3693f7c9676c31c7394d46299addf7880c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125060 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-13add more tests for OutputDev::DrawOutDev()Luboš Luňák
Test also copy to self and clipped copy. Change-Id: I3f741e5035fe1f4fb224dc7fe4ba7aa5b4860dda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125122 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-07cid#1493474 Arguments in wrong orderCaolán McNamara
Change-Id: I6738acf5e48b914491af64377b00f09fc87e8a80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124818 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-04backendtest: Open Cubic-Bezier Curve Draw Testhomeboy445
Change-Id: I1f41ab6d9dca4589da466caca1dfcbfdd15a5b5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120425 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-11-03loplugin:constparamsNoel Grandin
Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31backendtest: Drawing Open Polygon testhomeboy445
Change-Id: I57af3232ad5e83b649fdfac719dc2359e1bbb412 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120171 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-22backendtest:Reconfigured Rectangle tests to be Asymmetricalhomeboy445
The tests were previously drawing squares in the middle, however, now the tests draws rectangle taking offset from the middle. Change-Id: I26a4af997feac9ced443d7c9b4e3541ea2ba868a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120076 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-03backendtest: Rectangle on wide surfaces Drawing testhomeboy445
This tests draws a rectangle using all possible drawing methods for drawing a rectangle on a wide surface(1028x1028 and 4096x4096) and check it the usual way. Change-Id: I6fcf9c9b4b150cbe959b8151f327bcdce1b1139a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119464 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-28Fix typosAndrea Gelmini
Change-Id: Ie4e2ef5a884b51250863d3384d5e703232f31258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121179 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-08-27backendtest: Test Drawing Bitmap other than 24bpphomeboy445
This test draws bitmap formats other than 24bpp - namely 32bpp and 8bpp greyscale. Change-Id: I1b21214429be08fc7cf1eb086c2ad8946780f481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119371 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-26backendtest: Intersecting Rectangles Drawing testhomeboy445
This test intends to test the even-odd filling rule by testing if the intersecting rectangles have been filled accordingly to the rule or not. Change-Id: I0fb7f115a25476cc38e8bec5cd02737aea3c0316 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119098 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-26backendtest: Text Drawing testhomeboy445
This test revolves around drawing text to a Virtual device and testing if it's rendered at the expected position. Change-Id: Iccfe382103632822befe84d5933d64eacefffa24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118976 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-18loplugin:constparamsNoel Grandin
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-16Drop tools::Rectangle::getX/getY, which are just duplicates of Left/TopMike Kaganski
The change allowed to simplify many places where previously this API was used, to avoid inefficient calculations (e.g., moving rectangle keeping its size, and then immediately changing the size). Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-16backendtest: Asymmetrical Filled Drop Like Shape testhomeboy445
Change-Id: Iacf121483aefa71d6f24e14782fcaf22c0d5d56e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118859 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-13cid#1490210 silence Arguments in wrong orderCaolán McNamara
Change-Id: I8767fe556142ec7e3254eaff56bbb1b4eb8322e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120462 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-12backendtest: Closed Bezier loop test using various drawing methodshomeboy445
Change-Id: Ib2ddc8475e2476ce377f3541caa0d48e7c57241a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118783 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-11backendtest:Irregular HalfEllipse test via various drawing methodshomeboy445
Change-Id: If1a6f224f6ff4118617128630077a81da4c469a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118656 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2021-08-08cid#1489971 silence Arguments in wrong orderCaolán McNamara
Change-Id: Ib4bb02a152443ba83b5019ea618265a9363363a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-07backendtest: drop like shape test for polygon / polylinehomeboy445
Add a test for drawing a drop like shape using polygon and polyline drawing code-paths. Change-Id: Ifee7b978009d66af01ccbfc92b36d1423084ed48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118278 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-03vcl: fix clang7 buildMiklos Vajna
vcl/backendtest/outputdevice/line.cxx:126:17: error: no viable constructor or deduction guide for deduction of template arguments of 'vector' Change-Id: I8009637caaba460f9b5ea256f782517e4f1a4be7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116639 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-24backend tests for linecap and linejoin typesLuboš Luňák
Change-Id: Id481feb25ce938b4382f970f2e1082a3594c9eca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114560 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-03-13add PixelFormat enum that replaces bit count in Bitmap/BitmapExTomaž Vajngerl
Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-29vcl: move local bitmap headers to inc/bitmap directoryChris Sherlock
Change-Id: I72cc28d4df8031e322daa50d79666cabcb6421a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108040 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-12-24custom literal for Degree10Noel Grandin
Change-Id: Id13869138a622e62d9ffebf2c89bddccda6aff01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-24vcl: move access functions into appropriate bitmap access filesChris Sherlock
Split class functions into BitmapInfoAccess.cxx, BitmapReadAccess.cxx and BitmapWriteAccess.cxx Split header files into BitmapInfoAccess.hxx and BitmapReadAccess.hxx Change-Id: I7dcbe1d26c5b64d297658a6b809c93d7ad7f053d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108039 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-22tdf#123936 Formatting files in module vcl with clang-formatPhilipp Hofer
Change-Id: Ia162ad5b7499c0ddfdbfca59ae76b81335ce2d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105728 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-11-17implement also axial gradient for skiaLuboš Luňák
Change-Id: Ie708250f970f2ce08c8c89e4bf001a5df23b99bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106015 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-10-21new tools::Degree10 strong typedefNoel Grandin
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: If7fbb25037343e18081a8ee7064840d75e9a45a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104010 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-29disentangle AA and B2D use in VCL drawingLuboš Luňák
A number of powerful functions using B2D polygons such as OutputDevice::DrawPolyLineDirect() were used only if AA was enabled. So e.g. dashing for an AA-ed polyline could be drawn directly using the function, but with AA disabled had to be done manually by a number of polygon operations. Which doesn't make much sense, surely these powerful functions can also draw without AA if set so (and indeed that's mostly the case). And DrawPolyLineDirect() even had a flag to bypass the check. So simply try to use B2D-based drawing whenever possible, AA or not. The previous commit had already changed the naming of the AA option to not include B2D in the name. This seems to come from https://bz.apache.org/ooo/show_bug.cgi?id=88795, which doesn't explain why AA only. There are other bugreports such as https://bz.apache.org/ooo/show_bug.cgi?id=101491 and https://bz.apache.org/ooo/show_bug.cgi?id=98289 that are related, but there I cannot see any difference with this patch. And all unit tests pass. Change-Id: Ibb5938e8fff9b7452bac4bf12ed3e42fd3e5d645 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103354 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-28rename for disentangling AA and B2D use in VCL drawingLuboš Luňák
This renames AntialiasingFlags::EnableB2dDraw to just Enable, and the AntiAliasB2DDraw names to just AntiAlias. This is in preparation for a second commit that will actually separate the AA and B2D functionality of these flags. Change-Id: I9cc215c5752dfabce41e00e19d9074fc8dc3d4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103416 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-09-25xor drawing done twice in the same place should be a no-opLuboš Luňák
This extends the VCL backend unittest to check for this, and also fixes Skia to handle that properly. This makes tdf#132241 slow again. The problem there is that it does drawGradient() with xor enabled (for whatever strange reason), and since Skia does not implement drawGradient(), it gets drawn using polygons and their bounds overlap, causing applyXor() after each operation again. Implementing drawGradient() will handle that. Change-Id: Ibea433ad95f8c6d53049f4a49295e57a5aec184f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103280 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-09-25make vclbackendtest test gradientsLuboš Luňák
And tweak the tests so that the default VCL algorithm actually passes. Also allow a slight inaccuracy for the starting and ending white and black colors, as the upcoming Cairo and Skia implementations are not precise there. Change-Id: I93bae57c0e168027a52ced0d757ee6925cb5335a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103281 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-26use Skia to do dashed lines, no need to do it manually (tdf#130431)Luboš Luňák
Change-Id: Id5efe7227f3c2bcb5ef6f1b990327e72014e8c47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94857 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-05-22always use region band in Skia's setClipRegion (tdf#133208)Luboš Luňák
Do like other VCL backends do. Change-Id: I64b5d5a2fb131b41c70aa63eaf84022e9aa9fab5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94702 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-04-01SalInvert::N50 has 1x1 pixel checker size, not 2x2 (tdf#131580)Luboš Luňák
This can be seen with widget styles that use invert() to draw focus rectangle, such as with VCL gen or win backends. Change-Id: I7fb36d1be5333e917f871f8504585e32abe82b5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91380 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-09fix Skia virtual device alpha blending (tdf#129865)Luboš Luňák
The blendBitmap()/blendAlphaBitmap() stuff coming from the OpenGL code is some undocumented crazy stuff (probably because the VirtualDevice alpha handling itself is rather crazy). Hopefully I've finally figured it out to work properly for Skia too. This separate alpha handling all over the place in VCL should be just nuked. Change-Id: I82615a9be7064e9ade00ec4970a131a80a543c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86488 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-11-27avoid some compiler warnings in Skia VCL codeLuboš Luňák
Mostly warnings from the 'casttovoid' Clang plugin, which is rather annoying here. Change-Id: I3d69697143f690211cdd26d1b9a4c0efe9397197