summaryrefslogtreecommitdiff
path: root/vcl/inc/skia
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-12-03 19:16:00 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-12-06 14:25:52 +0100
commitea5eb4639ac3cca4301e23655d0e7aeaed6f8bcc (patch)
tree5d993eaf9ac1ac816cdcec6a10d0ecd8ba46c218 /vcl/inc/skia
parent5b667d771de65167e269bb145b888eabbc7fdedd (diff)
keep just one shared reference to Skia shared GrContext
This should make it easier to keep the reference without having to keep references all over the place, especially when the shared GrContext starts to be used also for GPU-backed surfaces elsewhere. Change-Id: Icf3f6eb849ebc5eb63b1836f9caeb6f5e5e58ca6 Reviewed-on: https://gerrit.libreoffice.org/84560 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/inc/skia')
-rw-r--r--vcl/inc/skia/gdiimpl.hxx3
-rw-r--r--vcl/inc/skia/salbmp.hxx2
-rw-r--r--vcl/inc/skia/utils.hxx38
3 files changed, 40 insertions, 3 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index e61ee6cfb787..7365d58f9173 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -28,7 +28,7 @@
#include <SkSurface.h>
#include <prewin.h>
-#include <tools/sk_app/VulkanWindowContext.h>
+#include <tools/sk_app/WindowContext.h>
#include <postwin.h>
class SkiaFlushIdle;
@@ -263,7 +263,6 @@ protected:
/// Pointer to the SalFrame or SalVirtualDevice
SalGeometryProvider* mProvider;
std::unique_ptr<sk_app::WindowContext> mWindowContext;
- sk_app::VulkanWindowContext::SharedGrContext mOffscreenGrContext;
// The Skia surface that is target of all the rendering.
sk_sp<SkSurface> mSurface;
bool mIsGPU; // whether the surface is GPU-backed
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index ed0f374162d6..0b0e1aa5439c 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -101,6 +101,6 @@ private:
int mScanlineSize; // size of one row in mBuffer
};
-#endif // INCLUDED_VCL_INC_OPENGL_SALBMP_H
+#endif // INCLUDED_VCL_INC_SKIA_SALBMP_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
new file mode 100644
index 000000000000..5d824400030a
--- /dev/null
+++ b/vcl/inc/skia/utils.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_INC_SKIA_UTILS_H
+#define INCLUDED_VCL_INC_SKIA_UTILS_H
+
+#include <vcl/skia/SkiaHelper.hxx>
+
+#include <tools/sk_app/VulkanWindowContext.h>
+
+namespace SkiaHelper
+{
+// Get the one shared GrContext instance.
+GrContext* getSharedGrContext();
+
+void disableRenderMethod(RenderMethod method);
+
+} // namespace
+
+#endif // INCLUDED_VCL_INC_SKIA_UTILS_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */