From 34f1408134f974d7c9f0b88aa074d1fc72b10e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Sun, 23 Nov 2014 14:33:19 +0100 Subject: [PATCH] Make the EffectFrame textures regular GLTextures There is valid reason for these textures to be Scene::Texture's. --- scene_opengl.cpp | 8 ++++---- scene_opengl.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index b14bfe311d..18b141436d 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1771,7 +1771,7 @@ void SceneOpenGL::EffectFrame::render(QRegion region, double opacity, double fra if (!m_selectionTexture) { // Lazy creation QPixmap pixmap = m_effectFrame->selectionFrame().framePixmap(); if (!pixmap.isNull()) - m_selectionTexture = m_scene->createTexture(pixmap); + m_selectionTexture = new GLTexture(pixmap); } if (m_selectionTexture) { if (shader) { @@ -1812,7 +1812,7 @@ void SceneOpenGL::EffectFrame::render(QRegion region, double opacity, double fra } if (!m_iconTexture) { // lazy creation - m_iconTexture = m_scene->createTexture(m_effectFrame->icon().pixmap(m_effectFrame->iconSize())); + m_iconTexture = new GLTexture(m_effectFrame->icon().pixmap(m_effectFrame->iconSize())); } m_iconTexture->bind(); m_iconTexture->render(region, QRect(topLeft, m_effectFrame->iconSize())); @@ -1859,7 +1859,7 @@ void SceneOpenGL::EffectFrame::updateTexture() m_texture = 0L; if (m_effectFrame->style() == EffectFrameStyled) { QPixmap pixmap = m_effectFrame->frame().framePixmap(); - m_texture = m_scene->createTexture(pixmap); + m_texture = new GLTexture(pixmap); } } @@ -1895,7 +1895,7 @@ void SceneOpenGL::EffectFrame::updateTextTexture() p.setPen(Qt::white); p.drawText(rect, m_effectFrame->alignment(), text); p.end(); - m_textTexture = m_scene->createTexture(*m_textPixmap); + m_textTexture = new GLTexture(*m_textPixmap); } void SceneOpenGL::EffectFrame::updateUnstyledTexture() diff --git a/scene_opengl.h b/scene_opengl.h index 9f69778b9c..2c7b107bdf 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -292,14 +292,14 @@ private: void updateTexture(); void updateTextTexture(); - Texture* m_texture; - Texture* m_textTexture; - Texture* m_oldTextTexture; - QPixmap* m_textPixmap; // need to keep the pixmap around to workaround some driver problems - Texture* m_iconTexture; - Texture* m_oldIconTexture; - Texture* m_selectionTexture; - GLVertexBuffer* m_unstyledVBO; + GLTexture *m_texture; + GLTexture *m_textTexture; + GLTexture *m_oldTextTexture; + QPixmap *m_textPixmap; // need to keep the pixmap around to workaround some driver problems + GLTexture *m_iconTexture; + GLTexture *m_oldIconTexture; + GLTexture *m_selectionTexture; + GLVertexBuffer *m_unstyledVBO; SceneOpenGL *m_scene; static GLTexture* m_unstyledTexture;