Evas gl_x11: Add support for glReadPixels
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 6 Mar 2014 08:42:24 +0000 (17:42 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 7 Mar 2014 02:07:09 +0000 (11:07 +0900)
commit59f5216391ab6919dd03b629ece62ba01b82284b
treefcd10a079d020c12f95cd22b39705d45be75039c
parent688c9c3676526472523bd7545626f8da923262ce
Evas gl_x11: Add support for glReadPixels

This will be needed by the filters for proxy rendering,
for textures and maps (displacement).

Add new engine functions to unleash the (sluggish) power of glReadPixels.
The idea is to be able to bypass glReadPixels later, so 3 new APIs are
added:
- surface_lock
- surface_read_pixels
- surface_unlock
They must be called in that order.

Note (for history):
glReadPixels was always getting the wrong data during first draw,
but the right data during a redraw...
Why? Well simply because for OpenGL itself, the image had never
been drawn in teh first place! Only the Evas GL context knew
about the image drawing, as it was queued somewhere in the pipe.

One line solution: Call evas_gl_common_context_flush before
doing anything else.
src/lib/evas/include/evas_private.h
src/modules/evas/engines/gl_common/evas_gl_common.h
src/modules/evas/engines/gl_common/evas_gl_context.c
src/modules/evas/engines/gl_x11/evas_engine.c
src/modules/evas/engines/software_generic/evas_engine.c