mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
Use GL_NEAREST filter in the draw-and-read get_data texture fallback
The fallback for when glGetTexImage is not available renders the texture to the framebuffer to read the data using glReadPixels. This patch just sets the COGL_MATERIAL_FILTER_NEAREST filter mode on the material before rendering to avoid linear filtering which would alter the texture data.
This commit is contained in:
parent
f8d1955ab7
commit
d3ea1ec6f8
@ -1060,6 +1060,10 @@ _cogl_texture_draw_and_read (CoglHandle handle,
|
|||||||
"RGBA = REPLACE (TEXTURE)",
|
"RGBA = REPLACE (TEXTURE)",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
cogl_material_set_layer_filters (ctx->texture_download_material, 0,
|
||||||
|
COGL_MATERIAL_FILTER_NEAREST,
|
||||||
|
COGL_MATERIAL_FILTER_NEAREST);
|
||||||
|
|
||||||
do_texture_draw_and_read (handle, target_bmp, viewport);
|
do_texture_draw_and_read (handle, target_bmp, viewport);
|
||||||
|
|
||||||
/* Check whether texture has alpha and framebuffer not */
|
/* Check whether texture has alpha and framebuffer not */
|
||||||
|
Loading…
Reference in New Issue
Block a user