summaryrefslogtreecommitdiff
path: root/vcl/inc/skia
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/inc/skia')
-rw-r--r--vcl/inc/skia/osx/gdiimpl.hxx42
-rw-r--r--vcl/inc/skia/osx/rastercontext.hxx42
2 files changed, 84 insertions, 0 deletions
diff --git a/vcl/inc/skia/osx/gdiimpl.hxx b/vcl/inc/skia/osx/gdiimpl.hxx
new file mode 100644
index 000000000000..8523d272e897
--- /dev/null
+++ b/vcl/inc/skia/osx/gdiimpl.hxx
@@ -0,0 +1,42 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_VCL_INC_SKIA_OSX_GDIIMPL_HXX
+#define INCLUDED_VCL_INC_SKIA_OSX_GDIIMPL_HXX
+
+#include <vcl/dllapi.h>
+
+#include <quartz/salgdi.h>
+
+#include <skia/gdiimpl.hxx>
+#include <skia/utils.hxx>
+
+class VCL_PLUGIN_PUBLIC AquaSkiaSalGraphicsImpl final : public SkiaSalGraphicsImpl,
+ public AquaGraphicsBackendBase
+{
+public:
+ AquaSkiaSalGraphicsImpl(AquaSalGraphics& rParent, AquaSharedAttributes& rShared);
+ virtual ~AquaSkiaSalGraphicsImpl() override;
+
+ virtual void Init() override;
+ virtual void DeInit() override;
+ virtual void freeResources() override;
+ // virtual void Flush() override;
+
+ static void prepareSkia();
+
+private:
+ virtual void createWindowContext(bool forceRaster = false) override;
+ virtual void performFlush() override;
+ friend std::unique_ptr<sk_app::WindowContext> createVulkanWindowContext(bool);
+};
+
+#endif // INCLUDED_VCL_INC_SKIA_OSX_GDIIMPL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/skia/osx/rastercontext.hxx b/vcl/inc/skia/osx/rastercontext.hxx
new file mode 100644
index 000000000000..84891d4b8642
--- /dev/null
+++ b/vcl/inc/skia/osx/rastercontext.hxx
@@ -0,0 +1,42 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_VCL_INC_SKIA_OSX_RASTERCONTEXT_HXX
+#define INCLUDED_VCL_INC_SKIA_OSX_RASTERCONTEXT_HXX
+
+#include <tools/sk_app/WindowContext.h>
+
+class AquaSkiaSalGraphicsImpl;
+
+// RasterWindowContext_mac uses OpenGL internally, which
+// we don't want, so make our own raster window context
+// based on SkBitmap, and our code will handle things like flush.
+
+class AquaSkiaWindowContextRaster : public sk_app::WindowContext
+{
+public:
+ AquaSkiaWindowContextRaster(int w, int h, const sk_app::DisplayParams& params);
+ virtual sk_sp<SkSurface> getBackbufferSurface() override { return mSurface; }
+ // Not to be called, our mac code should be used.
+ virtual void swapBuffers(const SkIRect* = nullptr) override { abort(); }
+ virtual bool isValid() override { return mSurface.get(); };
+ virtual void resize(int w, int h) override;
+ virtual void setDisplayParams(const sk_app::DisplayParams& params) override;
+
+protected:
+ virtual bool isGpuContext() override { return false; }
+
+private:
+ void createSurface();
+ sk_sp<SkSurface> mSurface;
+};
+
+#endif // INCLUDED_VCL_INC_SKIA_OSX_RASTERCONTEXT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */