mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
* clutter/clutter-stage.c:
Add a note to the clutter_stage_read_pixels doc that the alpha channel isn't guaranteed to contain sensible data * tests/test-stage-read-pixels.c: (update_snapshot): Overwrite the alpha data when using clutter_stage_read_pixels; fixes this test on non-nvidia drivers
This commit is contained in:
parent
be160d971a
commit
9ed5d2577d
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2008-07-01 Chris Lord <chris@openedhand.com>
|
||||
|
||||
* clutter/clutter-stage.c:
|
||||
Add a note to the clutter_stage_read_pixels doc that the alpha channel
|
||||
isn't guaranteed to contain sensible data
|
||||
|
||||
* tests/test-stage-read-pixels.c: (update_snapshot):
|
||||
Overwrite the alpha data when using clutter_stage_read_pixels; fixes
|
||||
this test on non-nvidia drivers
|
||||
|
||||
2008-07-01 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* clutter/glx/clutter-stage-glx.c:
|
||||
|
@ -1122,6 +1122,9 @@ clutter_stage_hide_cursor (ClutterStage *stage)
|
||||
* Makes a screenshot of the stage in RGBA 8bit data, returns a
|
||||
* linear buffer with @width * 4 as rowstride.
|
||||
*
|
||||
* The alpha data contained in the returned buffer is driver-dependent,
|
||||
* and not guaranteed to hold any sensible value.
|
||||
*
|
||||
* Return value: a pointer to newly allocated memory with the buffer
|
||||
* or %NULL if the read failed. Use g_free() on the returned data
|
||||
* to release the resources it has allocated.
|
||||
|
@ -89,11 +89,20 @@ static gboolean update_snapshot (gpointer data)
|
||||
SuperOH *oh = data;
|
||||
gint width = CLUTTER_STAGE_WIDTH();
|
||||
gint height = CLUTTER_STAGE_HEIGHT();
|
||||
gint x, y, rowstride;
|
||||
guchar *pixels;
|
||||
|
||||
pixels = clutter_stage_read_pixels (CLUTTER_STAGE (oh->stage), 0, 0, width, height);
|
||||
g_assert (pixels);
|
||||
|
||||
/* Alpha data is not guaranteed to be sensible and we don't need it,
|
||||
* overwrite it with full-alpha.
|
||||
*/
|
||||
rowstride = width * 4;
|
||||
for (y = 0; y < height; y++)
|
||||
for (x = 3; x < rowstride; x += 4)
|
||||
pixels[(y * rowstride) + x] = 0xff;
|
||||
|
||||
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (oh->tv), pixels, TRUE, width, height, width *4,
|
||||
4, 0, NULL);
|
||||
g_free (pixels);
|
||||
|
Loading…
Reference in New Issue
Block a user