Remove warnings when building with GLES
This commit is contained in:
parent
4e36027924
commit
7adc29efd7
5 changed files with 47 additions and 14 deletions
|
@ -54,7 +54,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "magnifier/magnifier_config.h"
|
||||
#include "sharpen/sharpen_config.h"
|
||||
#include "snow/snow_config.h"
|
||||
#endif KWIN_HAVE_OPENGLES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <kwineffects.h>
|
||||
|
@ -96,7 +96,7 @@ KWIN_EFFECT_CONFIG_MULTIPLE( builtins,
|
|||
KWIN_EFFECT_CONFIG_SINGLE( magnifier, MagnifierEffectConfig )
|
||||
KWIN_EFFECT_CONFIG_SINGLE( sharpen, SharpenEffectConfig )
|
||||
KWIN_EFFECT_CONFIG_SINGLE( snow, SnowEffectConfig )
|
||||
#endif KWIN_HAVE_OPENGLES
|
||||
#endif
|
||||
#endif
|
||||
)
|
||||
|
||||
|
|
|
@ -88,10 +88,10 @@ CubeEffect::CubeEffect()
|
|||
, zOrderingFactor( 0.0f )
|
||||
, mAddedHeightCoeff1( 0.0f )
|
||||
, mAddedHeightCoeff2( 0.0f )
|
||||
, m_cubeCapBuffer( NULL )
|
||||
, capListCreated( false )
|
||||
, recompileList( true )
|
||||
, glList( 0 )
|
||||
, m_cubeCapBuffer( NULL )
|
||||
, m_proxy( this )
|
||||
{
|
||||
desktopNameFont.setBold( true );
|
||||
|
@ -467,17 +467,17 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
|||
#endif
|
||||
|
||||
// call the inside cube effects
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
glPushMatrix();
|
||||
glCallList( glList );
|
||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||
inside->paint();
|
||||
glPopMatrix();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
glCullFace( GL_FRONT );
|
||||
if( mode == Cylinder )
|
||||
|
@ -610,17 +610,17 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
|||
|
||||
|
||||
// call the inside cube effects
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
foreach( CubeInsideEffect* inside, m_cubeInsideEffects )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
glPushMatrix();
|
||||
glCallList( glList );
|
||||
glTranslatef( rect.width()/2, rect.height()/2, -point-zTranslate );
|
||||
glRotatef( (1-frontDesktop)*360.0f / effects->numberOfDesktops(), 0.0, 1.0, 0.0 );
|
||||
inside->paint();
|
||||
glPopMatrix();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
glCullFace( GL_BACK );
|
||||
if( mode == Cylinder )
|
||||
|
|
|
@ -182,7 +182,15 @@ void renderGLGeometry( const QRegion& region, int count,
|
|||
const float* vertices, const float* texture, const float* color,
|
||||
int dim, int stride )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(region)
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(vertices)
|
||||
Q_UNUSED(texture)
|
||||
Q_UNUSED(color)
|
||||
Q_UNUSED(dim)
|
||||
Q_UNUSED(stride)
|
||||
#else
|
||||
// Using arrays only makes sense if we have larger number of vertices.
|
||||
// Otherwise overhead of enabling/disabling them is too big.
|
||||
bool use_arrays = (count > 5);
|
||||
|
@ -239,7 +247,14 @@ void renderGLGeometry( const QRegion& region, int count,
|
|||
void renderGLGeometryImmediate( int count, const float* vertices, const float* texture, const float* color,
|
||||
int dim, int stride )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(count)
|
||||
Q_UNUSED(vertices)
|
||||
Q_UNUSED(texture)
|
||||
Q_UNUSED(color)
|
||||
Q_UNUSED(dim)
|
||||
Q_UNUSED(stride)
|
||||
#else
|
||||
// Find out correct glVertex*fv function according to dim parameter.
|
||||
void ( *glVertexFunc )( const float* ) = glVertex2fv;
|
||||
if( dim == 3 )
|
||||
|
@ -712,7 +727,11 @@ void GLTexture::enableFilter()
|
|||
}
|
||||
|
||||
static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum texture_format)
|
||||
{ // Copied from Qt
|
||||
{
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(texture_format)
|
||||
#endif
|
||||
// Copied from Qt
|
||||
Q_ASSERT(dst.size() == img.size());
|
||||
Q_ASSERT(dst.depth() == 32);
|
||||
Q_ASSERT(img.depth() == 32);
|
||||
|
@ -1551,7 +1570,10 @@ GLVertexBuffer *GLVertexBufferPrivate::streamingBuffer = NULL;
|
|||
|
||||
void GLVertexBufferPrivate::legacyPainting( QRegion region, GLenum primitiveMode )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(region)
|
||||
Q_UNUSED(primitiveMode)
|
||||
#else
|
||||
// Enable arrays
|
||||
glEnableClientState( GL_VERTEX_ARRAY );
|
||||
glVertexPointer( dimension, GL_FLOAT, 0, legacyVertices.constData() );
|
||||
|
|
|
@ -796,7 +796,12 @@ void SceneOpenGL::Window::prepareShaderRenderStates( TextureType type, double op
|
|||
|
||||
void SceneOpenGL::Window::prepareRenderStates( TextureType type, double opacity, double brightness, double saturation )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(type)
|
||||
Q_UNUSED(opacity)
|
||||
Q_UNUSED(brightness)
|
||||
Q_UNUSED(saturation)
|
||||
#else
|
||||
Texture* tex;
|
||||
bool alpha = false;
|
||||
bool opaque = true;
|
||||
|
@ -988,7 +993,12 @@ void SceneOpenGL::Window::restoreShaderRenderStates( TextureType type, double op
|
|||
|
||||
void SceneOpenGL::Window::restoreRenderStates( TextureType type, double opacity, double brightness, double saturation )
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifdef KWIN_HAVE_OPENGLES
|
||||
Q_UNUSED(type)
|
||||
Q_UNUSED(opacity)
|
||||
Q_UNUSED(brightness)
|
||||
Q_UNUSED(saturation)
|
||||
#else
|
||||
Texture* tex;
|
||||
switch( type )
|
||||
{
|
||||
|
@ -1041,8 +1051,8 @@ SceneOpenGL::EffectFrame::EffectFrame( EffectFrameImpl* frame )
|
|||
: Scene::EffectFrame( frame )
|
||||
, m_texture( NULL )
|
||||
, m_textTexture( NULL )
|
||||
, m_textPixmap( NULL )
|
||||
, m_oldTextTexture( NULL )
|
||||
, m_textPixmap( NULL )
|
||||
, m_iconTexture( NULL )
|
||||
, m_oldIconTexture( NULL )
|
||||
, m_selectionTexture( NULL )
|
||||
|
|
|
@ -199,6 +199,7 @@ void SceneOpenGL::waitSync()
|
|||
|
||||
void SceneOpenGL::flushBuffer( int mask, QRegion damage )
|
||||
{
|
||||
Q_UNUSED(damage)
|
||||
glFlush();
|
||||
if( mask & PAINT_SCREEN_REGION )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue