GNOME Bugzilla – Bug 668913
The journal for an offscreen doesn't get flushed when cogl_texture_get_data is called
Last modified: 2012-01-31 12:17:22 UTC
Drawing to an offscreen attached to a texture and then immediately calling cogl_texture_get_data on that texture doesn't flush the journal.
Created attachment 206323 [details] [review] tests: Port test-offscreen This ports the test-offscreen test from being a Clutter test to a straight Cogl test.
Created attachment 206324 [details] [review] test-utils: Expose the compare_pixel function The compare pixel function was a static function used internally by the test_utils_check_* functions. It takes a pointer to a pixel in a buffer read back from Cogl and compares it with an expected value. This function could also be useful in tests wanting to check the data returned from a call to cogl_texture_get_data so we should share it with the rest of the tests.
Created attachment 206325 [details] [review] test-offscreen: Add tests that the offscreen's journal gets flushed This adds an extra test to test-offscreen then ensures the offscreen framebuffer for a texture automatically flushes its journal in the following three situations: 1. cogl_read_pixels is called immediately when the offscreen buffer is current. 2. cogl_texture_get_data is called on the offscreen's texture immediately after rendering to it. 3. The texture is rendered to the screen and immediately read back with cogl_read_pixels. Currently the 2nd situation fails.
Created attachment 206326 [details] [review] texture: Flush the dependent journals on get_data When calling cogl_texture_get_data we need to ensure that any framebuffers rendering to the texture have flushed their journals.
cool, these patches all look good to me, thanks
Thanks. Pushed to master as ba89a005767..43bc0a4b0d and the main patch to the cogl-1.8 branch as 55b98f51d0.