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 647876 - Make the pick id pool a per-Stage resource
Make the pick id pool a per-Stage resource
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterStage
git master
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-15 15:19 UTC by Emmanuele Bassi (:ebassi)
Modified: 2011-05-06 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecate actor id (4.19 KB, patch)
2011-04-15 15:19 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
Make the pick id pool per Stage (12.20 KB, patch)
2011-04-15 15:19 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Emmanuele Bassi (:ebassi) 2011-04-15 15:19:39 UTC
The pick id should be associated to the stage that does the actual picking; the id should also not be exposed, given that it's an implementation detail of the picking machinery.
Comment 1 Emmanuele Bassi (:ebassi) 2011-04-15 15:19:41 UTC
Created attachment 186029 [details] [review]
Deprecate actor id

The actor's id, which is currently used to generate the pick color,
should not be part of the public API: it's an internal detail of the
pick implementation, and having it exposed is like punching a hole
through the abstraction.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633
Comment 2 Emmanuele Bassi (:ebassi) 2011-04-15 15:19:44 UTC
Created attachment 186030 [details] [review]
Make the pick id pool per Stage

The id pool used for the actor's id should be a per-stage field. At some
point, we might have a Stage mapped to multiple framebuffers, or each
Stage mapped to a different framebuffer; also, on backend with low
color precision we don't want to exhaust the size of the available ids
with a global pool. Finally, it's yet another thing we can remove from
the global Clutter context.

Having the id pool allocated per-stage, and the pick id assigned on
Actor:mapped will make the whole pick-id more reliable and future proof.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633
Comment 3 Emmanuele Bassi (:ebassi) 2011-04-15 15:55:55 UTC
Review of attachment 186030 [details] [review]:

::: clutter/clutter-actor.c
@@ +2676,3 @@
 _clutter_actor_get_pick_id (ClutterActor *self)
 {
+  if (self->priv->pick_id < 0)

I wonder if we should just assert() here, since it would imply that we're picking an unmapped/unparented actor.
Comment 4 Emmanuele Bassi (:ebassi) 2011-05-06 16:49:13 UTC
both attachments have been pushed to master.