summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-11 13:11:46 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-02-13 12:38:31 +0100
commit6ba3425d4333b0318674ee3e8396de768fac5a75 (patch)
tree226dd91ecb08bc6a34a5bb2eaed3dd204953babd
parent76d6b4d02d2ad57bbb1b348d9ba9f73ce9201a8f (diff)
set up properly Vulkan context creation also for Windows
This was somehow missing in aafe540f5a4c3593d8e56bbdbeb5f508994fe6d9. Change-Id: I5bdcc490b10c73ac4bc55aa6af29d08815cd18d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88532 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--vcl/skia/SkiaHelper.cxx3
-rw-r--r--vcl/skia/win/gdiimpl.cxx16
2 files changed, 17 insertions, 2 deletions
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index d824eddb7a4c..0404a52f98cc 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -222,8 +222,7 @@ GrContext* getSharedGrContext()
if (done)
return nullptr;
done = true;
- if (!createVulkanWindowContextFunction)
- return nullptr;
+ assert(createVulkanWindowContextFunction);
std::unique_ptr<sk_app::WindowContext> tmpContext = createVulkanWindowContextFunction();
// Set up using the shared context created by the call above, if successful.
context = sk_app::VulkanWindowContext::getSharedGrContext();
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index 0d459be03722..b90239fdedc2 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -291,4 +291,20 @@ SkiaControlCacheType& SkiaControlsCache::get()
return data->m_pSkiaControlsCache->cache;
}
+std::unique_ptr<sk_app::WindowContext> createVulkanWindowContext()
+{
+ SkiaZone zone;
+ sk_app::DisplayParams displayParams;
+ return sk_app::window_context_factory::MakeVulkanForWin(0, displayParams);
+}
+
+namespace
+{
+struct SetFunction
+{
+ SetFunction() { SkiaHelper::setCreateVulkanWindowContext(createVulkanWindowContext); }
+};
+SetFunction setFunction;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */