GNOME Bugzilla – Bug 702754
clutter_stage_read_pixels makes language bindings crash
Last modified: 2014-01-27 15:58:30 UTC
I am running into the following assertion when using clutter_stage_read_pixels from JS bindings: Gjs:ERROR:gi/arg.c:2140:gjs_array_from_fixed_size_array: assertion failed: (length != -1) The crash happens when constructing the return value. The C function's return value is a plain C array, which doesn't include enough information to tell the language bindings what size the corresponding JS array has to be. I can think of two ways to solve this: 1) Create another function that returns a GByteArray 2) Create another function that is solely for language bindings, and has an extra (out) param to return the array size. THis would be renamed back to clutter_stage_read_pixels in the gir file.
Created attachment 247338 [details] [review] stage: Add read_pixels_with_length for language bindings The current clutter_stage_read_pixels returns a plain C array, which doesn't include enough information for higher level languages, where we'd need to know the exact size to construct the array. This commit implements clutter_stage_read_pixels_with_length that has an extra (out) param with the array length, mostly only for language bindings.
the actual solution would be to commit the patch for bug 653590 instead, which makes read_pixels() an async operation that gets performed at the right point in the pipeline. it would be great if you could test the patch there and verify that it works.
Sure, will do -- can you update the patch there, please? It doesn't seem to apply on top of current clutter tree.
(In reply to comment #3) > Sure, will do -- can you update the patch there, please? It doesn't seem to > apply on top of current clutter tree. Emmanuele? Would be nice to get this fix in sooner than later so that get basic printing implemented in Maps (bug#702583).
too late for 3.10: 1.16.0 was released and we cannot add new API for the 1.16 series. for 3.12, I really think we should get bug 653590 done. I'm going to close this as a duplicate. *** This bug has been marked as a duplicate of bug 653590 ***