Move lanczos filter away from KWin core
Summary: Lanczos filter shouldn't be in KWin core because it's quite specific about rendering backend. Test Plan: Windows in the desktop grid look normal. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: mart, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18774
This commit is contained in:
parent
16a2799b3a
commit
be8729105f
7 changed files with 17 additions and 18 deletions
|
@ -437,7 +437,6 @@ set(kwin_KDEINIT_SRCS
|
||||||
scene.cpp
|
scene.cpp
|
||||||
screenlockerwatcher.cpp
|
screenlockerwatcher.cpp
|
||||||
thumbnailitem.cpp
|
thumbnailitem.cpp
|
||||||
lanczosfilter.cpp
|
|
||||||
deleted.cpp
|
deleted.cpp
|
||||||
effects.cpp
|
effects.cpp
|
||||||
effectloader.cpp
|
effectloader.cpp
|
||||||
|
@ -552,8 +551,6 @@ qt5_add_dbus_interface( kwin_KDEINIT_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/org.freede
|
||||||
|
|
||||||
qt5_add_dbus_interface( kwin_KDEINIT_SRCS org.kde.kappmenu.xml appmenu_interface )
|
qt5_add_dbus_interface( kwin_KDEINIT_SRCS org.kde.kappmenu.xml appmenu_interface )
|
||||||
|
|
||||||
qt5_add_resources( kwin_KDEINIT_SRCS resources.qrc )
|
|
||||||
|
|
||||||
ki18n_wrap_ui(kwin_KDEINIT_SRCS
|
ki18n_wrap_ui(kwin_KDEINIT_SRCS
|
||||||
debug_console.ui
|
debug_console.ui
|
||||||
shortcutdialog.ui
|
shortcutdialog.ui
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
set(SCENE_OPENGL_SRCS scene_opengl.cpp)
|
set(SCENE_OPENGL_SRCS
|
||||||
|
scene_opengl.cpp
|
||||||
|
lanczosfilter.cpp
|
||||||
|
)
|
||||||
|
|
||||||
include(ECMQtDeclareLoggingCategory)
|
include(ECMQtDeclareLoggingCategory)
|
||||||
ecm_qt_declare_logging_category(
|
ecm_qt_declare_logging_category(
|
||||||
|
@ -12,7 +15,9 @@ ecm_qt_declare_logging_category(
|
||||||
Critical
|
Critical
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(KWinSceneOpenGL MODULE scene_opengl.cpp)
|
qt5_add_resources(SCENE_OPENGL_SRCS resources.qrc)
|
||||||
|
|
||||||
|
add_library(KWinSceneOpenGL MODULE ${SCENE_OPENGL_SRCS})
|
||||||
set_target_properties(KWinSceneOpenGL PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.scenes/")
|
set_target_properties(KWinSceneOpenGL PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.scenes/")
|
||||||
target_link_libraries(KWinSceneOpenGL
|
target_link_libraries(KWinSceneOpenGL
|
||||||
kwin
|
kwin
|
||||||
|
|
|
@ -28,6 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
|
|
||||||
|
#include <logging.h>
|
||||||
|
|
||||||
#include <kwinglutils.h>
|
#include <kwinglutils.h>
|
||||||
#include <kwinglplatform.h>
|
#include <kwinglplatform.h>
|
||||||
|
|
||||||
|
@ -65,7 +67,7 @@ void LanczosFilter::init()
|
||||||
m_inited = true;
|
m_inited = true;
|
||||||
const bool force = (qstrcmp(qgetenv("KWIN_FORCE_LANCZOS"), "1") == 0);
|
const bool force = (qstrcmp(qgetenv("KWIN_FORCE_LANCZOS"), "1") == 0);
|
||||||
if (force) {
|
if (force) {
|
||||||
qCWarning(KWIN_CORE) << "Lanczos Filter forced on by environment variable";
|
qCWarning(KWIN_OPENGL) << "Lanczos Filter forced on by environment variable";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!force && options->glSmoothScale() != 2)
|
if (!force && options->glSmoothScale() != 2)
|
||||||
|
@ -87,10 +89,10 @@ void LanczosFilter::init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QFile ff(gl->glslVersion() >= kVersionNumber(1, 40) ?
|
QFile ff(gl->glslVersion() >= kVersionNumber(1, 40) ?
|
||||||
QStringLiteral(":/resources/shaders/1.40/lanczos-fragment.glsl") :
|
QStringLiteral(":/scenes/opengl/shaders/1.40/lanczos-fragment.glsl") :
|
||||||
QStringLiteral(":/resources/shaders/1.10/lanczos-fragment.glsl"));
|
QStringLiteral(":/scenes/opengl/shaders/1.10/lanczos-fragment.glsl"));
|
||||||
if (!ff.open(QIODevice::ReadOnly)) {
|
if (!ff.open(QIODevice::ReadOnly)) {
|
||||||
qCDebug(KWIN_CORE) << "Failed to open lanczos shader";
|
qCDebug(KWIN_OPENGL) << "Failed to open lanczos shader";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_shader.reset(ShaderManager::instance()->generateCustomShader(ShaderTrait::MapTexture, QByteArray(), ff.readAll()));
|
m_shader.reset(ShaderManager::instance()->generateCustomShader(ShaderTrait::MapTexture, QByteArray(), ff.readAll()));
|
||||||
|
@ -99,7 +101,7 @@ void LanczosFilter::init()
|
||||||
m_uKernel = m_shader->uniformLocation("kernel");
|
m_uKernel = m_shader->uniformLocation("kernel");
|
||||||
m_uOffsets = m_shader->uniformLocation("offsets");
|
m_uOffsets = m_shader->uniformLocation("offsets");
|
||||||
} else {
|
} else {
|
||||||
qCDebug(KWIN_CORE) << "Shader is not valid";
|
qCDebug(KWIN_OPENGL) << "Shader is not valid";
|
||||||
m_shader.reset();
|
m_shader.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -28,9 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <QVector2D>
|
#include <QVector2D>
|
||||||
#include <QVector4D>
|
#include <QVector4D>
|
||||||
|
|
||||||
#include <kwinconfig.h>
|
|
||||||
#include <kwin_export.h>
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -41,8 +38,7 @@ class GLTexture;
|
||||||
class GLRenderTarget;
|
class GLRenderTarget;
|
||||||
class GLShader;
|
class GLShader;
|
||||||
|
|
||||||
class KWIN_EXPORT LanczosFilter
|
class LanczosFilter : public QObject
|
||||||
: public QObject
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<!DOCTYPE RCC><RCC version="1.0">
|
||||||
<qresource prefix="/resources">
|
<qresource prefix="/scenes/opengl">
|
||||||
<file>shaders/1.10/lanczos-fragment.glsl</file>
|
<file>shaders/1.10/lanczos-fragment.glsl</file>
|
||||||
|
|
||||||
<file>shaders/1.40/lanczos-fragment.glsl</file>
|
<file>shaders/1.40/lanczos-fragment.glsl</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
Loading…
Reference in a new issue