From 6831f25125d27cb040d346ba29cfafba4bf6bd55 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 16 Aug 2022 15:25:09 +0200 Subject: [PATCH] Remove the lookingglass effect It has been broken for a while (at least as long as 5.25) with no bugreports about it. It also doesn't look all that great from the video. --- src/effects/CMakeLists.txt | 1 - src/effects/lookingglass/CMakeLists.txt | 42 --- src/effects/lookingglass/lookingglass.cpp | 270 ------------------ src/effects/lookingglass/lookingglass.h | 77 ----- src/effects/lookingglass/lookingglass.kcfg | 12 - src/effects/lookingglass/lookingglass.qrc | 7 - .../lookingglass/lookingglass_config.cpp | 103 ------- .../lookingglass/lookingglass_config.h | 46 --- .../lookingglass/lookingglass_config.ui | 59 ---- .../lookingglass/lookingglassconfig.kcfgc | 5 - src/effects/lookingglass/main.cpp | 18 -- src/effects/lookingglass/metadata.json | 81 ------ .../lookingglass/shaders/lookingglass.frag | 25 -- .../shaders/lookingglass_core.frag | 28 -- 14 files changed, 774 deletions(-) delete mode 100644 src/effects/lookingglass/CMakeLists.txt delete mode 100644 src/effects/lookingglass/lookingglass.cpp delete mode 100644 src/effects/lookingglass/lookingglass.h delete mode 100644 src/effects/lookingglass/lookingglass.kcfg delete mode 100644 src/effects/lookingglass/lookingglass.qrc delete mode 100644 src/effects/lookingglass/lookingglass_config.cpp delete mode 100644 src/effects/lookingglass/lookingglass_config.h delete mode 100644 src/effects/lookingglass/lookingglass_config.ui delete mode 100644 src/effects/lookingglass/lookingglassconfig.kcfgc delete mode 100644 src/effects/lookingglass/main.cpp delete mode 100644 src/effects/lookingglass/metadata.json delete mode 100644 src/effects/lookingglass/shaders/lookingglass.frag delete mode 100644 src/effects/lookingglass/shaders/lookingglass_core.frag diff --git a/src/effects/CMakeLists.txt b/src/effects/CMakeLists.txt index 48f99bc1f2..3d8fbd5ce9 100644 --- a/src/effects/CMakeLists.txt +++ b/src/effects/CMakeLists.txt @@ -95,7 +95,6 @@ add_subdirectory(blur) add_subdirectory(backgroundcontrast) add_subdirectory(glide) add_subdirectory(invert) -add_subdirectory(lookingglass) add_subdirectory(magnifier) add_subdirectory(mouseclick) add_subdirectory(mousemark) diff --git a/src/effects/lookingglass/CMakeLists.txt b/src/effects/lookingglass/CMakeLists.txt deleted file mode 100644 index 7f924a5443..0000000000 --- a/src/effects/lookingglass/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -####################################### -# Effect - -set(lookingglass_SOURCES - lookingglass.cpp - lookingglass.qrc - main.cpp -) - -kconfig_add_kcfg_files(lookingglass_SOURCES - lookingglassconfig.kcfgc -) - -kwin4_add_effect_module(kwin4_effect_lookingglass ${lookingglass_SOURCES}) -target_link_libraries(kwin4_effect_lookingglass PRIVATE - kwineffects - kwinglutils - - KF5::ConfigGui - KF5::ConfigWidgets - KF5::GlobalAccel - KF5::I18n -) - -####################################### -# Config -if (KWIN_BUILD_KCMS) - set(kwin_lookingglass_config_SRCS lookingglass_config.cpp) - ki18n_wrap_ui(kwin_lookingglass_config_SRCS lookingglass_config.ui) - kconfig_add_kcfg_files(kwin_lookingglass_config_SRCS lookingglassconfig.kcfgc) - - kwin_add_effect_config(kwin_lookingglass_config ${kwin_lookingglass_config_SRCS}) - - target_link_libraries(kwin_lookingglass_config - KF5::ConfigWidgets - KF5::CoreAddons - KF5::GlobalAccel - KF5::I18n - KF5::XmlGui - KWinEffectsInterface - ) -endif() diff --git a/src/effects/lookingglass/lookingglass.cpp b/src/effects/lookingglass/lookingglass.cpp deleted file mode 100644 index 42608ff77b..0000000000 --- a/src/effects/lookingglass/lookingglass.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/* - KWin - the KDE window manager - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2007 Rivo Laks - SPDX-FileCopyrightText: 2007 Christian Nitschkowski - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "lookingglass.h" - -// KConfigSkeleton -#include "lookingglassconfig.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - -Q_LOGGING_CATEGORY(KWIN_LOOKINGGLASS, "kwin_effect_lookingglass", QtWarningMsg) - -static void ensureResources() -{ - // Must initialize resources manually because the effect is a static lib. - Q_INIT_RESOURCE(lookingglass); -} - -namespace KWin -{ - -LookingGlassEffect::LookingGlassEffect() - : zoom(1.0f) - , target_zoom(1.0f) - , polling(false) - , m_texture(nullptr) - , m_fbo(nullptr) - , m_vbo(nullptr) - , m_shader(nullptr) - , m_lastPresentTime(std::chrono::milliseconds::zero()) - , m_enabled(false) - , m_valid(false) -{ - initConfig(); - QAction *a; - a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); - effects->registerGlobalShortcut(Qt::META | Qt::Key_Equal, a); - - a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); - effects->registerGlobalShortcut(Qt::META | Qt::Key_Minus, a); - - a = KStandardAction::actualSize(this, SLOT(toggle()), this); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); - effects->registerGlobalShortcut(Qt::META | Qt::Key_0, a); - - connect(effects, &EffectsHandler::mouseChanged, this, &LookingGlassEffect::slotMouseChanged); - connect(effects, &EffectsHandler::windowDamaged, this, &LookingGlassEffect::slotWindowDamaged); - - reconfigure(ReconfigureAll); -} - -LookingGlassEffect::~LookingGlassEffect() = default; - -bool LookingGlassEffect::supported() -{ - return effects->compositingType() == OpenGLCompositing && !GLPlatform::instance()->supports(LimitedNPOT); -} - -void LookingGlassEffect::reconfigure(ReconfigureFlags) -{ - LookingGlassConfig::self()->read(); - initialradius = LookingGlassConfig::radius(); - radius = initialradius; - qCDebug(KWIN_LOOKINGGLASS) << "Radius from config:" << radius; - m_valid = loadData(); -} - -bool LookingGlassEffect::loadData() -{ - ensureResources(); - - const QSize screenSize = effects->virtualScreenSize(); - int texw = screenSize.width(); - int texh = screenSize.height(); - - // Create texture and render target - const int levels = std::log2(qMin(texw, texh)) + 1; - m_texture = std::make_unique(GL_RGBA8, texw, texh, levels); - m_texture->setFilter(GL_LINEAR_MIPMAP_LINEAR); - m_texture->setWrapMode(GL_CLAMP_TO_EDGE); - - m_fbo = std::make_unique(m_texture.get()); - if (!m_fbo->valid()) { - return false; - } - - m_shader = ShaderManager::instance()->generateShaderFromFile(ShaderTrait::MapTexture, QString(), QStringLiteral(":/effects/lookingglass/shaders/lookingglass.frag")); - if (m_shader->isValid()) { - ShaderBinder binder(m_shader.get()); - m_shader->setUniform("u_textureSize", QVector2D(screenSize.width(), screenSize.height())); - } else { - qCCritical(KWIN_LOOKINGGLASS) << "The shader failed to load!"; - return false; - } - - m_vbo = std::make_unique(GLVertexBuffer::Static); - QVector verts; - QVector texcoords; - texcoords << screenSize.width() << 0.0; - verts << screenSize.width() << 0.0; - texcoords << 0.0 << 0.0; - verts << 0.0 << 0.0; - texcoords << 0.0 << screenSize.height(); - verts << 0.0 << screenSize.height(); - texcoords << 0.0 << screenSize.height(); - verts << 0.0 << screenSize.height(); - texcoords << screenSize.width() << screenSize.height(); - verts << screenSize.width() << screenSize.height(); - texcoords << screenSize.width() << 0.0; - verts << screenSize.width() << 0.0; - m_vbo->setData(6, 2, verts.constData(), texcoords.constData()); - return true; -} - -void LookingGlassEffect::toggle() -{ - if (target_zoom == 1.0f) { - target_zoom = 2.0f; - if (!polling) { - polling = true; - effects->startMousePolling(); - } - m_enabled = true; - } else { - target_zoom = 1.0f; - if (polling) { - polling = false; - effects->stopMousePolling(); - } - if (zoom == target_zoom) { - m_enabled = false; - } - } - effects->addRepaint(cursorPos().x() - radius, cursorPos().y() - radius, 2 * radius, 2 * radius); -} - -void LookingGlassEffect::zoomIn() -{ - target_zoom = qMin(7.0, target_zoom + 0.5); - m_enabled = true; - if (!polling) { - polling = true; - effects->startMousePolling(); - } - effects->addRepaint(magnifierArea()); -} - -void LookingGlassEffect::zoomOut() -{ - target_zoom -= 0.5; - if (target_zoom < 1) { - target_zoom = 1; - if (polling) { - polling = false; - effects->stopMousePolling(); - } - if (zoom == target_zoom) { - m_enabled = false; - } - } - effects->addRepaint(magnifierArea()); -} - -QRect LookingGlassEffect::magnifierArea() const -{ - return QRect(cursorPos().x() - radius, cursorPos().y() - radius, 2 * radius, 2 * radius); -} - -void LookingGlassEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) -{ - const int time = m_lastPresentTime.count() ? (presentTime - m_lastPresentTime).count() : 0; - if (zoom != target_zoom) { - double diff = time / animationTime(500.0); - if (target_zoom > zoom) { - zoom = qMin(zoom * qMax(1.0 + diff, 1.2), target_zoom); - } else { - zoom = qMax(zoom * qMin(1.0 - diff, 0.8), target_zoom); - } - qCDebug(KWIN_LOOKINGGLASS) << "zoom is now " << zoom; - radius = qBound((double)initialradius, initialradius * zoom, 3.5 * initialradius); - - if (zoom <= 1.0f) { - m_enabled = false; - } - - effects->addRepaint(cursorPos().x() - radius, cursorPos().y() - radius, 2 * radius, 2 * radius); - } - if (zoom != target_zoom) { - m_lastPresentTime = presentTime; - } else { - m_lastPresentTime = std::chrono::milliseconds::zero(); - } - if (m_valid && m_enabled) { - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; - // Start rendering to texture - GLFramebuffer::pushFramebuffer(m_fbo.get()); - } - - effects->prePaintScreen(data, presentTime); -} - -void LookingGlassEffect::slotMouseChanged(const QPoint &pos, const QPoint &old, Qt::MouseButtons, - Qt::MouseButtons, Qt::KeyboardModifiers, Qt::KeyboardModifiers) -{ - if (pos != old && m_enabled) { - effects->addRepaint(pos.x() - radius, pos.y() - radius, 2 * radius, 2 * radius); - effects->addRepaint(old.x() - radius, old.y() - radius, 2 * radius, 2 * radius); - } -} - -void LookingGlassEffect::slotWindowDamaged() -{ - if (isActive()) { - effects->addRepaint(magnifierArea()); - } -} - -void LookingGlassEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) -{ - // Call the next effect. - effects->paintScreen(mask, region, data); - if (m_valid && m_enabled) { - // Disable render texture - GLFramebuffer *target = GLFramebuffer::popFramebuffer(); - Q_ASSERT(target == m_fbo.get()); - Q_UNUSED(target); - m_texture->bind(); - m_texture->generateMipmaps(); - - // Use the shader - ShaderBinder binder(m_shader.get()); - m_shader->setUniform("u_zoom", (float)zoom); - m_shader->setUniform("u_radius", (float)radius); - m_shader->setUniform("u_cursor", QVector2D(cursorPos().x(), cursorPos().y())); - m_shader->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix()); - m_vbo->render(GL_TRIANGLES); - m_texture->unbind(); - } -} - -bool LookingGlassEffect::isActive() const -{ - return m_valid && m_enabled; -} - -} // namespace diff --git a/src/effects/lookingglass/lookingglass.h b/src/effects/lookingglass/lookingglass.h deleted file mode 100644 index 3520a18312..0000000000 --- a/src/effects/lookingglass/lookingglass.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - KWin - the KDE window manager - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2007 Rivo Laks - SPDX-FileCopyrightText: 2007 Christian Nitschkowski - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef KWIN_LOOKINGGLASS_H -#define KWIN_LOOKINGGLASS_H - -#include - -namespace KWin -{ - -class GLFramebuffer; -class GLShader; -class GLTexture; -class GLVertexBuffer; - -/** - * Enhanced magnifier - */ -class LookingGlassEffect : public Effect -{ - Q_OBJECT - Q_PROPERTY(int initialRadius READ initialRadius) -public: - LookingGlassEffect(); - ~LookingGlassEffect() override; - - void reconfigure(ReconfigureFlags) override; - - void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override; - void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; - bool isActive() const override; - - static bool supported(); - - // for properties - int initialRadius() const - { - return initialradius; - } - QRect magnifierArea() const; - -public Q_SLOTS: - void toggle(); - void zoomIn(); - void zoomOut(); - void slotMouseChanged(const QPoint &pos, const QPoint &old, - Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, - Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers); - void slotWindowDamaged(); - -private: - bool loadData(); - double zoom; - double target_zoom; - bool polling; // Mouse polling - int radius; - int initialradius; - std::unique_ptr m_texture; - std::unique_ptr m_fbo; - std::unique_ptr m_vbo; - std::unique_ptr m_shader; - std::chrono::milliseconds m_lastPresentTime; - bool m_enabled; - bool m_valid; -}; - -} // namespace - -#endif diff --git a/src/effects/lookingglass/lookingglass.kcfg b/src/effects/lookingglass/lookingglass.kcfg deleted file mode 100644 index 8b6905fedb..0000000000 --- a/src/effects/lookingglass/lookingglass.kcfg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - 200 - - - diff --git a/src/effects/lookingglass/lookingglass.qrc b/src/effects/lookingglass/lookingglass.qrc deleted file mode 100644 index 08aa8b86eb..0000000000 --- a/src/effects/lookingglass/lookingglass.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - shaders/lookingglass.frag - shaders/lookingglass_core.frag - - - diff --git a/src/effects/lookingglass/lookingglass_config.cpp b/src/effects/lookingglass/lookingglass_config.cpp deleted file mode 100644 index 3351795329..0000000000 --- a/src/effects/lookingglass/lookingglass_config.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - KWin - the KDE window manager - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2007 Christian Nitschkowski - - SPDX-License-Identifier: GPL-2.0-or-later -*/ -#include "lookingglass_config.h" - -#include - -// KConfigSkeleton -#include "lookingglassconfig.h" -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -K_PLUGIN_CLASS(KWin::LookingGlassEffectConfig) - -namespace KWin -{ - -LookingGlassEffectConfigForm::LookingGlassEffectConfigForm(QWidget *parent) - : QWidget(parent) -{ - setupUi(this); -} - -LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget *parent, const QVariantList &args) - : KCModule(parent, args) - , m_ui(this) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - layout->addWidget(&m_ui); - - LookingGlassConfig::instance(KWIN_CONFIG); - addConfig(LookingGlassConfig::self(), &m_ui); - connect(m_ui.editor, &KShortcutsEditor::keyChange, this, &LookingGlassEffectConfig::markAsChanged); - - // Shortcut config. The shortcut belongs to the component "kwin"! - m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); - - m_actionCollection->setComponentDisplayName(i18n("KWin")); - m_actionCollection->setConfigGroup(QStringLiteral("LookingGlass")); - m_actionCollection->setConfigGlobal(true); - - QAction *a; - a = m_actionCollection->addAction(KStandardAction::ZoomIn); - a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); - - a = m_actionCollection->addAction(KStandardAction::ZoomOut); - a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_Minus)); - - a = m_actionCollection->addAction(KStandardAction::ActualSize); - a->setProperty("isConfigurationAction", true); - KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_0)); - KGlobalAccel::self()->setShortcut(a, QList() << (Qt::META | Qt::Key_0)); - - m_ui.editor->addCollection(m_actionCollection); -} - -LookingGlassEffectConfig::~LookingGlassEffectConfig() -{ - // Undo (only) unsaved changes to global key shortcuts - m_ui.editor->undo(); -} - -void LookingGlassEffectConfig::save() -{ - qDebug() << "Saving config of LookingGlass"; - KCModule::save(); - - m_ui.editor->save(); // undo() will restore to this state from now on - - OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), - QStringLiteral("/Effects"), - QDBusConnection::sessionBus()); - interface.reconfigureEffect(QStringLiteral("lookingglass")); -} - -void LookingGlassEffectConfig::defaults() -{ - m_ui.editor->allDefault(); - KCModule::defaults(); -} - -} // namespace - -#include "lookingglass_config.moc" diff --git a/src/effects/lookingglass/lookingglass_config.h b/src/effects/lookingglass/lookingglass_config.h deleted file mode 100644 index 136ceb6cca..0000000000 --- a/src/effects/lookingglass/lookingglass_config.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - KWin - the KDE window manager - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2007 Christian Nitschkowski - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#ifndef KWIN_LOOKINGGLASS_CONFIG_H -#define KWIN_LOOKINGGLASS_CONFIG_H - -#include - -#include "ui_lookingglass_config.h" - -class KActionCollection; - -namespace KWin -{ - -class LookingGlassEffectConfigForm : public QWidget, public Ui::LookingGlassEffectConfigForm -{ - Q_OBJECT -public: - explicit LookingGlassEffectConfigForm(QWidget *parent); -}; - -class LookingGlassEffectConfig : public KCModule -{ - Q_OBJECT -public: - explicit LookingGlassEffectConfig(QWidget *parent = nullptr, const QVariantList &args = QVariantList()); - ~LookingGlassEffectConfig() override; - - void save() override; - void defaults() override; - -private: - LookingGlassEffectConfigForm m_ui; - KActionCollection *m_actionCollection; -}; - -} // namespace - -#endif diff --git a/src/effects/lookingglass/lookingglass_config.ui b/src/effects/lookingglass/lookingglass_config.ui deleted file mode 100644 index 7fec55e9b1..0000000000 --- a/src/effects/lookingglass/lookingglass_config.ui +++ /dev/null @@ -1,59 +0,0 @@ - - - KWin::LookingGlassEffectConfigForm - - - - 0 - 0 - 275 - 185 - - - - - - - KShortcutsEditor::GlobalAction - - - - - - - &Radius: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_Radius - - - - - - - - 0 - 0 - - - - 9999 - - - - - - - - KShortcutsEditor - QWidget -
KShortcutsEditor
- 1 -
-
- - -
diff --git a/src/effects/lookingglass/lookingglassconfig.kcfgc b/src/effects/lookingglass/lookingglassconfig.kcfgc deleted file mode 100644 index 6b35b53fcf..0000000000 --- a/src/effects/lookingglass/lookingglassconfig.kcfgc +++ /dev/null @@ -1,5 +0,0 @@ -File=lookingglass.kcfg -ClassName=LookingGlassConfig -NameSpace=KWin -Singleton=true -Mutators=true diff --git a/src/effects/lookingglass/main.cpp b/src/effects/lookingglass/main.cpp deleted file mode 100644 index d98142ff46..0000000000 --- a/src/effects/lookingglass/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - SPDX-FileCopyrightText: 2021 Vlad Zahorodnii - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -#include "lookingglass.h" - -namespace KWin -{ - -KWIN_EFFECT_FACTORY_SUPPORTED(LookingGlassEffect, - "metadata.json.stripped", - return LookingGlassEffect::supported();) - -} // namespace KWin - -#include "main.moc" diff --git a/src/effects/lookingglass/metadata.json b/src/effects/lookingglass/metadata.json deleted file mode 100644 index af2afffdd1..0000000000 --- a/src/effects/lookingglass/metadata.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "KPlugin": { - "Category": "Accessibility", - "Description": "A screen magnifier that looks like a fisheye lens", - "Description[ar]": "مكبّرة شاشة تطالع كما عدسة عينا السمكة", - "Description[az]": "Ekrandakı sahəni linza effekti ilə göstərir", - "Description[bg]": "Екранна лупа, която прилича на леща тип рибешко око", - "Description[ca@valencia]": "Una lupa de pantalla que pareix una lent amb ull de peix", - "Description[ca]": "Una lupa de pantalla que sembla una lent amb ull de peix", - "Description[cs]": "Lupa, která vypadá jako rybí oko", - "Description[de]": "Eine Lupe, die wie eine Fischaugen-Linse funktioniert", - "Description[en_GB]": "A screen magnifier that looks like a fisheye lens", - "Description[es]": "Una lupa de pantalla que simula una lente de ojo de pez", - "Description[fi]": "Kalansilmälinssiltä näyttävä suurennuslasi", - "Description[fr]": "Une loupe d'écran ressemblant à une lentille grand angle", - "Description[hu]": "Halszem-optikájú nagyító", - "Description[ia]": "Un aggranditor de schermo semblante lentes fisheye", - "Description[id]": "Sebuah kaca-pembesar layar yang terlihat seperti lensa mata ikan", - "Description[it]": "Un ingranditore dello schermo che sembra una lente a occhio di pesce", - "Description[ko]": "어안 렌즈를 통해서 화면을 확대합니다", - "Description[nl]": "Een schermvergrootglas dat er uitziet als een visooglens", - "Description[nn]": "Skjermforstørring forma som ei fiskeaugelinse", - "Description[pl]": "Powiększa ekran przez \"rybie oko\"", - "Description[pt]": "Uma lupa do ecrã que parece uma lente de olho-de-peixe", - "Description[pt_BR]": "Uma lupa da área de trabalho que parece uma lente de olho-de-peixe", - "Description[ro]": "Lupă pentru ecran ce arată ca o lentilă de ochi de pește", - "Description[ru]": "Показ области экрана с эффектом линзы", - "Description[sk]": "Lupa obrazovky s efektom rybieho oka", - "Description[sl]": "Povečevalo zaslona, ki deluje kot objektiv ribjega očesa", - "Description[sv]": "Ett skärmförstoringsglas som ser ut som en fiskögonlins", - "Description[ta]": "பூதக்கண்ணாடியை போல திரையில் உள்ளவற்றை பெரிதாக்கும்", - "Description[tr]": "Bir balık gözlü lense benzeyen bir ekran büyüteci", - "Description[uk]": "Екранна лупа, яка робить вигляд стільниці схожим на зображення, отримане з ефектом «риб’ячого ока»", - "Description[vi]": "Một trình phóng đại màn hình trông như một thấu kính mắt cá", - "Description[x-test]": "xxA screen magnifier that looks like a fisheye lensxx", - "Description[zh_CN]": "放大显示鼠标光标附近的一块圆形的屏幕内容,效果类似鱼眼镜头", - "Description[zh_TW]": "看起來像是魚眼鏡頭的螢幕放大鏡", - "EnabledByDefault": false, - "Id": "lookingglass", - "License": "GPL", - "Name": "Looking Glass", - "Name[ar]": "عدسة عين السمكة", - "Name[az]": "Linza", - "Name[bg]": "Стъклена леща", - "Name[ca@valencia]": "Aspecte de vidre", - "Name[ca]": "Aspecte de vidre", - "Name[cs]": "Lupa", - "Name[de]": "Bildschirmlupe", - "Name[en_GB]": "Looking Glass", - "Name[es]": "Espejo", - "Name[fi]": "Suurennuslasi", - "Name[fr]": "Mirroir", - "Name[hu]": "Tükör", - "Name[ia]": "Looking Glass", - "Name[id]": "Looking Glass", - "Name[it]": "Specchio", - "Name[ko]": "들여다보는 돋보기", - "Name[nl]": "Vergrootglas", - "Name[nn]": "Forstørringsglas", - "Name[pl]": "Lupa", - "Name[pt]": "Aparência de Vidro", - "Name[pt_BR]": "Espelho", - "Name[ro]": "Lentilă", - "Name[ru]": "Линза", - "Name[sk]": "Šošovka", - "Name[sl]": "Izložba", - "Name[sv]": "Förstoringsglas", - "Name[ta]": "பூதக்கண்ணாடி", - "Name[tr]": "Ayna", - "Name[uk]": "Збільшувальне скло", - "Name[vi]": "Kính lúp", - "Name[x-test]": "xxLooking Glassxx", - "Name[zh_CN]": "放大镜 (鱼眼)", - "Name[zh_TW]": "鏡中世界" - }, - "X-KDE-ConfigModule": "kwin_lookingglass_config", - "org.kde.kwin.effect": { - "exclusiveGroup": "magnifiers", - "video": "https://files.kde.org/plasma/kwin/effect-videos/looking_glass.ogv" - } -} diff --git a/src/effects/lookingglass/shaders/lookingglass.frag b/src/effects/lookingglass/shaders/lookingglass.frag deleted file mode 100644 index 992c9d42b8..0000000000 --- a/src/effects/lookingglass/shaders/lookingglass.frag +++ /dev/null @@ -1,25 +0,0 @@ -uniform sampler2D sampler; -uniform vec2 u_cursor; -uniform float u_zoom; -uniform float u_radius; -uniform vec2 u_textureSize; - -varying vec2 texcoord0; - -#define PI 3.14159 - -void main() -{ - vec2 d = u_cursor - texcoord0; - float dist = sqrt(d.x*d.x + d.y*d.y); - vec2 texcoord = texcoord0; - if (dist < u_radius) { - float disp = sin(dist / u_radius * PI) * (u_zoom - 1.0) * 20.0; - texcoord += d / dist * disp; - } - - texcoord = texcoord/u_textureSize; - texcoord.t = 1.0 - texcoord.t; - gl_FragColor = texture2D(sampler, texcoord); -} - diff --git a/src/effects/lookingglass/shaders/lookingglass_core.frag b/src/effects/lookingglass/shaders/lookingglass_core.frag deleted file mode 100644 index 56cf3cea8d..0000000000 --- a/src/effects/lookingglass/shaders/lookingglass_core.frag +++ /dev/null @@ -1,28 +0,0 @@ -#version 140 -uniform sampler2D sampler; -uniform vec2 u_cursor; -uniform float u_zoom; -uniform float u_radius; -uniform vec2 u_textureSize; - -in vec2 texcoord0; - -out vec4 fragColor; - -#define PI 3.14159 - -void main() -{ - vec2 d = u_cursor - texcoord0; - float dist = sqrt(d.x*d.x + d.y*d.y); - vec2 texcoord = texcoord0; - if (dist < u_radius) { - float disp = sin(dist / u_radius * PI) * (u_zoom - 1.0) * 20.0; - texcoord += d / dist * disp; - } - - texcoord = texcoord/u_textureSize; - texcoord.t = 1.0 - texcoord.t; - fragColor = texture(sampler, texcoord); -} -