[Libreoffice-commits] core.git: Branch 'feature/kde5' - vcl/Library_vclplug_kde5.mk vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Fri Sep 29 15:37:36 UTC 2017
vcl/Library_vclplug_kde5.mk | 1 +
vcl/unx/kde5/KDE5SalFrame.cxx | 6 ++++++
vcl/unx/kde5/KDE5SalFrame.hxx | 4 +++-
3 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit dd2adee4dc6997bfcdd0284976579e8dd51f7737
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Sep 29 17:26:26 2017 +0200
Add cairo surface to KDE5SalFrames
Change-Id: I0778ecffe5dbc5fdfe24705d37511e197a4a1ce4
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 7775fbf9a71a..cfd6beb524ce 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_kde5,\
$(eval $(call gb_Library_use_externals,vclplug_kde5,\
boost_headers \
+ cairo \
icuuc \
kde5 \
epoxy \
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 1cdc503ff4f8..1e405ef629d1 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -340,6 +340,7 @@ void KDE5SalFrame::ReleaseGraphics( SalGraphics *pGraphics )
if( m_aGraphics[i].pGraphics.get() == pGraphics )
{
m_aGraphics[i].bInUse = false;
+ cairo_surface_destroy( m_aGraphics[i].pSurface );
break;
}
}
@@ -359,6 +360,7 @@ SalGraphics* KDE5SalFrame::AcquireGraphics()
{
if( GetWindow() )
{
+ basegfx::B2IVector aSize( 142, 142 );
for( int i = 0; i < nMaxGraphics; i++ )
{
if( ! m_aGraphics[i].bInUse )
@@ -367,6 +369,10 @@ SalGraphics* KDE5SalFrame::AcquireGraphics()
if( ! m_aGraphics[i].pGraphics )
{
m_aGraphics[i].pGraphics.reset( new KDE5SalGraphics( this, m_pWindow ) );
+
+ //FIXME: those parameters are completely arbitrary, IDK what the right ones should be yet
+ m_aGraphics[i].pSurface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, aSize.getX(), aSize.getY() );
+ m_aGraphics[i].pGraphics->setSurface( m_aGraphics[i].pSurface, aSize );
//m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
}
return m_aGraphics[i].pGraphics.get();
diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx
index 7d0fa51d2eb6..ab98ee933c2a 100644
--- a/vcl/unx/kde5/KDE5SalFrame.hxx
+++ b/vcl/unx/kde5/KDE5SalFrame.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <memory>
+#include <cairo.h>
#include <unx/saldisp.hxx>
#include <unx/salframe.h>
@@ -39,8 +40,9 @@ class KDE5SalFrame : public SalFrame
{
std::unique_ptr<KDE5SalGraphics> pGraphics;
bool bInUse;
+ cairo_surface_t* pSurface;
- GraphicsHolder() : bInUse( false ) {}
+ GraphicsHolder() : bInUse( false ), pSurface(nullptr) {}
};
GraphicsHolder m_aGraphics[ nMaxGraphics ];
More information about the Libreoffice-commits
mailing list