clutter/paint-nodes: Expose ClutterRootNode

The ClutterRootNode paint node is theoretically the
top-most node of a paint nodes tree, except that we
are not in the point of having full rendering trees
in Clutter (all rendering performed by paint nodes
is still local and immediate).

When controlling the rendering tree, MetaShapedTexture
may need to paint into an offscreen framebuffer under
some circumstations.

Expose ClutterRootNode so that MetaShapedTexture can
use it to render to offscreen framebuffers.

!405
parent 02b184bf
...@@ -3740,7 +3740,7 @@ clutter_actor_paint_node (ClutterActor *actor, ...@@ -3740,7 +3740,7 @@ clutter_actor_paint_node (ClutterActor *actor,
if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor))) if (!clutter_stage_get_no_clear_hint (CLUTTER_STAGE (actor)))
clear_flags |= COGL_BUFFER_BIT_COLOR; clear_flags |= COGL_BUFFER_BIT_COLOR;
node = _clutter_root_node_new (fb, &bg_color, clear_flags); node = clutter_root_node_new (fb, &bg_color, clear_flags);
clutter_paint_node_set_name (node, "stageClear"); clutter_paint_node_set_name (node, "stageClear");
clutter_paint_node_add_rectangle (node, &box); clutter_paint_node_add_rectangle (node, &box);
clutter_paint_node_add_child (root, node); clutter_paint_node_add_child (root, node);
......
...@@ -97,7 +97,6 @@ struct _ClutterPaintOperation ...@@ -97,7 +97,6 @@ struct _ClutterPaintOperation
} op; } op;
}; };
GType _clutter_root_node_get_type (void) G_GNUC_CONST;
GType _clutter_transform_node_get_type (void) G_GNUC_CONST; GType _clutter_transform_node_get_type (void) G_GNUC_CONST;
GType _clutter_dummy_node_get_type (void) G_GNUC_CONST; GType _clutter_dummy_node_get_type (void) G_GNUC_CONST;
...@@ -110,9 +109,6 @@ void _clutter_paint_operation_paint_primitive (const C ...@@ -110,9 +109,6 @@ void _clutter_paint_operation_paint_primitive (const C
void _clutter_paint_node_init_types (void); void _clutter_paint_node_init_types (void);
gpointer _clutter_paint_node_create (GType gtype); gpointer _clutter_paint_node_create (GType gtype);
ClutterPaintNode * _clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color,
CoglBufferBit clear_flags);
ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix); ClutterPaintNode * _clutter_transform_node_new (const CoglMatrix *matrix);
ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor); ClutterPaintNode * _clutter_dummy_node_new (ClutterActor *actor);
......
...@@ -83,16 +83,13 @@ _clutter_paint_node_init_types (void) ...@@ -83,16 +83,13 @@ _clutter_paint_node_init_types (void)
} }
/* /*
* Root node, private * Root node
* *
* any frame can only have a since RootNode instance for each * any frame can only have a since RootNode instance for each
* top-level actor. * top-level actor.
*/ */
#define clutter_root_node_get_type _clutter_root_node_get_type #define clutter_root_node_get_type clutter_root_node_get_type
typedef struct _ClutterRootNode ClutterRootNode;
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
struct _ClutterRootNode struct _ClutterRootNode
{ {
...@@ -158,13 +155,13 @@ clutter_root_node_init (ClutterRootNode *self) ...@@ -158,13 +155,13 @@ clutter_root_node_init (ClutterRootNode *self)
} }
ClutterPaintNode * ClutterPaintNode *
_clutter_root_node_new (CoglFramebuffer *framebuffer, clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color, const ClutterColor *clear_color,
CoglBufferBit clear_flags) CoglBufferBit clear_flags)
{ {
ClutterRootNode *res; ClutterRootNode *res;
res = _clutter_paint_node_create (_clutter_root_node_get_type ()); res = _clutter_paint_node_create (CLUTTER_TYPE_ROOT_NODE);
cogl_color_init_from_4ub (&res->clear_color, cogl_color_init_from_4ub (&res->clear_color,
clear_color->red, clear_color->red,
......
...@@ -143,6 +143,26 @@ CLUTTER_EXPORT ...@@ -143,6 +143,26 @@ CLUTTER_EXPORT
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout, ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
const ClutterColor *color); const ClutterColor *color);
#define CLUTTER_TYPE_ROOT_NODE (clutter_root_node_get_type ())
#define CLUTTER_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ROOT_NODE, ClutterRootNode))
#define CLUTTER_IS_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ROOT_NODE))
/**
* ClutterRootNode:
*
* The #ClutterRootNode structure is an opaque
* type whose members cannot be directly accessed.
*/
typedef struct _ClutterRootNode ClutterRootNode;
typedef struct _ClutterPaintNodeClass ClutterRootNodeClass;
CLUTTER_EXPORT
GType clutter_root_node_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color,
CoglBufferBit clear_flags);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_PAINT_NODES_H__ */ #endif /* __CLUTTER_PAINT_NODES_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment