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 721412 - Add blending color/string for ClutterImage
Add blending color/string for ClutterImage
Status: RESOLVED OBSOLETE
Product: clutter
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-03 17:30 UTC by Lionel Landwerlin
Modified: 2021-06-10 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
image/texture-node: add blend-string/blend-color strings (12.61 KB, patch)
2014-01-03 17:31 UTC, Lionel Landwerlin
needs-work Details | Review
JS test showing how to use blending (1.22 KB, application/javascript)
2014-01-03 17:32 UTC, Lionel Landwerlin
  Details

Description Lionel Landwerlin 2014-01-03 17:30:50 UTC
Following a request on the mailing list, just proposing a patch.
I'm pretty sure we could fine a more generic way to do this, given that people might want thing for ClutterCanvas too.
Comment 1 Lionel Landwerlin 2014-01-03 17:31:33 UTC
Created attachment 265234 [details] [review]
image/texture-node: add blend-string/blend-color strings
Comment 2 Lionel Landwerlin 2014-01-03 17:32:13 UTC
Created attachment 265235 [details]
JS test showing how to use blending
Comment 3 Emmanuele Bassi (:ebassi) 2014-01-03 23:46:53 UTC
Review of attachment 265234 [details] [review]:

::: clutter/clutter-image.c
@@ +190,3 @@
+   * ClutterImage:blend-string:
+   *
+   * A string describing the blending algorithm.

I *definitely* don't want ClutterImage to start speaking Cogl blend strings.

::: clutter/clutter-paint-nodes.c
@@ +673,3 @@
 
+static ClutterPaintNode *
+_clutter_texture_node_new (CoglTexture          *texture,

static functions do not need the '_' prefix. it should also be called 'new_internal'.

@@ +675,3 @@
+_clutter_texture_node_new (CoglTexture          *texture,
+                           const ClutterColor   *color,
+                           const gchar          *blend,

no, I don't want blend strings from Cogl in the public API. I want to minimize the amount of Cogl concepts in the Clutter API, and blend strings are a pure Cogl concept (one that is pretty much superseded by shaders anyway).

accessing Cogl should be a conscious decision made by a developer, mostly through the implementation of a new ClutterContent using ClutterPipelineNode, since *that* exposes the Cogl guts.

@@ +715,3 @@
+          g_warning ("Couldn't set blending string `%s' : %s", blend, error->message);
+          clutter_paint_node_unref ((ClutterPaintNode *) tnode);
+          return NULL;

constructors should never return NULL without a corresponding GError.

@@ +725,3 @@
+                                    blend_color->blue,
+                                    blend_color->alpha);
+        }

wrong comment style. also, debugging code leftover?

@@ +793,3 @@
+ */
+ClutterPaintNode *
+  return _clutter_texture_node_new (texture, color, NULL, NULL, min_filter, mag_filter);

I don't think you should modify the constructor.

instead, adding a clutter_texture_node_set_blend_color() should be enough.
Comment 4 Emmanuele Bassi (:ebassi) 2014-01-03 23:50:20 UTC
the "color" parameter to clutter_texture_node_new() is the tinting for the texture data; I may accept functions that modify the internal CoglPipeline for a ClutterTextureNode, but they should:

  • set through setters (and getters) to be applied after the TextureNode is created
  • not use Cogl data types or Cogl concepts like blend strings
Comment 5 André Klapper 2021-06-10 11:31:11 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of clutter, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a ticket at
  https://gitlab.gnome.org/GNOME/clutter/-/issues/

Thank you for your understanding and your help.