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>
|
2008-10-28 Thomas Wood <thomas@linux.intel.com>
|
||||||
|
|
||||||
* clutter/clutter-color.c (param_color_set_default): Set the no copy
|
* clutter/clutter-color.c (param_color_set_default): Set the no copy
|
||||||
|
@ -353,6 +353,7 @@ _clutter_do_pick (ClutterStage *stage,
|
|||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
|
||||||
guint32 id;
|
guint32 id;
|
||||||
|
GLboolean dither_was_on;
|
||||||
|
|
||||||
context = clutter_context_get_default ();
|
context = clutter_context_get_default ();
|
||||||
|
|
||||||
@ -364,6 +365,7 @@ _clutter_do_pick (ClutterStage *stage,
|
|||||||
cogl_paint_init (&white);
|
cogl_paint_init (&white);
|
||||||
|
|
||||||
/* Disable dithering (if any) when doing the painting in pick mode */
|
/* Disable dithering (if any) when doing the painting in pick mode */
|
||||||
|
dither_was_on = glIsEnabled (GL_DITHER);
|
||||||
glDisable (GL_DITHER);
|
glDisable (GL_DITHER);
|
||||||
|
|
||||||
/* Render the entire scence in pick mode - just single colored silhouette's
|
/* Render the entire scence in pick mode - just single colored silhouette's
|
||||||
@ -381,8 +383,9 @@ _clutter_do_pick (ClutterStage *stage,
|
|||||||
*/
|
*/
|
||||||
glFinish();
|
glFinish();
|
||||||
|
|
||||||
/* glEnable (GL_DITHER); we never enabled this originally, so its
|
/* Restore whether GL_DITHER was enabled */
|
||||||
probably not safe to then enable it */
|
if (dither_was_on)
|
||||||
|
glEnable (GL_DITHER);
|
||||||
|
|
||||||
/* Read the color of the screen co-ords pixel */
|
/* Read the color of the screen co-ords pixel */
|
||||||
glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
|
glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user