After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668913 - The journal for an offscreen doesn't get flushed when cogl_texture_get_data is called
The journal for an offscreen doesn't get flushed when cogl_texture_get_data i...
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: CoglJournal
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-01-28 13:51 UTC by Neil Roberts
Modified: 2012-01-31 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Port test-offscreen (8.53 KB, patch)
2012-01-28 13:52 UTC, Neil Roberts
none Details | Review
test-utils: Expose the compare_pixel function (2.61 KB, patch)
2012-01-28 13:52 UTC, Neil Roberts
none Details | Review
test-offscreen: Add tests that the offscreen's journal gets flushed (4.37 KB, patch)
2012-01-28 13:52 UTC, Neil Roberts
none Details | Review
texture: Flush the dependent journals on get_data (1.13 KB, patch)
2012-01-28 13:52 UTC, Neil Roberts
none Details | Review

Description Neil Roberts 2012-01-28 13:51:19 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.
Comment 1 Neil Roberts 2012-01-28 13:52:28 UTC
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.
Comment 2 Neil Roberts 2012-01-28 13:52:31 UTC
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.
Comment 3 Neil Roberts 2012-01-28 13:52:34 UTC
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.
Comment 4 Neil Roberts 2012-01-28 13:52:36 UTC
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.
Comment 5 Robert Bragg 2012-01-30 19:37:07 UTC
cool, these patches all look good to me, thanks
Comment 6 Neil Roberts 2012-01-31 12:17:22 UTC
Thanks. Pushed to master as ba89a005767..43bc0a4b0d and the main patch to the cogl-1.8 branch as 55b98f51d0.