add missing ifdefs to make the code compile if OpenGL is not present
svn path=/trunk/KDE/kdebase/workspace/; revision=1137402
This commit is contained in:
parent
265158bb07
commit
c705dd474e
2 changed files with 10 additions and 0 deletions
|
@ -36,18 +36,22 @@ namespace KWin
|
|||
|
||||
LanczosFilter::LanczosFilter( QObject* parent )
|
||||
: QObject( parent )
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
, m_offscreenTex( 0 )
|
||||
, m_offscreenTarget( 0 )
|
||||
, m_shader( 0 )
|
||||
#endif
|
||||
, m_inited( false)
|
||||
{
|
||||
}
|
||||
|
||||
LanczosFilter::~LanczosFilter()
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
delete m_offscreenTarget;
|
||||
delete m_offscreenTex;
|
||||
delete m_shader;
|
||||
#endif
|
||||
}
|
||||
|
||||
void LanczosFilter::init()
|
||||
|
@ -82,6 +86,7 @@ void LanczosFilter::init()
|
|||
|
||||
void LanczosFilter::updateOffscreenSurfaces()
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
int w = displayWidth();
|
||||
int h = displayHeight();
|
||||
if ( !GLTexture::NPOTTextureSupported() )
|
||||
|
@ -101,6 +106,7 @@ void LanczosFilter::updateOffscreenSurfaces()
|
|||
m_offscreenTex->setWrapMode( GL_CLAMP_TO_EDGE );
|
||||
m_offscreenTarget = new GLRenderTarget( m_offscreenTex );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static float sinc( float x )
|
||||
|
@ -268,6 +274,7 @@ void LanczosFilter::performPaint( EffectWindowImpl* w, int mask, QRegion region,
|
|||
|
||||
void LanczosFilter::timerEvent( QTimerEvent *event )
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
if (event->timerId() == m_timer.timerId())
|
||||
{
|
||||
m_timer.stop();
|
||||
|
@ -277,6 +284,7 @@ void LanczosFilter::timerEvent( QTimerEvent *event )
|
|||
m_offscreenTarget = 0;
|
||||
m_offscreenTex = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -53,9 +53,11 @@ class LanczosFilter
|
|||
void updateOffscreenSurfaces();
|
||||
QVector<QVector4D> createKernel(float delta);
|
||||
QVector<QVector2D> createOffsets(int count, float width, Qt::Orientation direction);
|
||||
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
||||
GLTexture *m_offscreenTex;
|
||||
GLRenderTarget *m_offscreenTarget;
|
||||
GLShader *m_shader;
|
||||
#endif
|
||||
QBasicTimer m_timer;
|
||||
bool m_inited;
|
||||
int m_uTexUnit;
|
||||
|
|
Loading…
Reference in a new issue