summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-10-12 17:46:11 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-11-27 09:55:05 +0100
commit1e9fae677579b59ddbc4cd69e201b95f51b8c742 (patch)
tree3bcbc86dae348397d10f0557bbceca88a0b86469 /vcl/unx
parent534d89fed30983bcc48387facc3410f13e230683 (diff)
initial empty Skia VCL implementation
This mostly duplicates OpenGL cases. Pretty much all implementation methods are empty. Change-Id: I333506f56dcc46c3e9405fe8194c172de17c54fd
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/app/saldisp.cxx1
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx6
-rw-r--r--vcl/unx/generic/gdi/salgdi.cxx17
-rw-r--r--vcl/unx/generic/gdi/salvd.cxx6
4 files changed, 24 insertions, 6 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 8756fc2299e3..4ffea9b58364 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -211,6 +211,7 @@ bool SalDisplay::BestVisual( Display *pDisplay,
if( nVID && sal_GetVisualInfo( pDisplay, nVID, rVI ) )
return rVI.visualid == nDefVID;
+// TODO SKIA
bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled();
if (bUseOpenGL && BestOpenGLVisual(pDisplay, nScreen, rVI))
return rVI.visualid == nDefVID;
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index a81eb608ec21..9891447935e7 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -42,6 +42,8 @@
#include <o3tl/safeint.hxx>
#include <opengl/salbmp.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
+#include <skia/salbmp.hxx>
+#include <vcl/skia/SkiaHelper.hxx>
#if defined HAVE_VALGRIND_HEADERS
#include <valgrind/valgrind.h>
@@ -52,7 +54,9 @@
std::shared_ptr<SalBitmap> X11SalInstance::CreateSalBitmap()
{
- if (OpenGLHelper::isVCLOpenGLEnabled())
+ if (SkiaHelper::isVCLSkiaEnabled())
+ return std::make_shared<SkiaSalBitmap>();
+ else if (OpenGLHelper::isVCLOpenGLEnabled())
return std::make_shared<OpenGLSalBitmap>();
else
return std::make_shared<X11SalBitmap>();
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 5c1999661783..4f7be8f147b6 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -45,14 +45,17 @@
#include <salvd.hxx>
#include "gdiimpl.hxx"
#include <opengl/x11/gdiimpl.hxx>
+#include <skia/x11/gdiimpl.hxx>
#include <unx/x11/x11cairotextrender.hxx>
#include <opengl/x11/cairotextrender.hxx>
+#include <skia/x11/cairotextrender.hxx>
#include <unx/x11/xrender_peer.hxx>
#include "cairo_xlib_cairo.hxx"
#include <cairo-xlib.h>
#include <vcl/opengl/OpenGLHelper.hxx>
+#include <vcl/skia/SkiaHelper.hxx>
X11SalGraphics::X11SalGraphics():
m_pFrame(nullptr),
@@ -72,9 +75,15 @@ X11SalGraphics::X11SalGraphics():
hBrush_(None),
bWindow_(false),
bVirDev_(false),
- m_bOpenGL(OpenGLHelper::isVCLOpenGLEnabled())
+ m_bOpenGL(OpenGLHelper::isVCLOpenGLEnabled()),
+ m_bSkia(SkiaHelper::isVCLSkiaEnabled())
{
- if (m_bOpenGL)
+ if (m_bSkia)
+ {
+ mxImpl.reset(new X11SkiaSalGraphicsImpl(*this));
+ mxTextRenderImpl.reset(new SkiaX11CairoTextRender(*this));
+ }
+ else if (m_bOpenGL)
{
mxImpl.reset(new X11OpenGLSalGraphicsImpl(*this));
mxTextRenderImpl.reset(new OpenGLX11CairoTextRender(*this));
@@ -582,7 +591,7 @@ bool X11SalGraphics::drawPolyPolygon(
// enable by setting to something
static const char* pUseCairoForPolygons(getenv("SAL_ENABLE_USE_CAIRO_FOR_POLYGONS"));
- if (!m_bOpenGL && nullptr != pUseCairoForPolygons && SupportsCairo())
+ if (!m_bOpenGL && !m_bSkia && nullptr != pUseCairoForPolygons && SupportsCairo())
{
// snap to raster if requested
const bool bSnapPoints(!getAntiAliasB2DDraw());
@@ -702,7 +711,7 @@ bool X11SalGraphics::drawPolyLine(
// disable by setting to something
static const char* pUseCairoForFatLines(getenv("SAL_DISABLE_USE_CAIRO_FOR_FATLINES"));
- if (!m_bOpenGL && nullptr == pUseCairoForFatLines && SupportsCairo())
+ if (!m_bOpenGL && !m_bSkia && nullptr == pUseCairoForFatLines && SupportsCairo())
{
cairo_t* cr = getCairoContext();
clipRegion(cr);
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index 156e2e342483..780fdde4453a 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -29,14 +29,18 @@
#include <unx/x11/xlimits.hxx>
#include <vcl/opengl/OpenGLHelper.hxx>
+#include <vcl/skia/SkiaHelper.hxx>
#include <opengl/x11/salvd.hxx>
+#include <skia/x11/salvd.hxx>
std::unique_ptr<SalVirtualDevice> X11SalInstance::CreateX11VirtualDevice(SalGraphics const * pGraphics,
long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData,
std::unique_ptr<X11SalGraphics> pNewGraphics)
{
assert(pNewGraphics);
- if (OpenGLHelper::isVCLOpenGLEnabled())
+ if (SkiaHelper::isVCLSkiaEnabled())
+ return std::unique_ptr<SalVirtualDevice>(new X11SkiaSalVirtualDevice( pGraphics, nDX, nDY, pData, std::move(pNewGraphics) ));
+ else if (OpenGLHelper::isVCLOpenGLEnabled())
return std::unique_ptr<SalVirtualDevice>(new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, pData, std::move(pNewGraphics) ));
else
return std::unique_ptr<SalVirtualDevice>(new X11SalVirtualDevice(pGraphics, nDX, nDY, eFormat, pData, std::move(pNewGraphics)));