Well,
I agree that the CoglBitmap is not the most clearest approach. 
But in this case it has some advantage.
As I have actually 3 different Bitmaps in one buffer from a YUV frame, and so I 
can create 3 different bitmaps and update the YUV textures and convert them 
later using a GLSL shader into an RGBA texture.
A little optimization would be if we could add a kind of 
"_cogl_bitmap_update_from_buffer" function instead of always creating a new 
bitmap with _cogl_bitmap_new_from_buffer  and releasing it after again. This 
would at least allow to run textures updates without any memory allocations, 
and so cause not any global thread holds.
As far I understand the code a bitmap attached to a buffer just has a pointer 
and offset to the buffer object. So no real need to always create a new bitmap 
object.

Kind regards,
Roland

On 23.07.2011, at 11:28, Robert Bragg wrote:


On Jul 23, 2011 8:01 AM, "Roland Peffer" <[email protected]> wrote:
>
> Hi,
>
> As I wrote recently I found out that  cogl_texture_set_region is a little 
> performance bottleneck for updating a texture from system memory.
> After Evgeny Zajcev gave me some hints  I found a better way.
>
> I use cogl_pixel_buffer_new_with_size , cogl_buffer_set_data and 
> cogl_texture_new_from_buffer to create and initialize a new texture.
> Then for updating I use cogl_buffer_set_data, _cogl_bitmap_new_from_buffer 
> and _cogl_texture_set_region_from_bitmap.
>
> The problem is that  _cogl_bitmap_new_from_buffer and 
> _cogl_texture_set_region_from_bitmap are not exported from the cogl library.
> So I quickly patched the library and added cogl_texture_set_region_from  and 
> cogl_bitmap_new_from_buffer to the exported function list.
>
> So please do me a favour and add these two functions in the master branch to 
> the (experimental)  API.

I kind of wonder if we should add cogl_texture_set_region_from_buffer for this 
purpose. I'm personally not very happy with the CoglBitmap api, and have been 
trying to figure out of how to replace it with a better design which means 
ideally I'd like to avoid exporting more CoglBitmap api if possible. I'll take 
a look at this today and hopefully i'll cook up a patch to see if that would be 
ok for you. If not then yeah we can make the cogl_bitmap api exported for now. 

Kind regards,
- Robert

>
>
> Thx
> Roland
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> clutter-app-devel-list mailing list
> [email protected]
> http://lists.clutter-project.org/listinfo/clutter-app-devel-list

_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to