summaryrefslogtreecommitdiff
path: root/vcl/backendtest
AgeCommit message (Collapse)Author
2020-07-16sync visualbackendtest and vcl_backend_testLuboš Luňák
Change-Id: Id3471e2812f2b710d71e748e3542bc8c49dbb7a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98720 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.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-12-06check also setupDrawBlend() in visualbackendtestLuboš Luňák
Change-Id: I57eb88b7b6bb498253639867d4c158041d8299b7 Reviewed-on: https://gerrit.libreoffice.org/84561 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-11-27use idle priority in visualbackendtestLuboš Luňák
At least Skia and OpenGL use POST_PAINT priority for flushing drawn contents to the screen. Using the higher REPAINT priority here could mean that actually showing the contents would not happen. Also, at least with Skia+Vulkan, it seems that Skia could queue commands indefinitely, eventually running out of resources. Change-Id: Ia3969bad18d710b006325a0fba11dc318ff93786
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
2019-11-27add invert() tests to visualbackendtestLuboš Luňák
They already exist and are used by the unittest. And the TrackFrame test actually appears to expect incorrect results (or otherwise pretty much all backends implement the operation incorrectly). Change-Id: I26867a2d1b0f01b5e836131932b422cb8823fb5b
2019-11-27use different line and fill color in vcl backendtestLuboš Luňák
Having them the same can hide problems with them fixed up incorrectly. And it also shows that drawPolygon() with line color unset does not draw the right-most and bottom-most line, which is what all underlying graphics systems do, so the test is kind of wrong and I've added a compensation to make it visually correct (and match the checked expected result). Change-Id: I333f41210232c74ba55bd5c92ef5fda917ce3e59
2019-11-27make visualbackendtest draw at more than 60FPSLuboš Luňák
Not much point in showing the FPS if there's an upper limit on it and many backends can reach it. Note that with SAL_USE_VCLPLUGIN=gen this needs also SAL_HIGHPRIORITY_REPAINT=1 in order to get the maximum FPS. Change-Id: I18705bae81585d46bcaad658cc0c0c2158d89c30
2019-11-27backendtest: test blending of bitmapTomaž Vajngerl
This forces a blending of an alpha virtualdevice with a BitmapEx which has an alpha component. This tries a fast-path with using blendAlphaBitmap in the backend and does blending manually and slower if the fast-path is not available. Change-Id: I7e45dc78ce3e61ede408aa8388802a193cbc577a
2019-11-27backendtest: support creating VirtualDevice with alphaTomaž Vajngerl
Change-Id: I74c428b9b31b89536e72d53e418fc11b3f7e4e32
2019-11-27backendtests: enable tests only when render backend is skiaTomaž Vajngerl
Change-Id: Idd06da27e405a3c0040bdad69c76537f12e50c92
2019-11-27backendtest: Add polyline bezier curve backend testsTomaž Vajngerl
Change-Id: I8cb3e97de79cbd683a266b09fb7d194c07b0089f
2019-11-27backendtest: Add PolyLine B2D test diamondTomaž Vajngerl
Change-Id: I6e754e72ff698d62c493b827f9804f63d0e39e2d
2019-11-27backendtests: remove unused variable - aReturnValueTomaž Vajngerl
Change-Id: I1a2ef490ad0ae6f431f8b4c40c27c7829c51e08d
2019-11-27add "invert" tests to BackendTestTomaž Vajngerl
All backend tests are not enabled yet as none of the backends pass, but testDrawInvertWithRectangle and testDrawInvertN50WithRectangle should pass with skia backend. testDrawInvertTrackFrameWithRectangle is more complicated as drawing an inverted dashed frame around overshoots outside of the rectangle area (as with gtk3 backend, maybe others too). This is something we need to fix or better yet to get rid of this invert mode. Change-Id: Ibc08ff99d91014c41324b67e8e984111bcd3c7ac
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-19tdf#42949 Fix IWYU warnings in vcl/qa/* & vcl/backendtest/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I2d5ab9fd1117a4c57eb42ca849daf0949a79ff50 Reviewed-on: https://gerrit.libreoffice.org/73999 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-13tdf#42949 Fix IWYU warnings in vcl/inc/*Gabor Kelemen
Platform-specific subdirs are left alone: android, ios, osx, quartz, win Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Icbb906b7fbc960240c73c56d3dae2a78b06a0f53 Reviewed-on: https://gerrit.libreoffice.org/73754 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-13Make BitmapColor inherit from / merge into ColorJan-Marek Glogowski
BitmapColor itself is kept to distingish the Color usage as part of a color palette, which continues to store the offset in the blue value. The original special mbIndex handling is long gone since commit 1fefdd6f3b41 ("Alpha channel in BitmapColor - change bIndex to alpha"), so there is no data difference. This also results in the following changes: * now has a basic_ostream<charT, traits>& operator<< (that was my actual starting point... for an other bug fix) * there is a minimal difference for GetLiminance BGR(29,151,76) => BGR(28,151,77) * no more return values for Merge and Invert (previously returning *this) * replaces all GetBlueOrIndex with GetIndex This leaves one "problematic" part: the GetColorError handling. At first glance it should probably be virtual. The Color variant is less strict then the BitmapColor one - for whatever reason. BitmapColor is always used to search for the best match in a Palette. Currently I'm simply leaving both variants. Would be nice to have an explict for functions here. Change-Id: I251ba3024a1d60f2a9d9fde9cd0a60f08e8322a7 Reviewed-on: https://gerrit.libreoffice.org/72181 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-04-17remove or change salbtype.hxx includesTomaž Vajngerl
Change-Id: Ibd28b8fa92e98ebeb482a9081fbeae24defe4adb Reviewed-on: https://gerrit.libreoffice.org/70826 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-16Add backend tests as CPPUNIT testsTomaž Vajngerl
This (finally) adds backend tests as CPPUNIT tests too. In the future they'll also be added into LibreOffice directly as a way to test if the backend is OK, which will be useful especially for the OpenGL backend, which draw quality depends on the driver. Currently all the tests are ignored because of the bugs in the backend, which need to be addressed first and tests then can be enabled one by one. The main reason for the test is to identify issues when drawing is done at a wrong position, which is a very common problem. Also other types of tests will be added in time, which will have a big role in the refactoring of VCL that will happen in the future. Change-Id: I92237d47d49fa0db01b73b8bc39f7a621b65961e Reviewed-on: https://gerrit.libreoffice.org/70769 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-15loplugin:sequentialassign in vclNoel Grandin
Change-Id: I530b81b3258a6e1c1456da53bfe1285f14aee712 Reviewed-on: https://gerrit.libreoffice.org/70734 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-08convert "*xxx.get()" to "*xxx"Noel Grandin
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9 Reviewed-on: https://gerrit.libreoffice.org/65951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-01clang-tidy: (WIP) bugprone-too-small-loop-variable findingsTamás Zolnai
Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561 Reviewed-on: https://gerrit.libreoffice.org/62701 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-09-17loplugin:staticconstfield improvementsNoel Grandin
Change-Id: Ia0a19736dfd4500bb17b04c072710f8ee8744031 Reviewed-on: https://gerrit.libreoffice.org/60526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-14loplugin:constfields in vclNoel Grandin
Change-Id: I1072642be4fdfa720e61f2d7bad3c2701eb81610 Reviewed-on: https://gerrit.libreoffice.org/60430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-04Use more basegfx deg<->rad functions, instead of direct formulasMike Kaganski
Also make the functions constexpr. Due to slight changes in floating-point arithmetics (90.0 instead of 180.0, M_PI2 instead of M_PI resp.), results might differ in last digits (usually 17th decimal digit). This has lead to need to tweak char2dump's PieChartTest unit test. Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3 Reviewed-on: https://gerrit.libreoffice.org/58583 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-07-31Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-17loplugin:constparamsNoel Grandin
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b Reviewed-on: https://gerrit.libreoffice.org/52756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-09use more DBG_UNHANDLED_EXCEPTIONNoel Grandin
so we get nice logs of the exception dynamic type for UNO exceptions. Change-Id: Ic0b10dc14d354a2c9a0591b3a51d2f1640d54bdb Reviewed-on: https://gerrit.libreoffice.org/52465 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-15move Bitmap::ScopedWriteAccess inside vclNoel Grandin
would have liked to make the AcquireWriteAccess methods DLLPRIVATE, but they are needed by the workbench and testing code Change-Id: I22497788eb68dfb84b7e542e5ef53322892a5274 Reviewed-on: https://gerrit.libreoffice.org/51310 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-02-28convert COL_ constants to be of type ColorNoel Grandin
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22loplugin:changetoolsgen in vclNoel Grandin
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494 Reviewed-on: https://gerrit.libreoffice.org/50107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05vcl: remove BitmapColor Color() operatorChris Sherlock
BitmapColor has a Color() operator. However, this is confusing and tends to hide that the two classes aren't the same. I have converted this to GetColor(). Change-Id: I0be2dcb3fc420e7be9c8d04330e7a3fe69a5412a Reviewed-on: https://gerrit.libreoffice.org/48245 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06Remove unused #include <vcl/metaact.hxx> from vcl/outdev.hxxStephan Bergmann
...and fix the fallout Change-Id: Ie514bd95d5a9f990a887566619031e9844c40b92 Reviewed-on: https://gerrit.libreoffice.org/45195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-23loplugin:includeform: vclStephan Bergmann
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-04add << operator for css::uno::ExceptionNoel Grandin
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-22vcl: [loplugin:badstatics] aApplicationMichael Stahl
VisualBackendTestApp::xMSF doesn't need to be a member. Change-Id: I307ba56377b822a148db809c16b8ff05708d0ca7
2017-09-14clang-tidy modernize-use-emplace in vclNoel Grandin
Change-Id: Ie0a6d105b0167431275e628935df4f4c1a36d070 Reviewed-on: https://gerrit.libreoffice.org/42259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in vclNoel Grandin
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4 Reviewed-on: https://gerrit.libreoffice.org/40116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-13Removed duplicated includesAndrea Gelmini
No automatic tools. Manual checked and tested. Change-Id: Ife260fa4e1d786cf81f2917a901664cc54943754 Reviewed-on: https://gerrit.libreoffice.org/36371 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>