mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 14:53:03 +00:00
Bug 1206 - Picking disabled dithering
* clutter/clutter-main.c (_clutter_do_pick): After picking is finished, restore the state of glEnable (GL_DITHER). Otherwise it will cause the scene to look different after the first pick on low depth displays. (Thanks to Michael Boccara for the patch)
This commit is contained in:
parent
1f2813ceda
commit
f2c19971e5
@ -1,3 +1,12 @@
|
||||
2008-10-29 Neil Roberts <neil@linux.intel.com>
|
||||
|
||||
Bug 1206 - Picking disabled dithering
|
||||
|
||||
* clutter/clutter-main.c (_clutter_do_pick): After picking is
|
||||
finished, restore the state of glEnable (GL_DITHER). Otherwise it
|
||||
will cause the scene to look different after the first pick on low
|
||||
depth displays. (Thanks to Michael Boccara for the patch)
|
||||
|
||||
2008-10-28 Thomas Wood <thomas@linux.intel.com>
|
||||
|
||||
* clutter/clutter-color.c (param_color_set_default): Set the no copy
|
||||
|
@ -353,6 +353,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
GLint viewport[4];
|
||||
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
||||
guint32 id;
|
||||
GLboolean dither_was_on;
|
||||
|
||||
context = clutter_context_get_default ();
|
||||
|
||||
@ -364,6 +365,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
cogl_paint_init (&white);
|
||||
|
||||
/* Disable dithering (if any) when doing the painting in pick mode */
|
||||
dither_was_on = glIsEnabled (GL_DITHER);
|
||||
glDisable (GL_DITHER);
|
||||
|
||||
/* Render the entire scence in pick mode - just single colored silhouette's
|
||||
@ -381,8 +383,9 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
*/
|
||||
glFinish();
|
||||
|
||||
/* glEnable (GL_DITHER); we never enabled this originally, so its
|
||||
probably not safe to then enable it */
|
||||
/* Restore whether GL_DITHER was enabled */
|
||||
if (dither_was_on)
|
||||
glEnable (GL_DITHER);
|
||||
|
||||
/* Read the color of the screen co-ords pixel */
|
||||
glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user