Bug 735810 - performance shrinkage of Paths tool

Use a GQueue instead of a GList in GimpCanvasGroup, so adding items
takes constant time instead of O(n). Also, removing items was
traversing the list twice. This should generally speed up tools with
lots of canvas items.

Also, add a private pointer to the instance struct instead of using a
GET_PRIVATE() macro.
This commit is contained in:
Michael Natterer
2016-01-24 00:54:48 +01:00
parent c8ee9f951d
commit 4920033c42
2 changed files with 49 additions and 59 deletions

View File

@ -33,11 +33,15 @@
#define GIMP_CANVAS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CANVAS_GROUP, GimpCanvasGroupClass))
typedef struct _GimpCanvasGroupClass GimpCanvasGroupClass;
typedef struct _GimpCanvasGroupPrivate GimpCanvasGroupPrivate;
typedef struct _GimpCanvasGroupClass GimpCanvasGroupClass;
struct _GimpCanvasGroup
{
GimpCanvasItem parent_instance;
GimpCanvasItem parent_instance;
GimpCanvasGroupPrivate *priv;
};
struct _GimpCanvasGroupClass