Merge branch 'KDE/4.11'
This commit is contained in:
commit
84b92a53d3
8 changed files with 30 additions and 31 deletions
|
@ -15,6 +15,13 @@ install( FILES
|
|||
|
||||
# Data files
|
||||
install( FILES
|
||||
logout/data/vignetting.frag
|
||||
logout/data/logout-blur.frag
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin )
|
||||
logout/data/1.10/vignetting.frag
|
||||
logout/data/1.10/logout-blur.frag
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin/shaders/1.10
|
||||
)
|
||||
|
||||
install( FILES
|
||||
logout/data/1.40/vignetting.frag
|
||||
logout/data/1.40/logout-blur.frag
|
||||
DESTINATION ${DATA_INSTALL_DIR}/kwin/shaders/1.40
|
||||
)
|
||||
|
|
|
@ -50,6 +50,7 @@ LogoutEffect::LogoutEffect()
|
|||
, ignoredWindows()
|
||||
, m_vignettingShader(NULL)
|
||||
, m_blurShader(NULL)
|
||||
, m_shadersDir("kwin/shaders/1.10/")
|
||||
{
|
||||
// Persistent effect
|
||||
logoutAtom = XInternAtom(display(), "_KDE_LOGGING_OUT", False);
|
||||
|
@ -71,6 +72,14 @@ LogoutEffect::LogoutEffect()
|
|||
connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*)));
|
||||
connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*)));
|
||||
connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long)));
|
||||
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
const qint64 coreVersionNumber = kVersionNumber(3, 0);
|
||||
#else
|
||||
const qint64 coreVersionNumber = kVersionNumber(1, 40);
|
||||
#endif
|
||||
if (GLPlatform::instance()->glslVersion() >= coreVersionNumber)
|
||||
m_shadersDir = "kwin/shaders/1.40/";
|
||||
}
|
||||
|
||||
LogoutEffect::~LogoutEffect()
|
||||
|
@ -296,10 +305,8 @@ void LogoutEffect::renderVignetting()
|
|||
return;
|
||||
}
|
||||
if (!m_vignettingShader) {
|
||||
const char *shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ?
|
||||
"kwin/vignetting-140.frag" : "kwin/vignetting.frag";
|
||||
m_vignettingShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::ColorShader,
|
||||
KGlobal::dirs()->findResource("data", shader));
|
||||
KGlobal::dirs()->findResource("data", m_shadersDir + "vignetting.frag"));
|
||||
if (!m_vignettingShader->isValid()) {
|
||||
kDebug(1212) << "Vignetting Shader failed to load";
|
||||
return;
|
||||
|
@ -378,10 +385,8 @@ void LogoutEffect::renderBlurTexture()
|
|||
return;
|
||||
}
|
||||
if (!m_blurShader) {
|
||||
const char *shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ?
|
||||
"kwin/logout-blur-140.frag" : "kwin/logout-blur.frag";
|
||||
m_blurShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::SimpleShader,
|
||||
KGlobal::dirs()->findResource("data", shader));
|
||||
KGlobal::dirs()->findResource("data", m_shadersDir + "logout-blur.frag"));
|
||||
if (!m_blurShader->isValid()) {
|
||||
kDebug(1212) << "Logout blur shader failed to load";
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ private:
|
|||
QHash< EffectWindow*, double > windowsOpacities;
|
||||
GLShader *m_vignettingShader;
|
||||
GLShader *m_blurShader;
|
||||
QString m_shadersDir;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -184,28 +184,14 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region,
|
|||
init();
|
||||
const QRect screenRect = Workspace::self()->clientArea(ScreenArea, w->screen(), w->desktop());
|
||||
// window geometry may not be bigger than screen geometry to fit into the FBO
|
||||
if (m_shader && w->width() <= screenRect.width() && w->height() <= screenRect.height()) {
|
||||
double left = 0;
|
||||
double top = 0;
|
||||
double right = w->width();
|
||||
double bottom = w->height();
|
||||
foreach (const WindowQuad & quad, data.quads) {
|
||||
// we need this loop to include the decoration padding
|
||||
left = qMin(left, quad.left());
|
||||
top = qMin(top, quad.top());
|
||||
right = qMax(right, quad.right());
|
||||
bottom = qMax(bottom, quad.bottom());
|
||||
}
|
||||
double width = right - left;
|
||||
double height = bottom - top;
|
||||
if (width > screenRect.width() || height > screenRect.height()) {
|
||||
// window with padding does not fit into the framebuffer
|
||||
// so cut of the shadow
|
||||
left = 0;
|
||||
top = 0;
|
||||
width = w->width();
|
||||
height = w->height();
|
||||
}
|
||||
QRect winGeo(w->expandedGeometry());
|
||||
if (m_shader && winGeo.width() <= screenRect.width() && winGeo.height() <= screenRect.height()) {
|
||||
winGeo.translate(-w->geometry().topLeft());
|
||||
double left = winGeo.left();
|
||||
double top = winGeo.top();
|
||||
double width = winGeo.right() - left;
|
||||
double height = winGeo.bottom() - top;
|
||||
|
||||
int tx = data.xTranslation() + w->x() + left * data.xScale();
|
||||
int ty = data.yTranslation() + w->y() + top * data.yScale();
|
||||
int tw = width * data.xScale();
|
||||
|
|
Loading…
Reference in a new issue