reset custom cube shaders on screen change
the reset/setup invokes the viewport dimensions... BUG: 323311 FIXED-IN: 4.11.1 REVIEW: 112133
This commit is contained in:
parent
809d261067
commit
9001af8e5a
4 changed files with 26 additions and 0 deletions
|
@ -122,6 +122,7 @@ CubeEffect::CubeEffect()
|
|||
connect(effects, SIGNAL(tabBoxAdded(int)), this, SLOT(slotTabBoxAdded(int)));
|
||||
connect(effects, SIGNAL(tabBoxClosed()), this, SLOT(slotTabBoxClosed()));
|
||||
connect(effects, SIGNAL(tabBoxUpdated()), this, SLOT(slotTabBoxUpdated()));
|
||||
connect(effects, SIGNAL(screenGeometryChanged(const QSize&)), this, SLOT(slotResetShaders()));
|
||||
|
||||
reconfigure(ReconfigureAll);
|
||||
}
|
||||
|
@ -290,6 +291,14 @@ void CubeEffect::slotWallPaperLoaded()
|
|||
watcher->deleteLater();
|
||||
}
|
||||
|
||||
void CubeEffect::slotResetShaders()
|
||||
{
|
||||
ShaderManager::instance()->resetShader(m_capShader, ShaderManager::GenericShader);
|
||||
ShaderManager::instance()->resetShader(m_reflectionShader, ShaderManager::GenericShader);
|
||||
ShaderManager::instance()->resetShader(cylinderShader, ShaderManager::GenericShader);
|
||||
ShaderManager::instance()->resetShader(sphereShader, ShaderManager::GenericShader);
|
||||
}
|
||||
|
||||
bool CubeEffect::loadShader()
|
||||
{
|
||||
if (!(GLPlatform::instance()->supports(GLSL) &&
|
||||
|
|
|
@ -139,6 +139,7 @@ private slots:
|
|||
void slotTabBoxClosed();
|
||||
void slotCubeCapLoaded();
|
||||
void slotWallPaperLoaded();
|
||||
void slotResetShaders();
|
||||
private:
|
||||
enum RotationDirection {
|
||||
Left,
|
||||
|
|
|
@ -787,6 +787,16 @@ void ShaderManager::resetAllShaders()
|
|||
}
|
||||
}
|
||||
|
||||
void ShaderManager::resetShader(GLShader *shader, ShaderType type)
|
||||
{
|
||||
if (!(shader && shader->isValid()))
|
||||
return;
|
||||
|
||||
pushShader(shader);
|
||||
resetShader(type);
|
||||
popShader();
|
||||
}
|
||||
|
||||
|
||||
void ShaderManager::pushShader(GLShader *shader)
|
||||
{
|
||||
|
|
|
@ -352,6 +352,12 @@ public:
|
|||
**/
|
||||
void resetAllShaders();
|
||||
|
||||
/**
|
||||
* Resets ShaderType @p type uniforms of a custom shader
|
||||
* @since 4.11.1
|
||||
*/
|
||||
void resetShader(GLShader *shader, ShaderType type);
|
||||
|
||||
/**
|
||||
* Creates a GLShader with a built-in vertex shader and a custom fragment shader.
|
||||
* @param vertex The generic vertex shader
|
||||
|
|
Loading…
Reference in a new issue