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 656877 - Add rounded properties to ClutterActor
Add rounded properties to ClutterActor
Status: RESOLVED WONTFIX
Product: clutter
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: clutter-maint
clutter-maint
: 656879 (view as bug list)
Depends on:
Blocks: 672560
 
 
Reported: 2011-08-19 09:41 UTC by Emilio Pozuelo Monfort
Modified: 2014-12-14 19:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
EmpathyRoundedRectangle (3.59 KB, application/octet-stream)
2011-08-19 09:43 UTC, Emilio Pozuelo Monfort
Details
EmpathyRoundedRectangle header (2.62 KB, application/octet-stream)
2011-08-19 09:45 UTC, Emilio Pozuelo Monfort
Details

Description Emilio Pozuelo Monfort 2011-08-19 09:41:11 UTC
Would be nice if it was possible to create a rectangle with rounded corners without having to create your own actor. ClutterRectangle has this comment:

  /* FIXME: Add gradient, rounded corner props etc */

It should be done using Cairo since Cogl isn't antialiased. I'm not sure if it would be possible to draw with Cairo without making ClutterRectangle a ClutterCairoTexture, which would presumably break the ABI.
Comment 1 Emilio Pozuelo Monfort 2011-08-19 09:43:31 UTC
Created attachment 194200 [details]
EmpathyRoundedRectangle

This is a rounded rectangle actor implemented by subclassing ClutterCairoTexture, just as an example. This isn't generic enough (e.g. it only implements painting the rectangle border as that's what I needed) but might serve as an example.
Comment 2 Emilio Pozuelo Monfort 2011-08-19 09:45:20 UTC
Created attachment 194201 [details]
EmpathyRoundedRectangle header
Comment 3 Emmanuele Bassi (:ebassi) 2011-08-19 15:13:29 UTC
if we ever added rounded corners support to the Rectangle class then they would by necessity use the Cogl API, which is not anti-aliased.

right now, I suggest going down the same route you took, and create a class that uses Cairo internally.
Comment 4 Emmanuele Bassi (:ebassi) 2011-08-30 11:07:07 UTC
btw, there is a bug open on bugzilla.clutter-project.org about this:

http://bugzilla.clutter-project.org/show_bug.cgi?id=2224

but it had issues that we discussed on IRC and I now noticed we never wrote down on bugzilla. bad developers, no cookie for us.
Comment 5 Emmanuele Bassi (:ebassi) 2012-01-24 12:31:57 UTC
ClutterRectangle is deprecated in master (1.10), so it won't get new features.
Comment 6 Guillaume Desmottes 2012-03-08 12:52:51 UTC
(In reply to comment #5)
> ClutterRectangle is deprecated in master (1.10), so it won't get new features.

Ok, I guess we should use ClutterActor instead right? Does it provide a way to have a rounded corners?
Comment 7 Emmanuele Bassi (:ebassi) 2012-03-08 13:48:39 UTC
no, it doesn't.

and there's still the issue of the Cogl API not being a high quality drawing API: you'll get ragged edges, unless you start doing tricks with MSAA or FSAA and shaders.
Comment 8 Guillaume Desmottes 2012-03-08 14:47:38 UTC
That's something we'd need then. Actually that would allow us to remove 2 files:
http://git.gnome.org/browse/empathy/tree/src/empathy-rounded-actor.c
http://git.gnome.org/browse/empathy/tree/src/empathy-rounded-rectangle.c

Even if it's with cogl (used in the former) that would be better than nothing.
Comment 9 Emmanuele Bassi (:ebassi) 2012-04-13 15:47:17 UTC
(In reply to comment #8)

> Even if it's with cogl (used in the former) that would be better than nothing.

no: aliased edges are actively worse than nothing. this is not 1997.
Comment 10 Emmanuele Bassi (:ebassi) 2012-08-17 11:51:25 UTC
as a side note, it's possible to use a ClutterCanvas to draw a rounded rectangle background for an actor:

http://git.gnome.org/browse/clutter/tree/examples/rounded-rectangle.c
Comment 11 Emmanuele Bassi (:ebassi) 2012-08-27 10:42:35 UTC
*** Bug 656879 has been marked as a duplicate of this bug. ***
Comment 12 Emmanuele Bassi (:ebassi) 2014-12-14 19:29:47 UTC
I don't think we want to add these properties to ClutterActor directly. you can use ClutterCanvas with a custom rounded rectangle drawing path.