comparison nodejs/paints.cc @ 765:a49358b040b5

Doc on how to manage life-cycle of paints for JS
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 29 Aug 2010 00:42:16 +0800
parents d0ee92a96c47
children be0e02948c1d
comparison
equal deleted inserted replaced
764:194e24d8ecab 765:a49358b040b5
16 * \ingroup xnjsmb 16 * \ingroup xnjsmb
17 * 17 *
18 * @{ 18 * @{
19 */ 19 */
20 20
21 /*! \page paint_gc How to manage life-cycle of paints?
22 *
23 * A paint is used to fill and stroke shapes. It should keep live
24 * before all shapes being stroked/or filled by it are dead or
25 * filled/stroked by other paints. So, every shape that uses a paint
26 * should keep a reference to the paint. The reference are removed
27 * when a shape is filled/or stroked by other paints.
28 *
29 * A paint should keep a weak reference to itself. It is used to free
30 * resource before it being collected.
31 */
21 static void 32 static void
22 xnjsmb_paint_fill(paint_t *paint, Handle<Object> self, shape_t *sh) { 33 xnjsmb_paint_fill(paint_t *paint, Handle<Object> self, shape_t *sh) {
23 Handle<Value> rt_v; 34 Handle<Value> rt_v;
24 Handle<Object> rt_o; 35 Handle<Object> rt_o;
25 redraw_man_t *rdman; 36 redraw_man_t *rdman;