1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include <vcl/sysdata.hxx>
12 #include <unx/salunx.h>
13 #include <unx/saldisp.hxx>
14 #include <unx/salgdi.h>
15 #include <unx/salvd.h>
17 #include <skia/x11/salvd.hxx>
19 void X11SalGraphics::Init(X11SkiaSalVirtualDevice
* pDevice
)
21 SalDisplay
* pDisplay
= pDevice
->GetDisplay();
23 m_nXScreen
= pDevice
->GetXScreenNumber();
24 maX11Common
.m_pColormap
= &pDisplay
->GetColormap(m_nXScreen
);
29 mxImpl
->UpdateX11GeometryProvider();
32 X11SkiaSalVirtualDevice::X11SkiaSalVirtualDevice(const SalGraphics
& rGraphics
, tools::Long nDX
,
33 tools::Long nDY
, const SystemGraphicsData
* pData
,
34 std::unique_ptr
<X11SalGraphics
> pNewGraphics
)
35 : mpGraphics(std::move(pNewGraphics
))
41 // TODO Check where a VirtualDevice is created from SystemGraphicsData
42 assert(pData
== nullptr);
45 mpDisplay
= vcl_sal::getSalDisplay(GetGenericUnixSalData());
46 mnXScreen
= static_cast<const X11SalGraphics
&>(rGraphics
).GetScreenNumber();
49 mpGraphics
->Init(this);
52 X11SkiaSalVirtualDevice::~X11SkiaSalVirtualDevice() {}
54 SalGraphics
* X11SkiaSalVirtualDevice::AcquireGraphics()
62 return mpGraphics
.get();
65 void X11SkiaSalVirtualDevice::ReleaseGraphics(SalGraphics
*) { mbGraphics
= false; }
67 bool X11SkiaSalVirtualDevice::SetSize(tools::Long nDX
, tools::Long nDY
)
77 mpGraphics
->Init(this);
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */