forked from AuroraMiddleware/gtk
gsk: Add a private getter for container children
No need to get them one-by-one, in our inner loop.
This commit is contained in:
parent
f88efb811b
commit
7fb1389648
@ -2780,6 +2780,17 @@ gsk_container_node_get_child (const GskRenderNode *node,
|
|||||||
return self->children[idx];
|
return self->children[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GskRenderNode **
|
||||||
|
gsk_container_node_get_children (const GskRenderNode *node,
|
||||||
|
guint *n_children)
|
||||||
|
{
|
||||||
|
const GskContainerNode *self = (const GskContainerNode *) node;
|
||||||
|
|
||||||
|
*n_children = self->n_children;
|
||||||
|
|
||||||
|
return self->children;
|
||||||
|
}
|
||||||
|
|
||||||
/*** GSK_TRANSFORM_NODE ***/
|
/*** GSK_TRANSFORM_NODE ***/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,6 +103,10 @@ bool gsk_border_node_get_uniform_color (const GskRenderNode
|
|||||||
void gsk_text_node_serialize_glyphs (GskRenderNode *self,
|
void gsk_text_node_serialize_glyphs (GskRenderNode *self,
|
||||||
GString *str);
|
GString *str);
|
||||||
|
|
||||||
|
GskRenderNode ** gsk_container_node_get_children (const GskRenderNode *node,
|
||||||
|
guint *n_children);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|
||||||
|
@ -3536,18 +3536,21 @@ gsk_ngl_render_job_visit_node (GskNglRenderJob *job,
|
|||||||
|
|
||||||
case GSK_CONTAINER_NODE:
|
case GSK_CONTAINER_NODE:
|
||||||
{
|
{
|
||||||
guint n_children = gsk_container_node_get_n_children (node);
|
GskRenderNode **children;
|
||||||
|
guint n_children;
|
||||||
|
|
||||||
|
children = gsk_container_node_get_children (node, &n_children);
|
||||||
|
|
||||||
for (guint i = 0; i < n_children; i++)
|
for (guint i = 0; i < n_children; i++)
|
||||||
{
|
{
|
||||||
const GskRenderNode *child = gsk_container_node_get_child (node, i);
|
const GskRenderNode *child = children[i];
|
||||||
|
|
||||||
if (i + 1 < n_children &&
|
if (i + 1 < n_children &&
|
||||||
job->current_clip->is_fully_contained &&
|
job->current_clip->is_fully_contained &&
|
||||||
gsk_render_node_get_node_type (child) == GSK_ROUNDED_CLIP_NODE)
|
gsk_render_node_get_node_type (child) == GSK_ROUNDED_CLIP_NODE)
|
||||||
{
|
{
|
||||||
const GskRenderNode *grandchild = gsk_rounded_clip_node_get_child (child);
|
const GskRenderNode *grandchild = gsk_rounded_clip_node_get_child (child);
|
||||||
const GskRenderNode *child2 = gsk_container_node_get_child (node, i + 1);
|
const GskRenderNode *child2 = children[i + 1];
|
||||||
if (gsk_render_node_get_node_type (grandchild) == GSK_COLOR_NODE &&
|
if (gsk_render_node_get_node_type (grandchild) == GSK_COLOR_NODE &&
|
||||||
gsk_render_node_get_node_type (child2) == GSK_BORDER_NODE &&
|
gsk_render_node_get_node_type (child2) == GSK_BORDER_NODE &&
|
||||||
gsk_border_node_get_uniform_color (child2) &&
|
gsk_border_node_get_uniform_color (child2) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user