diff options
author | Benjamin Otte <otte@redhat.com> | 2016-12-11 11:48:32 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-12-20 18:01:09 +0100 |
commit | e4ee65fd194788604e6e109bfbd52a7537295645 (patch) | |
tree | 8032408701b40d066689b243aefd6e37d018e3a3 /gsk | |
parent | 684d25bd1aa1eac4a6cb23bc48aa6d9c0d7a1af6 (diff) | |
download | gtk+-e4ee65fd194788604e6e109bfbd52a7537295645.tar.gz |
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.
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/gskcairorenderer.c | 2 | ||||
-rw-r--r-- | gsk/gskglrenderer.c | 15 | ||||
-rw-r--r-- | gsk/gskrendernode.c | 42 | ||||
-rw-r--r-- | gsk/gskrendernode.h | 5 | ||||
-rw-r--r-- | gsk/gskrendernodeimpl.c | 6 | ||||
-rw-r--r-- | gsk/gskrendernodeprivate.h | 1 |
6 files changed, 8 insertions, 63 deletions
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c index 0482903430..3aebb417a3 100644 --- a/gsk/gskcairorenderer.c +++ b/gsk/gskcairorenderer.c @@ -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))); diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c index 463cf89e46..f7bf7bc0a5 100644 --- a/gsk/gskglrenderer.c +++ b/gsk/gskglrenderer.c @@ -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); diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c index d694ce85a5..2126723833 100644 --- a/gsk/gskrendernode.c +++ b/gsk/gskrendernode.c @@ -604,48 +604,6 @@ gsk_render_node_get_opacity (GskRenderNode *node) } /** - * 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 * @descendant: a #GskRenderNode diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h index 6c40d41616..32cbdb88f8 100644 --- a/gsk/gskrendernode.h +++ b/gsk/gskrendernode.h @@ -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, diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 3d9dc08153..b3ba4755b6 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -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)); } diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h index 7d7748d8a0..1d46db8db3 100644 --- a/gsk/gskrendernodeprivate.h +++ b/gsk/gskrendernodeprivate.h @@ -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; }; |