effects: Drop WindowPaintData.shader property
It allows us to encapsulate SurfaceItem rendering. It's needed to add support for YUV->RGB conversion fallback path. Effects that use this property must be ported to OffscreenEffect, see also OffscreenEffect::setShader(). This is a BREAKING CHANGE!
This commit is contained in:
parent
4363b25b2d
commit
3aa635430b
5 changed files with 5 additions and 15 deletions
|
@ -19,6 +19,8 @@
|
|||
class KSelectionOwner;
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class GLShader;
|
||||
class GLTexture;
|
||||
|
||||
class StartupFeedbackEffect
|
||||
|
|
|
@ -240,7 +240,6 @@ WindowPaintData::WindowPaintData()
|
|||
|
||||
WindowPaintData::WindowPaintData(const QMatrix4x4 &screenProjectionMatrix)
|
||||
: PaintData()
|
||||
, shader(nullptr)
|
||||
, d(std::make_unique<WindowPaintDataPrivate>())
|
||||
{
|
||||
d->screenProjectionMatrix = screenProjectionMatrix;
|
||||
|
@ -253,7 +252,6 @@ WindowPaintData::WindowPaintData(const QMatrix4x4 &screenProjectionMatrix)
|
|||
|
||||
WindowPaintData::WindowPaintData(const WindowPaintData &other)
|
||||
: PaintData()
|
||||
, shader(other.shader)
|
||||
, d(std::make_unique<WindowPaintDataPrivate>())
|
||||
{
|
||||
setXScale(other.xScale());
|
||||
|
|
|
@ -81,7 +81,6 @@ class OffscreenQuickView;
|
|||
class EffectScreen;
|
||||
class Effect;
|
||||
class WindowQuad;
|
||||
class GLShader;
|
||||
class WindowQuadList;
|
||||
class WindowPrePaintData;
|
||||
class WindowPaintData;
|
||||
|
@ -3387,11 +3386,6 @@ public:
|
|||
std::optional<qreal> renderTargetScale() const;
|
||||
void setRenderTargetScale(qreal scale);
|
||||
|
||||
/**
|
||||
* Shader to be used for rendering, if any.
|
||||
*/
|
||||
GLShader *shader;
|
||||
|
||||
private:
|
||||
const std::unique_ptr<WindowPaintDataPrivate> d;
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
class GLShader;
|
||||
class OffscreenEffectPrivate;
|
||||
class CrossFadeEffectPrivate;
|
||||
class ShaderEffectPrivate;
|
||||
|
|
|
@ -507,10 +507,7 @@ void SceneOpenGL::render(Item *item, int mask, const QRegion ®ion, const Wind
|
|||
vbo->unmap();
|
||||
vbo->bindArrays();
|
||||
|
||||
GLShader *shader = data.shader;
|
||||
if (!shader) {
|
||||
shader = ShaderManager::instance()->pushShader(shaderTraits);
|
||||
}
|
||||
GLShader *shader = ShaderManager::instance()->pushShader(shaderTraits);
|
||||
shader->setUniform(GLShader::Saturation, data.saturation());
|
||||
|
||||
if (renderContext.hardwareClipping) {
|
||||
|
@ -556,9 +553,7 @@ void SceneOpenGL::render(Item *item, int mask, const QRegion ®ion, const Wind
|
|||
|
||||
setBlendEnabled(false);
|
||||
|
||||
if (!data.shader) {
|
||||
ShaderManager::instance()->popShader();
|
||||
}
|
||||
ShaderManager::instance()->popShader();
|
||||
|
||||
if (renderContext.hardwareClipping) {
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
|
Loading…
Reference in a new issue