1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_VCL_INC_SKIA_X11_GDIIMPL_HXX
11 #define INCLUDED_VCL_INC_SKIA_X11_GDIIMPL_HXX
12 
13 #include <vcl/dllapi.h>
14 
15 #include <unx/salgdi.h>
16 #include <unx/x11/x11gdiimpl.h>
17 #include <skia/gdiimpl.hxx>
18 #include <skia/utils.hxx>
19 
20 class VCL_PLUGIN_PUBLIC X11SkiaSalGraphicsImpl final : public SkiaSalGraphicsImpl,
21                                                        public X11GraphicsImpl
22 {
23 private:
24     X11SalGraphics& mX11Parent;
25 
26 public:
27     X11SkiaSalGraphicsImpl(X11SalGraphics& rParent);
28     virtual ~X11SkiaSalGraphicsImpl() override;
29 
30     virtual void Init() override;
31     virtual void DeInit() override;
32     virtual void freeResources() override;
33     virtual void Flush() override;
34 
35     static void prepareSkia();
36 
37 private:
38     virtual void createWindowContext(bool forceRaster = false) override;
39     virtual void performFlush() override;
40     virtual bool avoidRecreateByResize() const override;
41     static std::unique_ptr<sk_app::WindowContext>
42     createWindowContext(Display* display, Drawable drawable, const XVisualInfo* visual, int width,
43                         int height, SkiaHelper::RenderMethod renderMethod, bool temporary);
44     friend std::unique_ptr<sk_app::WindowContext> createVulkanWindowContext(bool);
45 };
46 
47 #endif // INCLUDED_VCL_INC_SKIA_X11_GDIIMPL_HXX
48 
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
50