Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Clutter.Image usages with plain CoglTexture #480

Open
bilelmoussaoui opened this issue Dec 4, 2024 · 3 comments
Open

Replace Clutter.Image usages with plain CoglTexture #480

bilelmoussaoui opened this issue Dec 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bilelmoussaoui
Copy link

Currently, the code uses Clutter.Image just for it capacity in creating a CoglTexture for you. Instead, please replace it with either using St.ImageContent (not really a solution, just working around ClutterImage being merged with StImageContent in the future).

Or ideally, replace the places where you create a ClutterImage to get the texture by creating the Cogl.Texture manually yourself.

The code does basically

  ClutterContext *context = _clutter_context_get_default (); // Replace with getting the context from the actor
  ClutterBackend *backend = clutter_context_get_backend (context);
  CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
  CoglTexture *texture_2d;

  texture_2d = cogl_texture_2d_new_from_data (cogl_context,
                                              width,
                                              height,
                                              pixel_format,
                                              row_stride,
                                              data,
                                              error);
@bilelmoussaoui bilelmoussaoui added the bug Something isn't working label Dec 4, 2024
@Schneegans
Copy link
Owner

Thanks for the hint! So Clutter.Image will be gone with GNOME 48? I'll have a look at it.

@bilelmoussaoui
Copy link
Author

Yes https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4133, you can also just use StImageContent if you want to be "lazy"

@Schneegans
Copy link
Owner

Ok! Then thanks a lot for the warning 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants