cogl-path: Use true copy-on-write semantics
authorNeil Roberts <neil@linux.intel.com>
Thu, 22 Apr 2010 10:58:52 +0000 (11:58 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 11 May 2010 15:10:39 +0000 (16:10 +0100)
commitacea83d7ae088ef3d0422de7cd1d01836c5ef8f4
treec61f22cccf523674049877a13226114e9fbaa693
parenta12a2e591b0ce00b918578abfce832490a8c1d6d
cogl-path: Use true copy-on-write semantics

Previously a path copy was implemented such that only the array of
path nodes was shared with the source and the rest of the data is
copied. This was so that the copy could avoid a deep copy if the
source path is appended to because the copy keeps track of its own
length. This optimisation is probably not worthwhile because it makes
the copies less cheap. Instead the CoglPath struct now just contains a
single pointer to a new CoglPathData struct which is separately
ref-counted. When the path is modified it will be copied if the ref
count on the data is not 1.
clutter/cogl/cogl/cogl-path-private.h
clutter/cogl/cogl/cogl-path.c