Config option for whether zooming should be smooth or fast.
svn path=/branches/work/kwin_composite/; revision=610138
This commit is contained in:
parent
a643ff2b00
commit
4607cab829
4 changed files with 18 additions and 0 deletions
|
@ -195,6 +195,8 @@ unsigned long Options::updateSettings()
|
|||
onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool();
|
||||
|
||||
refreshRate = config->readEntry( "RefreshRate", 0 );
|
||||
smoothScale = qBound( -1, config->readEntry( "SmoothScale", -1 ), 1 );
|
||||
|
||||
QString glmode = config->readEntry("GLMode", "TFP" ).upper();
|
||||
if( glmode == "TFP" )
|
||||
glMode = GLTFP;
|
||||
|
|
|
@ -301,6 +301,8 @@ class Options : public KDecorationOptions
|
|||
bool onlyDecoTranslucent;
|
||||
|
||||
uint refreshRate;
|
||||
int smoothScale; // 0 = no, 1 = yes, -1 = auto
|
||||
|
||||
enum GLMode { GLTFP, GLSHM, GLFallback };
|
||||
GLMode glMode;
|
||||
bool glAlwaysRebind;
|
||||
|
|
|
@ -806,6 +806,16 @@ void SceneOpenGL::Window::enableTexture()
|
|||
assert( bound_pixmap != None );
|
||||
glXBindTexImageEXT( display(), bound_glxpixmap, GLX_FRONT_LEFT_EXT, NULL );
|
||||
}
|
||||
if( options->smoothScale != 0 ) // default to yes
|
||||
{
|
||||
glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
}
|
||||
}
|
||||
|
||||
void SceneOpenGL::Window::disableTexture()
|
||||
|
|
|
@ -394,6 +394,8 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa
|
|||
XRenderSetPictureTransform( display(), pic, &xform );
|
||||
width = (int)(width * xscale);
|
||||
height = (int)(height * yscale);
|
||||
if( options->smoothScale == 1 ) // only when forced, it's slow
|
||||
XRenderSetPictureFilter( display(), pic, "good", NULL, 0 );
|
||||
}
|
||||
if( opaque )
|
||||
{
|
||||
|
@ -414,6 +416,8 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa
|
|||
{ XDoubleToFixed( 0 ), XDoubleToFixed( 0 ), XDoubleToFixed( 1 ) }
|
||||
}};
|
||||
XRenderSetPictureTransform( display(), pic, &xform );
|
||||
if( options->smoothScale == 1 )
|
||||
XRenderSetPictureFilter( display(), pic, "fast", NULL, 0 );
|
||||
}
|
||||
XFixesSetPictureClipRegion( display(), buffer, 0, 0, None );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue