[kwineffects] Pass screen projection matrix to EffectFrame
Exposes the current screen projection matrix in the render pass of the EffectFrame, so that effects can make use of it.
This commit is contained in:
parent
ef7f7b0179
commit
2e7bc0df87
4 changed files with 32 additions and 0 deletions
|
@ -1930,6 +1930,7 @@ void EffectFrameImpl::render(QRegion region, double opacity, double frameOpacity
|
|||
return; // Nothing to display
|
||||
}
|
||||
m_shader = NULL;
|
||||
setScreenProjectionMatrix(static_cast<EffectsHandlerImpl*>(effects)->scene()->screenProjectionMatrix());
|
||||
effects->paintEffectFrame(this, region, opacity, frameOpacity);
|
||||
}
|
||||
|
||||
|
|
|
@ -226,6 +226,10 @@ public:
|
|||
|
||||
KWayland::Server::Display *waylandDisplay() const override;
|
||||
|
||||
Scene *scene() const {
|
||||
return m_scene;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotCurrentTabAboutToChange(EffectWindow* from, EffectWindow* to);
|
||||
void slotTabAdded(EffectWindow* from, EffectWindow* to);
|
||||
|
|
|
@ -1788,6 +1788,7 @@ public:
|
|||
|
||||
bool crossFading;
|
||||
qreal crossFadeProgress;
|
||||
QMatrix4x4 screenProjectionMatrix;
|
||||
};
|
||||
|
||||
EffectFramePrivate::EffectFramePrivate()
|
||||
|
@ -1833,6 +1834,16 @@ void EffectFrame::enableCrossFade(bool enable)
|
|||
d->crossFading = enable;
|
||||
}
|
||||
|
||||
QMatrix4x4 EffectFrame::screenProjectionMatrix() const
|
||||
{
|
||||
return d->screenProjectionMatrix;
|
||||
}
|
||||
|
||||
void EffectFrame::setScreenProjectionMatrix(const QMatrix4x4 &spm)
|
||||
{
|
||||
d->screenProjectionMatrix = spm;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#include "kwineffects.moc"
|
||||
|
|
|
@ -2937,6 +2937,22 @@ public:
|
|||
**/
|
||||
qreal crossFadeProgress() const;
|
||||
|
||||
/**
|
||||
* Returns The projection matrix as used by the current screen painting pass
|
||||
* including screen transformations.
|
||||
*
|
||||
* This matrix is only valid during a rendering pass started by render.
|
||||
*
|
||||
* @since 5.6
|
||||
* @see render
|
||||
* @see EffectsHandler::paintEffectFrame
|
||||
* @see Effect::paintEffectFrame
|
||||
**/
|
||||
QMatrix4x4 screenProjectionMatrix() const;
|
||||
|
||||
protected:
|
||||
void setScreenProjectionMatrix(const QMatrix4x4 &projection);
|
||||
|
||||
private:
|
||||
EffectFramePrivate* const d;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue