summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-12-24 19:14:16 -0600
committerErkin Bahceci <erkinbah@gmail.com>2009-12-24 19:14:16 -0600
commitbb0e8d03782ed96163063875217342b5e4827e4b (patch)
treebf4f7365114dce75cc807b265cdadf22f43ae562
parentf5c886176c6d33a212aa91ff2de70a0a414534a0 (diff)
downloadcompiz-with-glib-mainloop-bb0e8d03782ed96163063875217342b5e4827e4b.tar.gz
compiz-with-glib-mainloop-bb0e8d03782ed96163063875217342b5e4827e4b.tar.bz2
Don't use mipmap for icons.
Forward port of 0138d355b849d675a82d57a2c293a96fff2bcaa2.
-rw-r--r--plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h1
-rw-r--r--plugins/compiztoolbox/src/compiztoolbox.cpp8
-rw-r--r--plugins/switcher/src/switcher.cpp14
-rw-r--r--plugins/switcher/src/switcher.h1
4 files changed, 16 insertions, 8 deletions
diff --git a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
index b8e29c4..8bd9d66 100644
--- a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
+++ b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
@@ -83,6 +83,7 @@ class BaseSwitchScreen
virtual void handleSelectionChange (bool toNext, int nextIdx) {}
virtual void getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&matchOption);
+ virtual bool getMipmap () { return false; }
CompositeScreen *cScreen;
GLScreen *gScreen;
diff --git a/plugins/compiztoolbox/src/compiztoolbox.cpp b/plugins/compiztoolbox/src/compiztoolbox.cpp
index f65800e..2a4dabf 100644
--- a/plugins/compiztoolbox/src/compiztoolbox.cpp
+++ b/plugins/compiztoolbox/src/compiztoolbox.cpp
@@ -391,6 +391,7 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
if (iconMode != ShowIconOnly)
{
+ GLenum filter;
GLMatrix wTransform (transform);
int ww, wh;
int addWindowGeometryIndex =
@@ -441,6 +442,11 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
glPushMatrix ();
glLoadMatrixf (wTransform.getMatrix ());
+ filter = gScreen->textureFilter ();
+
+ if (baseScreen->getMipmap ())
+ gScreen->setTextureFilter (GL_LINEAR_MIPMAP_LINEAR);
+
/* XXX: replacing the addWindowGeometry function like this is
very ugly but necessary until the vertex stage has been made
fully pluggable. */
@@ -448,6 +454,8 @@ BaseSwitchWindow::paintThumb (const GLWindowPaintAttrib &attrib,
gWindow->glDraw (wTransform, fragment, infiniteRegion, mask);
gWindow->glAddGeometrySetCurrentIndex (addWindowGeometryIndex);
+ gScreen->setTextureFilter (filter);
+
glPopMatrix ();
if (iconMode != HideIcon)
diff --git a/plugins/switcher/src/switcher.cpp b/plugins/switcher/src/switcher.cpp
index 9a2b41a..83e32d7 100644
--- a/plugins/switcher/src/switcher.cpp
+++ b/plugins/switcher/src/switcher.cpp
@@ -144,6 +144,12 @@ SwitchScreen::getMinimizedAndMatch (bool &minimizedOption,
matchOption = &optionGetWindowMatch ();
}
+bool
+SwitchScreen::getMipmap ()
+{
+ return optionGetMipmap ();
+}
+
void
SwitchScreen::switchToWindow (bool toNext)
{
@@ -954,7 +960,6 @@ SwitchWindow::glPaint (const GLWindowPaintAttrib &attrib,
if (window->id () == sScreen->popupWindow)
{
- GLenum filter;
int x, y, x1, x2, cx, i;
unsigned short color[4];
@@ -975,11 +980,6 @@ SwitchWindow::glPaint (const GLWindowPaintAttrib &attrib,
x = x1 + sScreen->pos;
y = g.y () + SPACE;
- filter = gScreen->textureFilter ();
-
- if (sScreen->optionGetMipmap ())
- gScreen->setTextureFilter (GL_LINEAR_MIPMAP_LINEAR);
-
glPushAttrib (GL_SCISSOR_BIT);
glEnable (GL_SCISSOR_TEST);
@@ -1007,8 +1007,6 @@ SwitchWindow::glPaint (const GLWindowPaintAttrib &attrib,
glPopAttrib ();
- gScreen->setTextureFilter (filter);
-
cx = g.x () + (g.width () >> 1);
glDisableClientState (GL_TEXTURE_COORD_ARRAY);
diff --git a/plugins/switcher/src/switcher.h b/plugins/switcher/src/switcher.h
index 562d07a..e0b3da7 100644
--- a/plugins/switcher/src/switcher.h
+++ b/plugins/switcher/src/switcher.h
@@ -65,6 +65,7 @@ class SwitchScreen :
void getMinimizedAndMatch (bool &minimizedOption,
CompMatch *&match);
+ bool getMipmap ();
void switchToWindow (bool toNext);
void handleSelectionChange (bool toNext, int nextIdx);
int countWindows ();