[Libreoffice-commits] core.git: Branch 'feature/skia' - 2 commits - vcl/skia
Luboš Luňák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 29 15:32:53 UTC 2019
vcl/skia/gdiimpl.cxx | 14 +++++++++++++-
vcl/skia/x11/gdiimpl.cxx | 4 ++++
2 files changed, 17 insertions(+), 1 deletion(-)
New commits:
commit dfeaecc7860e896c93d917c01d0af47ab65acb6f
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Oct 29 16:30:42 2019 +0100
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Oct 29 16:30:42 2019 +0100
add a TODO note about Skia Vulkan surface getting recreated too often
Change-Id: I558c5c161224e5ba5835fb5ec994e585c90ec14c
diff --git a/vcl/skia/x11/gdiimpl.cxx b/vcl/skia/x11/gdiimpl.cxx
index 29119f092ac9..f4575d8af867 100644
--- a/vcl/skia/x11/gdiimpl.cxx
+++ b/vcl/skia/x11/gdiimpl.cxx
@@ -53,6 +53,10 @@ void X11SkiaSalGraphicsImpl::createSurface()
assert(winInfo.fDisplay && winInfo.fWindow != None);
winInfo.fFBConfig = nullptr; // not used
winInfo.fVisualInfo = const_cast<SalVisual*>(&mX11Parent.GetVisual());
+ // TODO Vulkan does not use these dimensions, instead it uses dimensions of the actual
+ // drawable, which may lead to repeated createSurface() calls from checkSurface()
+ // if the window is being resized and VCL already knows the new size but Vulkan doesn't.
+ // Avoid this somehow.
winInfo.fWidth = GetWidth();
winInfo.fHeight = GetHeight();
destroySurface();
commit 56a0dbf13f9914852c2be363909aa6ae7ec008d0
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Oct 29 16:30:19 2019 +0100
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Oct 29 16:30:19 2019 +0100
work around for Skia SkCanvas::clipRegion() bug
https://bugs.chromium.org/p/skia/issues/detail?id=9580
Change-Id: I37b7f5bd8c9b6a4a4d96a4c694dd3ad238b29f69
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 8712893f9554..6c07436ddfa3 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -283,7 +283,19 @@ bool SkiaSalGraphicsImpl::setClipRegion(const vcl::Region& region)
assert(canvas->getSaveCount() == 2); // = there is just one save()
canvas->restore();
canvas->save();
- canvas->clipRegion(toSkRegion(region));
+#if 1
+ // TODO
+ // SkCanvas::clipRegion() is buggy with Vulkan, use SkCanvas::clipPath().
+ // https://bugs.chromium.org/p/skia/issues/detail?id=9580
+ if (!region.IsEmpty() && !region.IsRectangle())
+ {
+ SkPath path;
+ lclPolyPolygonToPath(region.GetAsB2DPolyPolygon(), path);
+ canvas->clipPath(path);
+ }
+ else
+#endif
+ canvas->clipRegion(toSkRegion(region));
return true;
}
More information about the Libreoffice-commits
mailing list