summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-11-27use idle priority in visualbackendtestfeature/skiaLuboš Luňák1-1/+1
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-26always test Skia before OpenGLLuboš Luňák3-10/+8
Skia/Vulkan as the newer technology should be preferred, currently Skia is not enabled by default, but that can change later. And this should be consistent, otherwise the about dialog can claim OpenGL is used while it's actually Skia that gets selected elsewhere. Change-Id: I185feb231c28a119a1152e92afb54a1e8c41af6f
2019-11-26fix SkiaSalGraphicsImpl::drawPolyLine()Luboš Luňák1-24/+16
Code pretty much copy&pasted from the vcl/quartz version. Fixes e.g. Writer marks showing paper corners. Change-Id: I3c9d2ed00efe409abd0a730a6f7dc0ea2a31c90a
2019-11-26don't fall back to raster if Skia is first asked for offscreen surfaceLuboš Luňák1-18/+14
This is rare, but it may happen. Since now the code shared just one GrContext properly, this is not really a problem anymore (and the extra WindowContext creation shouldn't be hopefully noticeable either). Change-Id: I50887b7512e778b70870690a3f672b27cc7f2d21
2019-11-26do not require Vulkan devel package for SkiaLuboš Luňák2-0/+14
I don't see why this should use libvulkan.so, using libvulkan.so.1 should do as well, and quite possibly any future libvulkan.so.2 could be binary-incompatible anyway. Change-Id: I46be40da7fbfdcb59c947e6d088820e580cf4c44
2019-11-26use the native Skia color Type when using VulkanLuboš Luňák1-6/+5
Change-Id: Ie46d7d89b9aa149f48617ccdbe3a8c492759880f
2019-11-26revert BackendCapabilities::mbSupportsBitmap32 for SkiaLuboš Luňák5-24/+9
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-26patch Skia bug with copying data with different alpha typeLuboš Luňák2-0/+14
https://bugs.chromium.org/p/skia/issues/detail?id=9662 Change-Id: Ic5208c2c817912cddbfae4b86e3b3647306262fb
2019-11-26handle properly true 32bit bitmaps in some placesLuboš Luňák3-0/+6
I.e. those created with vcl::BackendCapabilities::mbSupportsBitmap32 set. But there are quite possibly many more places that do not expect that the Bitmap itself would contain alpha. Change-Id: I83db37b3d346f42565f96b9bbf81c71b97b6bf8b
2019-11-26copy SkImage properlyLuboš Luňák1-1/+3
Change-Id: I61f082d8a8d8eead6c49bbf3da997462e7d9738e
2019-11-26fix mistyped operatorLuboš Luňák1-1/+1
Change-Id: I10ca633d31163c968b0010983132942a1823a3f6
2019-11-26fix a VirtualDevice leakLuboš Luňák1-1/+1
VclPtr is a smart ptr, but it does not own (and thus does not autodelete). Change-Id: I2d9b924852d01b118fb0bc2a583063da230ee065
2019-11-26fix Skia with --enable-pch=fullLuboš Luňák1-0/+28
Change-Id: I6bec47e373c042d1ffb3607bf5dca9dfe2509466
2019-11-26build Skia only on selected platformsLuboš Luňák1-1/+7
Feel free to adjust your platform as necessary. Change-Id: I3003a643c39b6afeb3102f97280f20534b9c7f77
2019-11-26avoid some compiler warnings in Skia VCL codeLuboš Luňák7-61/+36
Mostly warnings from the 'casttovoid' Clang plugin, which is rather annoying here. Change-Id: I3d69697143f690211cdd26d1b9a4c0efe9397197
2019-11-26solve the Skia lerp() conflict differentlyLuboš Luňák1-8/+6
New versions of libstdc++ provide lerp() in the global namespace, older ones don't, but it depends on the libstdc++ version and not the c++ version. Since the function is local, just "rename" it. Change-Id: I37896190c620350739fba9b8ce6544f945519244
2019-11-26avoid unused parameter warning in non-debug buildLuboš Luňák1-0/+1
Change-Id: I3ea06a872d5348f7681602a6d68ff69990f2cd7e
2019-11-26make about dialog differentiate between Skia with Vulkan or rasterLuboš Luňák2-2/+15
Since they are technically still two different rendering implementations. Change-Id: I83c324b384b7acfcc84e729271d00b995327eec6
2019-11-26make sure Skia invert with TrackFrame doesn't paint outsideLuboš Luňák2-2/+6
According to Tomaž that's a requirement and that is what the test for it tests. This is easy to implement with additional clipping. Change-Id: Ia54489e20ce58ae0624183f2989036e6938cd44f
2019-11-26disable Skia resource leak checking on exitLuboš Luňák2-0/+27
This is normally enabled in Skia debug builds and it asserts if there is a problem, which there is with a number of our unittests that leak something (usually a VirtualDevice). Those are non-trivial to find and don't matter in practice (or if they do they should be fixed for all VCL backends), so just disable the Skia check. Change-Id: I0a0721d8a3f0f961e14513574f4b3cc88ec1e62c
2019-11-26fix memory leakLuboš Luňák1-1/+1
Change-Id: I6148159737edd4fe225d1140606064cdb77ef615
2019-11-26make Skia GPU offscreen surfaces work with unittestsLuboš Luňák9-245/+254
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-26add invert() tests to visualbackendtestLuboš Luňák2-10/+45
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-26do not use Xlib for accessing something that is not an X windowLuboš Luňák1-1/+1
Change-Id: I8986064e581fdb9876068ae3b9736b9716554fb6
2019-11-26remove no-longer-needed Skia workaround for GPU offscreen drawingLuboš Luňák1-5/+0
Change-Id: I044a9a31af71c4c624f08a0813bc59472f4c728a
2019-11-26make Skia VCL backend fall back to raster if vulkan doesn't workLuboš Luňák7-42/+83
Change-Id: Ic446f6f85e5ebc2e50cb51a3ed1e732b8976a193
2019-11-26fix Skia offscreen GPU-backed drawingLuboš Luňák11-116/+601
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-26clean up properly in VCL backend testsLuboš Luňák1-1/+1
VclPtr is a smart pointer, but it does not clean up automatically, ScopedVclPtr does. Change-Id: If792111cdd489b1743a1bcf060b56c52a4aa79d5
2019-11-26avoid repeated SkSurface recreating because of X11 being asynchronousLuboš Luňák4-9/+29
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-26use different line and fill color in vcl backendtestLuboš Luňák11-58/+145
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-26make Skia copyArea() and copyBits() actually copy, not drawLuboš Luňák1-2/+6
Change-Id: Ifcf8d4d7814daf3631b159cc979f3b8a80052196
2019-11-26use center of pixels when doing GPU drawing using SkiaLuboš Luňák5-30/+37
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-26make SkiaSalGraphicsImpl use GPU-backed SkSurface also for offscreenLuboš Luňák9-7/+153
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-26make visualbackendtest draw at more than 60FPSLuboš Luňák1-1/+1
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-26add SAL log group vcl.skia for tracing Skia usageLuboš Luňák6-3/+75
Change-Id: Ife21bbe0b86c3edd20e657da09c6e218fa4fced3
2019-11-26handle properly Skia color endianessLuboš Luňák1-16/+18
Change-Id: I59af62fa92903823eb7105d82157017e485ba0df
2019-11-26pre-fill Skia bitmaps/surfaces with garbage in dbgutil modeLuboš Luňák5-1/+41
In order to be able to detect incorrect/missing drawing. Change-Id: I18b3f05c1fdff69b461f22e984e0aef3c4ce3364
2019-11-26fix Skia text color on X11Luboš Luňák1-1/+8
Change-Id: I061acb80294c3bd6b45bd60dbb32c9a906619ed0
2019-11-26some VCL OpenGL-specific env.vars. actually apply to Skia as well nowLuboš Luňák1-2/+5
Change-Id: Ia8cfa8ef855f85cc324bc811e26dcab83b50b1be
2019-11-26move docs for Skia env.vars. to vcl/README.varsLuboš Luňák2-8/+10
Change-Id: I9260e277b83f71ee06129802d8278f098796760c
2019-11-26implement SalROPColor in SkiaLuboš Luňák1-2/+30
Pretty much copy&pasted from other VCL plugins ... whatever is actually is. Change-Id: Ibdd5d6d2106f303127afbbde45d400d02a5de93b
2019-11-26extend vcl backendtest to more backendsLuboš Luňák11-34/+67
At least the KF5/Qt5 VCL plugins passes fine. Change-Id: I033ddf6ae9cc663729ca459cdc514dc0fa51ddc2
2019-11-26fix debug buildLuboš Luňák1-1/+1
Change-Id: Ia6d5545ef088604f3fe104b00cc86a45d91f6559
2019-11-26skia: drawMask can be simplified with drawBitmap callTomaž Vajngerl1-8/+2
Change-Id: Ie01c9dba1287495db9f176c1e1e25799e5f3e872
2019-11-26skia: add common function to check the input SalTwoRectsTomaž Vajngerl1-12/+11
function is checkInvalidSourceOrDestination Change-Id: Id3b5dc69a3949f01b5335a9bdf0ce0ad165adab1
2019-11-26skia: use a common drawBitmap in more casesTomaž Vajngerl2-31/+22
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-26skia: implement blendAlphaBitmap and blendBitmapTomaž Vajngerl1-8/+64
Change-Id: I83f33795bea5ed72f1f3269f30f64b1b24566538
2019-11-26skia: don't loop to first point if the polygon is not closedTomaž Vajngerl1-0/+4
This fixes drawing of non-closed polylines. Without this fix the non-closed polylines an extra step is still drawn from the last point in the polygon to the first one (as if the polyline would be closed). Change-Id: I0171aede3dc03f83b7dd8ae699e6b505b3fd4f7f
2019-11-26backendtest: test blending of bitmapTomaž Vajngerl3-0/+71
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-26backendtest: support creating VirtualDevice with alphaTomaž Vajngerl2-4/+8
Change-Id: I74c428b9b31b89536e72d53e418fc11b3f7e4e32