diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-01-12 10:16:39 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-01-24 14:40:22 +0100 |
commit | 8ca549ebc01a7aa0b288c521a9e60e76f4d8e97d (patch) | |
tree | 79aa0fd398cc1094118ff7079fa9139ef607433a /drawinglayer | |
parent | cf9be3417bc2be5f772c03180b7cbd248b82cad5 (diff) |
avoid Skia GPU surfaces for small virtual devices (bsc#1183308)
This is similar to the previous Cairo commit. Fetching pixels
from the GPU is not as slow as fetching them from the XServer,
but this still can make a visible difference. And small surfaces
should not need fast GPU rendering that much, so hopefully this
improves more cases than it regresses.
Change-Id: Ida031b38cd1ce14ded464747c20a38c6d094c5a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128310
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index 7f20d094b446..24e0c6a30bcb 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -33,6 +33,7 @@ #include <cppuhelper/basemutex.hxx> #include <vcl/lazydelete.hxx> #include <vcl/dibtools.hxx> +#include <vcl/skia/SkiaHelper.hxx> // buffered VDev usage @@ -105,10 +106,17 @@ bool VDevBuffer::isSizeSuitable(const VclPtr<VirtualDevice>& device, const Size& if (device->GetOutputWidthPixel() >= rSizePixel.getWidth() && device->GetOutputHeightPixel() >= rSizePixel.getHeight()) { + bool requireSmall = false; #if defined(UNX) // HACK: See the small size handling in SvpSalVirtualDevice::CreateSurface(). // Make sure to not reuse a larger device when a small one should be preferred. if (device->GetRenderBackendName() == "svp") + requireSmall = true; +#endif + // The same for Skia, see renderMethodToUseForSize(). + if (SkiaHelper::isVCLSkiaEnabled()) + requireSmall = true; + if (requireSmall) { if (rSizePixel.getWidth() <= 32 && rSizePixel.getHeight() <= 32 && (device->GetOutputWidthPixel() > 32 || device->GetOutputHeightPixel() > 32)) @@ -116,7 +124,6 @@ bool VDevBuffer::isSizeSuitable(const VclPtr<VirtualDevice>& device, const Size& return false; } } -#endif return true; } return false; |