gsk: Remove GskRenderNode::hidden

If you want to hide something, don't render it.
This commit is contained in:
Benjamin Otte 2016-12-10 00:18:03 +01:00
parent 04a2c1499a
commit ff884385c0
9 changed files with 1 additions and 69 deletions

View File

@ -45,8 +45,6 @@ gsk_render_node_contains
gsk_render_node_set_bounds gsk_render_node_set_bounds
gsk_render_node_set_transform gsk_render_node_set_transform
gsk_render_node_set_opacity gsk_render_node_set_opacity
gsk_render_node_set_hidden
gsk_render_node_is_hidden
gsk_render_node_set_opaque gsk_render_node_set_opaque
gsk_render_node_is_opaque gsk_render_node_is_opaque
gsk_render_node_get_draw_context gsk_render_node_get_draw_context

View File

@ -59,9 +59,6 @@ gsk_cairo_renderer_render_node (GskCairoRenderer *self,
cairo_matrix_t ctm; cairo_matrix_t ctm;
graphene_rect_t frame; graphene_rect_t frame;
if (gsk_render_node_is_hidden (node))
return;
cairo_save (cr); cairo_save (cr);
if (!gsk_render_node_has_surface (node) && if (!gsk_render_node_has_surface (node) &&

View File

@ -636,14 +636,6 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
int program_id; int program_id;
int scale_factor; int scale_factor;
if (gsk_render_node_is_hidden (node))
{
GSK_NOTE (OPENGL, g_print ("Skipping hidden node <%s>[%p]\n",
node->name != NULL ? node->name : "unnamed",
node));
return;
}
memset (&item, 0, sizeof (RenderItem)); memset (&item, 0, sizeof (RenderItem));
gsk_renderer_get_viewport (GSK_RENDERER (self), &viewport); gsk_renderer_get_viewport (GSK_RENDERER (self), &viewport);

View File

@ -1003,45 +1003,6 @@ gsk_render_node_get_opacity (GskRenderNode *node)
return node->opacity; return node->opacity;
} }
/**
* gsk_render_node_set_hidden:
* @node: a #GskRenderNode
* @hidden: whether the @node should be hidden or not
*
* Sets whether the @node should be hidden.
*
* Hidden nodes, and their descendants, are not rendered.
*
* Since: 3.90
*/
void
gsk_render_node_set_hidden (GskRenderNode *node,
gboolean hidden)
{
g_return_if_fail (GSK_IS_RENDER_NODE (node));
g_return_if_fail (node->is_mutable);
node->hidden = !!hidden;
}
/**
* gsk_render_node_is_hidden:
* @node: a #GskRenderNode
*
* Checks whether a @node is hidden.
*
* Returns: %TRUE if the #GskRenderNode is hidden
*
* Since: 3.90
*/
gboolean
gsk_render_node_is_hidden (GskRenderNode *node)
{
g_return_val_if_fail (GSK_IS_RENDER_NODE (node), TRUE);
return node->hidden;
}
/** /**
* gsk_render_node_set_opaque: * gsk_render_node_set_opaque:
* @node: a #GskRenderNode * @node: a #GskRenderNode

View File

@ -98,11 +98,6 @@ GDK_AVAILABLE_IN_3_90
void gsk_render_node_set_opacity (GskRenderNode *node, void gsk_render_node_set_opacity (GskRenderNode *node,
double opacity); double opacity);
GDK_AVAILABLE_IN_3_90 GDK_AVAILABLE_IN_3_90
void gsk_render_node_set_hidden (GskRenderNode *node,
gboolean hidden);
GDK_AVAILABLE_IN_3_90
gboolean gsk_render_node_is_hidden (GskRenderNode *node);
GDK_AVAILABLE_IN_3_90
void gsk_render_node_set_opaque (GskRenderNode *node, void gsk_render_node_set_opaque (GskRenderNode *node,
gboolean opaque); gboolean opaque);
GDK_AVAILABLE_IN_3_90 GDK_AVAILABLE_IN_3_90

View File

@ -58,7 +58,6 @@ struct _GskRenderNode
/* Bit fields; leave at the end */ /* Bit fields; leave at the end */
gboolean is_mutable : 1; gboolean is_mutable : 1;
gboolean hidden : 1;
gboolean opaque : 1; gboolean opaque : 1;
gboolean transform_set : 1; gboolean transform_set : 1;
gboolean needs_world_matrix_update : 1; gboolean needs_world_matrix_update : 1;

View File

@ -64,9 +64,6 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
.node = node .node = node
}; };
if (gsk_render_node_is_hidden (node))
return;
if (gsk_render_node_get_opacity (node) < 1.0) if (gsk_render_node_get_opacity (node) < 1.0)
goto fallback; goto fallback;

View File

@ -51,7 +51,6 @@ struct _GtkInspectorRecorderPrivate
enum { enum {
COLUMN_NODE_NAME, COLUMN_NODE_NAME,
COLUMN_NODE_VISIBLE,
/* add more */ /* add more */
N_NODE_COLUMNS N_NODE_COLUMNS
}; };
@ -123,10 +122,6 @@ render_node_list_get_value (GtkTreeModelRenderNode *model,
g_value_set_string (value, gsk_render_node_get_name (node)); g_value_set_string (value, gsk_render_node_get_name (node));
break; break;
case COLUMN_NODE_VISIBLE:
g_value_set_boolean (value, !gsk_render_node_is_hidden (node));
break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
break; break;
@ -421,8 +416,7 @@ gtk_inspector_recorder_init (GtkInspectorRecorder *recorder)
priv->render_node_model = gtk_tree_model_render_node_new (render_node_list_get_value, priv->render_node_model = gtk_tree_model_render_node_new (render_node_list_get_value,
N_NODE_COLUMNS, N_NODE_COLUMNS,
G_TYPE_STRING, G_TYPE_STRING);
G_TYPE_BOOLEAN);
gtk_tree_view_set_model (GTK_TREE_VIEW (priv->render_node_tree), priv->render_node_model); gtk_tree_view_set_model (GTK_TREE_VIEW (priv->render_node_tree), priv->render_node_model);
g_object_unref (priv->render_node_model); g_object_unref (priv->render_node_model);

View File

@ -93,7 +93,6 @@
<object class="GtkCellRendererText"/> <object class="GtkCellRendererText"/>
<attributes> <attributes>
<attribute name="text">0</attribute> <attribute name="text">0</attribute>
<attribute name="sensitive">1</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>