forked from AuroraMiddleware/gtk
gsk: Remove gsk_render_node_set_opaque()
If we ever feel, we need this function again, we can readd it later. But nobody is using it other than for overriding opactiy. And you can just override opacity directly if you care.
This commit is contained in:
parent
684d25bd1a
commit
e4ee65fd19
@ -39,8 +39,6 @@ gsk_render_node_contains
|
||||
gsk_render_node_set_bounds
|
||||
gsk_render_node_set_transform
|
||||
gsk_render_node_set_opacity
|
||||
gsk_render_node_set_opaque
|
||||
gsk_render_node_is_opaque
|
||||
GskBlendMode
|
||||
gsk_render_node_set_blend_mode
|
||||
GskScalingFilter
|
||||
|
@ -82,7 +82,7 @@ gsk_cairo_renderer_render_node (GskCairoRenderer *self,
|
||||
cairo_clip (cr);
|
||||
}
|
||||
|
||||
if (!gsk_render_node_is_opaque (node) && gsk_render_node_get_opacity (node) != 1.0)
|
||||
if (gsk_render_node_get_opacity (node) != 1.0)
|
||||
{
|
||||
GSK_NOTE (CAIRO, g_print ("Pushing opacity group (opacity:%g)\n",
|
||||
gsk_render_node_get_opacity (node)));
|
||||
|
@ -48,7 +48,6 @@ typedef struct {
|
||||
|
||||
graphene_matrix_t mvp;
|
||||
|
||||
gboolean opaque : 1;
|
||||
float opacity;
|
||||
float z;
|
||||
|
||||
@ -460,7 +459,7 @@ render_item (GskGLRenderer *self,
|
||||
}
|
||||
|
||||
/* Pass the opacity component */
|
||||
if (item->children != NULL || item->opaque)
|
||||
if (item->children != NULL)
|
||||
opacity = 1.0;
|
||||
else
|
||||
opacity = item->opacity;
|
||||
@ -479,7 +478,7 @@ render_item (GskGLRenderer *self,
|
||||
item->name,
|
||||
item,
|
||||
item->size.width, item->size.height,
|
||||
item->opaque ? 1 : item->opacity,
|
||||
item->opacity,
|
||||
item->blend_mode));
|
||||
|
||||
glDrawArrays (GL_TRIANGLES, 0, N_VERTICES);
|
||||
@ -607,13 +606,10 @@ project_item (const graphene_matrix_t *projection,
|
||||
static gboolean
|
||||
render_node_needs_render_target (GskRenderNode *node)
|
||||
{
|
||||
if (!gsk_render_node_is_opaque (node))
|
||||
{
|
||||
double opacity = gsk_render_node_get_opacity (node);
|
||||
double opacity = gsk_render_node_get_opacity (node);
|
||||
|
||||
if (opacity < 1.0)
|
||||
return TRUE;
|
||||
}
|
||||
if (opacity < 1.0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -667,7 +663,6 @@ gsk_gl_renderer_add_render_item (GskGLRenderer *self,
|
||||
graphene_matrix_multiply (&mv, &self->mvp, &item.mvp);
|
||||
item.z = project_item (projection, &mv);
|
||||
|
||||
item.opaque = gsk_render_node_is_opaque (node);
|
||||
item.opacity = gsk_render_node_get_opacity (node);
|
||||
|
||||
item.blend_mode = gsk_render_node_get_blend_mode (node);
|
||||
|
@ -603,48 +603,6 @@ gsk_render_node_get_opacity (GskRenderNode *node)
|
||||
return node->opacity;
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_render_node_set_opaque:
|
||||
* @node: a #GskRenderNode
|
||||
* @opaque: whether the node is fully opaque or not
|
||||
*
|
||||
* Sets whether the node is known to be fully opaque.
|
||||
*
|
||||
* Fully opaque nodes will ignore the opacity set using gsk_render_node_set_opacity(),
|
||||
* but if their parent is not opaque they may still be rendered with an opacity.
|
||||
*
|
||||
* Renderers may use this information to optimize the rendering pipeline.
|
||||
*
|
||||
* Since: 3.90
|
||||
*/
|
||||
void
|
||||
gsk_render_node_set_opaque (GskRenderNode *node,
|
||||
gboolean opaque)
|
||||
{
|
||||
g_return_if_fail (GSK_IS_RENDER_NODE (node));
|
||||
g_return_if_fail (node->is_mutable);
|
||||
|
||||
node->opaque = !!opaque;
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_render_node_is_opaque:
|
||||
* @node: a #GskRenderNode
|
||||
*
|
||||
* Retrieves the value set using gsk_render_node_set_opaque().
|
||||
*
|
||||
* Returns: %TRUE if the #GskRenderNode is fully opaque
|
||||
*
|
||||
* Since: 3.90
|
||||
*/
|
||||
gboolean
|
||||
gsk_render_node_is_opaque (GskRenderNode *node)
|
||||
{
|
||||
g_return_val_if_fail (GSK_IS_RENDER_NODE (node), TRUE);
|
||||
|
||||
return node->opaque;
|
||||
}
|
||||
|
||||
/**
|
||||
* gsk_render_node_contains:
|
||||
* @node: a #GskRenderNode
|
||||
|
@ -87,11 +87,6 @@ void gsk_render_node_set_transform (GskRenderNode
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
void gsk_render_node_set_opacity (GskRenderNode *node,
|
||||
double opacity);
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
void gsk_render_node_set_opaque (GskRenderNode *node,
|
||||
gboolean opaque);
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
gboolean gsk_render_node_is_opaque (GskRenderNode *node);
|
||||
|
||||
GDK_AVAILABLE_IN_3_90
|
||||
void gsk_render_node_set_blend_mode (GskRenderNode *node,
|
||||
|
@ -201,15 +201,13 @@ gsk_cairo_node_get_draw_context (GskRenderNode *node,
|
||||
if (renderer)
|
||||
{
|
||||
self->surface = gsk_renderer_create_cairo_surface (renderer,
|
||||
node->opaque ? CAIRO_FORMAT_RGB24
|
||||
: CAIRO_FORMAT_ARGB32,
|
||||
CAIRO_FORMAT_ARGB32,
|
||||
ceilf (node->bounds.size.width),
|
||||
ceilf (node->bounds.size.height));
|
||||
}
|
||||
else
|
||||
{
|
||||
self->surface = cairo_image_surface_create (node->opaque ? CAIRO_FORMAT_RGB24
|
||||
: CAIRO_FORMAT_ARGB32,
|
||||
self->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
ceilf (node->bounds.size.width),
|
||||
ceilf (node->bounds.size.height));
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ struct _GskRenderNode
|
||||
|
||||
/* Bit fields; leave at the end */
|
||||
gboolean is_mutable : 1;
|
||||
gboolean opaque : 1;
|
||||
gboolean transform_set : 1;
|
||||
gboolean needs_world_matrix_update : 1;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user