Move XRenderUtils init/cleanup into X11 standalone platform

Summary:
Only needed for kwin_x11 variant (required for the non-composited
Outline). As that's nowadays in the x11 platform, we can move the
complete XRenderUtils support into the platform. Thus KWin core does
no longer require to link it.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7760
This commit is contained in:
Martin Flöser 2017-09-10 16:03:11 +02:00
parent 0a6bd71f0e
commit 551a6246a8
6 changed files with 7 additions and 11 deletions

View file

@ -526,7 +526,6 @@ ki18n_wrap_ui(kwin_KDEINIT_SRCS
set(kwin_OWN_LIBS set(kwin_OWN_LIBS
kwineffects kwineffects
kwinxrenderutils
kwin4_effect_builtins kwin4_effect_builtins
) )

View file

@ -20,7 +20,7 @@ if(HAVE_EPOXY_GLX)
endif() endif()
add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES}) add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES})
target_link_libraries(KWinX11Platform eglx11common kwin Qt5::X11Extras XCB::CURSOR) target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils Qt5::X11Extras XCB::CURSOR)
if(X11_Xinput_FOUND) if(X11_Xinput_FOUND)
target_link_libraries(KWinX11Platform ${X11_Xinput_LIB}) target_link_libraries(KWinX11Platform ${X11_Xinput_LIB})
endif() endif()

View file

@ -41,6 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "workspace.h" #include "workspace.h"
#include "x11_decoration_renderer.h" #include "x11_decoration_renderer.h"
#include <kwinxrenderutils.h>
#include <KConfigGroup> #include <KConfigGroup>
#include <KLocalizedString> #include <KLocalizedString>
@ -76,6 +78,7 @@ X11StandalonePlatform::~X11StandalonePlatform()
m_openGLFreezeProtectionThread->wait(); m_openGLFreezeProtectionThread->wait();
delete m_openGLFreezeProtectionThread; delete m_openGLFreezeProtectionThread;
} }
XRenderUtils::cleanup();
} }
void X11StandalonePlatform::init() void X11StandalonePlatform::init()
@ -84,6 +87,7 @@ void X11StandalonePlatform::init()
emit initFailed(); emit initFailed();
return; return;
} }
XRenderUtils::init(kwinApp()->x11Connection(), kwinApp()->x11RootWindow());
setReady(true); setReady(true);
emit screensQueried(); emit screensQueried();
} }

View file

@ -6,7 +6,7 @@ set(X11BACKEND_SOURCES
) )
add_library(KWinWaylandX11Backend MODULE ${X11BACKEND_SOURCES}) add_library(KWinWaylandX11Backend MODULE ${X11BACKEND_SOURCES})
target_link_libraries(KWinWaylandX11Backend eglx11common kwin X11::XCB SceneQPainterBackend) target_link_libraries(KWinWaylandX11Backend eglx11common kwin kwinxrenderutils X11::XCB SceneQPainterBackend)
install( install(
TARGETS TARGETS

View file

@ -15,6 +15,7 @@ ecm_qt_declare_logging_category(
add_library(KWinSceneXRender MODULE ${SCENE_XRENDER_SRCS}) add_library(KWinSceneXRender MODULE ${SCENE_XRENDER_SRCS})
target_link_libraries(KWinSceneXRender target_link_libraries(KWinSceneXRender
kwin kwin
kwinxrenderutils
) )
install( install(

View file

@ -22,7 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "workspace.h" #include "workspace.h"
// kwin libs // kwin libs
#include <kwinglplatform.h> #include <kwinglplatform.h>
#include <kwinxrenderutils.h>
// kwin // kwin
#ifdef KWIN_BUILD_ACTIVITIES #ifdef KWIN_BUILD_ACTIVITIES
#include "activities.h" #include "activities.h"
@ -183,10 +182,6 @@ Workspace::Workspace(const QString &sessionKey)
TabBox::TabBox::create(this); TabBox::TabBox::create(this);
#endif #endif
// init XRenderUtils
if (kwinApp()->operationMode() == Application::OperationModeX11) {
XRenderUtils::init(connection(), rootWindow());
}
if (Compositor::self()) { if (Compositor::self()) {
m_compositor = Compositor::self(); m_compositor = Compositor::self();
} else { } else {
@ -514,9 +509,6 @@ Workspace::~Workspace()
// TODO: ungrabXServer(); // TODO: ungrabXServer();
if (kwinApp()->operationMode() == Application::OperationModeX11) {
XRenderUtils::cleanup();
}
Xcb::Extensions::destroy(); Xcb::Extensions::destroy();
_self = 0; _self = 0;
} }