summaryrefslogtreecommitdiff
path: root/vcl/inc
AgeCommit message (Collapse)Author
2019-12-05Silence loplugin:unnecessaryoverride (clang-cl)Stephan Bergmann
("public virtual function just calls public parent") Change-Id: Ifd8d6c794ae32af1fe5d2a97389ec87394fdffbc Reviewed-on: https://gerrit.libreoffice.org/84512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05KF5 drop KF5FilePicker::executeJan-Marek Glogowski
To prevent calls to Qt5FilePicker::updateAutomaticFileExtension, it is simply made virtual with an empty override. This is needed, because the KF5 file picker has its own automatic extension handling. The main motivation is the fix for tdf#129071, which will result in some major changes to XExecutableDialog::execute, so this will prevent larger code duplication later. Change-Id: I5f747f0828cb8a65b4e7043f3ee68ebd31973e6a Reviewed-on: https://gerrit.libreoffice.org/84297 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2019-12-05-Werror,-Wnon-virtual-dtor (clang-cl)Stephan Bergmann
Change-Id: I66967a6d79b0568557c67b26c3dc6c65f00db261 Reviewed-on: https://gerrit.libreoffice.org/84509 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05-Werror,-Winconsistent-missing-override (clang-cl)Stephan Bergmann
Change-Id: I2414729b9e5dfbafdc575c022517c12cef682e31 Reviewed-on: https://gerrit.libreoffice.org/84508 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05-Werror,-Wmicrosoft-pure-definition (clang-cl)Stephan Bergmann
("function definition with pure-specifier is a Microsoft extension"). Keeping it pure but implicitly defined (by dropping the "{}" part) would cause unresolved symbols during linking, so keep it explicitly defined inline but non- pure (which should be fine as the class still has other pure members). Change-Id: Ieff73fd5c9010164c202f752605890b78809caa6 Reviewed-on: https://gerrit.libreoffice.org/84507 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05Make sure external/skia include file doesn't define macro YieldStephan Bergmann
Caused build breaker on Windows at least with clang-cl and --disable-pch: > In file included from C:/lo-clang/core/vcl/skia/gdiimpl.cxx:25: > C:/lo-clang/core/include\vcl/svapp.hxx(487,5): error: declaration does not declare anything [-Werror,-Wmissing-declarations] > static void Yield(); > ^~~~~~~~~~~ Change-Id: Ibadd59c99040c318c874d0eb6747006bfb5e248f Reviewed-on: https://gerrit.libreoffice.org/84505 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-05Qt5 hide more Qt5FilePicker detailsJan-Marek Glogowski
* Make most members private * Drop some unused members * Rename some single-char variables for easier reading * Spread some constness * Finalize the KF5FilePicker class * Test the native picker setting of the QFilePicker, instead of an additional bool member This is just some refactoring. While not strictly needed, it helps keeping the following patches fixing tdf#129071 more compact. Change-Id: I15ffe4de848a9498d7f61f99bcf031257da7cb08 Reviewed-on: https://gerrit.libreoffice.org/84456 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-12-05make some classes module privateNoel Grandin
Mark some stuff SAL_DLLPUBLIC_RTTI in include/vcl/metaact.hxx in order to make ASAN happy. Change-Id: I97febe0968bf58b9cbe60ce647f0ada25e6f4bb0 Reviewed-on: https://gerrit.libreoffice.org/84202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-04factor out 'weld::Widget as XWindow'Caolán McNamara
Change-Id: I24b52c5b8908fdf1a66fd26b2dc438b9557afa6e Reviewed-on: https://gerrit.libreoffice.org/82641 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-01weld FmFieldWinCaolán McNamara
needs drag source support fixes a leak of ColumnInfo data as well Change-Id: I671834726aed3fd4de096b56baaa592f51a9e73e Reviewed-on: https://gerrit.libreoffice.org/84147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-29make some function symbols module privateNoel Grandin
improve the script to filter out more noise generated by library symbols Change-Id: I22bf6037d56bc4015001825c3fb3b21a39d85e07 Reviewed-on: https://gerrit.libreoffice.org/84022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-28Drop unnecessarily user-provided ~SalLayoutGlyphsImplStephan Bergmann
...thereby avoiding -Wdeprecated-copy-dtor when the implicitly-declared copy assignment op is used, but whose non-deleted definition was deprecated because of the user-provided dtor Change-Id: I9c4adc4b9ad0634c0afe5a4a707cc3697dbfae32 Reviewed-on: https://gerrit.libreoffice.org/84020 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-28Blind additional fix of the Android TB build errorJan-Marek Glogowski
Change-Id: I8dd4beedb5d1d5a555af2bb9c513878c0651e3d8
2019-11-28Blind fix of the Android TB build errorJan-Marek Glogowski
Change-Id: I02f8eaff7e44197743c071a1b4c90b314c0e6b4c
2019-11-28tdf#129043 Correctly deliver combo box events when used with keyboardSamuel Mehrbrodt
Change-Id: I82186f999e74be4aebd59d77666390a7d5e8ad81 Reviewed-on: https://gerrit.libreoffice.org/83923 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-11-27loplugin:finalclasses in vclNoel Grandin
Change-Id: If22569a1b7d53fc1b5b87f7ec7d262ebb260e798 Reviewed-on: https://gerrit.libreoffice.org/83933 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-27android: Introduce --enable-android-lok configure switch to fix RGB vs. BGR.Jan Holesovsky
This indicates that the build targets the Online-based Android app, for which we need to avoid various tweaks that are needed for the 'old' Android app present in the android/ subdir of core.git. In particular, the switch used in this patch fixes a RGBA vs. BGRA confusion that caused yellow <-> cyan switch in the Online-based Android app. Change-Id: I5f394868f51ce87013677834cfafb967b9bb333e Reviewed-on: https://gerrit.libreoffice.org/83342 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 49002a143a4534df5f6139e07fefd06174621c59) Reviewed-on: https://gerrit.libreoffice.org/83718 Tested-by: Jenkins
2019-11-27revert BackendCapabilities::mbSupportsBitmap32 for SkiaLuboš Luňák
It appears that there are still some paths that do not expect bitmaps to be truly 32bit, so better revert to the old safe (and poor, complicated and inefficient) way of pretty much ignoring the alpha channel in SkiaSalBitmap, and let BitmapEx handle it by using an extra alpha bitmap. Change-Id: I4318c05f4ceafc5de48e19eeae5efe2abed2ec69
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-27make about dialog differentiate between Skia with Vulkan or rasterLuboš Luňák
Since they are technically still two different rendering implementations. Change-Id: I83c324b384b7acfcc84e729271d00b995327eec6
2019-11-27make Skia GPU offscreen surfaces work with unittestsLuboš Luňák
Skia is now patched to be able to create also invalid sk_app::WindowContext that will just initialize the shared GrContext. And always use that GrContext, even for tests, because some tests first create a offscreen surfaces and only later create windows, which before this patch led to mixing GrContext instances. Change-Id: Ic79c0719f98f6ac48527c2ea2a9a9a69412adeff
2019-11-27make Skia VCL backend fall back to raster if vulkan doesn't workLuboš Luňák
Change-Id: Ic446f6f85e5ebc2e50cb51a3ed1e732b8976a193
2019-11-27fix Skia offscreen GPU-backed drawingLuboš Luňák
The previous approach of using multiple GrContext instances apparently does not work, it's not possible to do drawing operations that involve objects using two different GrContext's. So patch Skia to use just one GrContext for our needs. See vcl/skia/README for details. Change-Id: I2bd3d3c618bf7f8ff45b2f37cbd086d2289940aa
2019-11-27clean up properly in VCL backend testsLuboš Luňák
VclPtr is a smart pointer, but it does not clean up automatically, ScopedVclPtr does. Change-Id: If792111cdd489b1743a1bcf060b56c52a4aa79d5
2019-11-27avoid repeated SkSurface recreating because of X11 being asynchronousLuboš Luňák
Sometimes VCL and X11 (and thus Skia) will have a different idea about what the size of a window is. Check for the mismatch and avoid recreating if it wouldn't do anything. Change-Id: Icf3ebba9589cc6f12612e5f280840346cb0edaeb
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-27use center of pixels when doing GPU drawing using SkiaLuboš Luňák
According to https://bugs.chromium.org/p/skia/issues/detail?id=9611 rounding errors may cause off-by-one errors, so compensate when converting int->SkScalar in relevant cases. Change-Id: I72a579064206c216c9f99adc7d7c2c57bbe567d6
2019-11-27make SkiaSalGraphicsImpl use GPU-backed SkSurface also for offscreenLuboš Luňák
Skia's sk_app::WindowContext can create GPU-backed SkSurface only for windows, but we also use virtual devices that are not windows. Fortunately, SkSurface can be created GPU-backed from GrContext* and sk_gpu_test::GrContextFactory seems to provide it easily. It is not completely clear to me what the rules are on mixing SkSurface's with different GrContext* (see the comment in SkiaSalGraphicsImpl::copyBits()), but it seems to work fine. Change-Id: I8110b67c41ab092e0c4b6a0973d6bed8a408c4c1
2019-11-27add SAL log group vcl.skia for tracing Skia usageLuboš Luňák
Change-Id: Ife21bbe0b86c3edd20e657da09c6e218fa4fced3
2019-11-27pre-fill Skia bitmaps/surfaces with garbage in dbgutil modeLuboš Luňák
In order to be able to detect incorrect/missing drawing. Change-Id: I18b3f05c1fdff69b461f22e984e0aef3c4ce3364
2019-11-27extend vcl backendtest to more backendsLuboš Luňák
At least the KF5/Qt5 VCL plugins passes fine. Change-Id: I033ddf6ae9cc663729ca459cdc514dc0fa51ddc2
2019-11-27skia: use a common drawBitmap in more casesTomaž Vajngerl
Add an additional parameter to drawBitmap - blend mode, so we can also use the same bitmap drawing code for blendBitmap. Change-Id: Iaa0aff6724c6644d80056097e7477b31c8412b29
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-27make Skia use AA when asked forLuboš Luňák
This improves the quality of e.g. the logo in the about dialog. Change-Id: Ie42ecc466068f979e5982d91616a8a2f80e26319
2019-11-27implement Skia native controls drawing/caching for WindowsLuboš Luňák
This actually fixes a number of drawing problems (e.g. highlight in popup menus), it seems the other code path is buggy. Change-Id: Iea697f577d08d20e338224d5ff5b3bf7b653f8d1
2019-11-27more safe handling of destroying Skia surfaces/contextsLuboš Luňák
As the comment in SkiaSalGraphicsImpl::destroySurface() says, they may both refer to each other's data when being destroyed, so try to handle that. Change-Id: I44353ed9d1888f8e8d15d93cd2c66414adfd372b
2019-11-27fix Skia Windows text renderingLuboš Luňák
There are two cases in WinSalGraphics::DrawTextLayout(), with and without cached glyphs: - Cached case DeferredTextDraw() gets data as BGRA with the glyph drawn in white, it just needs to be modulated to the proper color and drawn. - Uncached case DrawTextMask() gets data as BGRA with A invalid, it must be used as mask for the color to drawn, but without the inverse alpha VCL idiosyncracy that DrawMask() handles. Change-Id: I05dcec994df68d5986cd85cffa42a8f9f23c42c4
2019-11-27skia: drawAlphaRect and drawRect use common codeTomaž Vajngerl
Change-Id: Ib7fc850d024b1fc7ec0ab933842bf1868b70a6d2
2019-11-27fix warning from loplugin:datamembershadowLuboš Luňák
Change-Id: I1a15cf12adff559032f7737c14f56346063d0562
2019-11-27reimplement supportsOperation() for Skia and OpenGLLuboš Luňák
The shared X11 implementation depends on XRender, which doesn't make any sense. Change-Id: I82f36e0835a993a8b226af211d8635336960d7ec
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-27Add getting of render backend name + impl. for skiaTomaž Vajngerl
Change-Id: Id4e32425579c2a3ebdc33e234f55a7324dbb39d4
2019-11-27implement pruning in SkiaGlobalWinGlyphCacheLuboš Luňák
Currently based on identifying the SkBitmap's by their getPixels(), but this may need changed later since it's probably going to be more performant to use SkSurface. Also move the cache pruning out of AllocateTexture(), as that may possibly remove elements that would be used by DrawCachedGlyphs(). Change-Id: Ide2de752f634593b97573667af49b7aa9ec1f47f
2019-11-27remove some obsolete Skia TODO'sLuboš Luňák
Change-Id: I11ec226a627e98552bd35753aa5a8fbcfca66186
2019-11-27add GUI and configuration options for SkiaLuboš Luňák
Pretty much a copy&paste of OpenGL. There are no settings for choosing which backend Skia should use, as the plan is that simply the "best" one will be selected. Change-Id: I44fa876ab85de98de482a6ed9f814024334686ce
2019-11-27make Skia use either Raster or Vulkan, depending on a settingLuboš Luňák
For now default to raster, SAL_SKIA=vk switches to Vulkan. Change-Id: Ia0f3ffdd4367eac9871aa977c930c1e6029e1d25