Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show All 27 Lines | |||||
28 | *********************************************************************/ | 28 | *********************************************************************/ | ||
29 | #include "scene_opengl.h" | 29 | #include "scene_opengl.h" | ||
30 | 30 | | |||
31 | #include "platform.h" | 31 | #include "platform.h" | ||
32 | #include "wayland_server.h" | 32 | #include "wayland_server.h" | ||
33 | #include "platformsupport/scenes/opengl/texture.h" | 33 | #include "platformsupport/scenes/opengl/texture.h" | ||
34 | 34 | | |||
35 | #include <kwinglplatform.h> | 35 | #include <kwinglplatform.h> | ||
36 | #include <kwineffectquickview.h> | ||||
36 | 37 | | |||
37 | #include "utils.h" | 38 | #include "utils.h" | ||
38 | #include "client.h" | 39 | #include "client.h" | ||
39 | #include "composite.h" | 40 | #include "composite.h" | ||
40 | #include "deleted.h" | 41 | #include "deleted.h" | ||
41 | #include "effects.h" | 42 | #include "effects.h" | ||
42 | #include "lanczosfilter.h" | 43 | #include "lanczosfilter.h" | ||
43 | #include "main.h" | 44 | #include "main.h" | ||
▲ Show 20 Lines • Show All 807 Lines • ▼ Show 20 Line(s) | |||||
851 | { | 852 | { | ||
852 | const QRect r = region.boundingRect(); | 853 | const QRect r = region.boundingRect(); | ||
853 | glEnable(GL_SCISSOR_TEST); | 854 | glEnable(GL_SCISSOR_TEST); | ||
854 | glScissor(r.x(), screens()->size().height() - r.y() - r.height(), r.width(), r.height()); | 855 | glScissor(r.x(), screens()->size().height() - r.y() - r.height(), r.width(), r.height()); | ||
855 | KWin::Scene::paintDesktop(desktop, mask, region, data); | 856 | KWin::Scene::paintDesktop(desktop, mask, region, data); | ||
856 | glDisable(GL_SCISSOR_TEST); | 857 | glDisable(GL_SCISSOR_TEST); | ||
857 | } | 858 | } | ||
858 | 859 | | |||
860 | void SceneOpenGL::paintEffectQuickView(EffectQuickView *w) | ||||
861 | { | ||||
862 | GLShader* shader = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture); | ||||
zzag: Style: wrong alignment of `*` | |||||
863 | const QRect rect = w->geometry(); | ||||
864 | | ||||
865 | GLTexture *t = w->bufferAsTexture(); | ||||
866 | if (!t) { | ||||
867 | return; | ||||
868 | } | ||||
869 | | ||||
870 | QMatrix4x4 mvp(projectionMatrix()); | ||||
871 | mvp.translate(rect.x(), rect.y()); | ||||
872 | shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp); | ||||
873 | | ||||
874 | glEnable(GL_BLEND); | ||||
875 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
876 | | ||||
877 | t->bind(); | ||||
878 | t->render(QRegion(infiniteRegion()), w->geometry()); | ||||
879 | t->unbind(); | ||||
880 | glDisable(GL_BLEND); | ||||
881 | return; | ||||
882 | } | ||||
883 | | ||||
859 | bool SceneOpenGL::makeOpenGLContextCurrent() | 884 | bool SceneOpenGL::makeOpenGLContextCurrent() | ||
860 | { | 885 | { | ||
861 | return m_backend->makeCurrent(); | 886 | return m_backend->makeCurrent(); | ||
862 | } | 887 | } | ||
863 | 888 | | |||
864 | void SceneOpenGL::doneOpenGLContextCurrent() | 889 | void SceneOpenGL::doneOpenGLContextCurrent() | ||
865 | { | 890 | { | ||
866 | m_backend->doneCurrent(); | 891 | m_backend->doneCurrent(); | ||
▲ Show 20 Lines • Show All 1727 Lines • Show Last 20 Lines |
Style: wrong alignment of *