[gtk+/wip/otte/rendernode: 17/27] gsk: Remove gsk_render_node_set_opaque()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/rendernode: 17/27] gsk: Remove gsk_render_node_set_opaque()
- Date: Tue, 13 Dec 2016 01:38:16 +0000 (UTC)
commit ceb07ec478dffd7cda1645433ca39e2e7d9a9dbe
Author: Benjamin Otte <otte redhat com>
Date: Sun Dec 11 11:48:32 2016 +0100
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.
docs/reference/gsk/gsk4-sections.txt | 2 -
gsk/gskcairorenderer.c | 2 +-
gsk/gskglrenderer.c | 15 ++++--------
gsk/gskrendernode.c | 42 ----------------------------------
gsk/gskrendernode.h | 5 ----
gsk/gskrendernodeimpl.c | 6 +---
gsk/gskrendernodeprivate.h | 1 -
7 files changed, 8 insertions(+), 65 deletions(-)
---
diff --git a/docs/reference/gsk/gsk4-sections.txt b/docs/reference/gsk/gsk4-sections.txt
index bbae443..5daa4f4 100644
--- a/docs/reference/gsk/gsk4-sections.txt
+++ b/docs/reference/gsk/gsk4-sections.txt
@@ -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
diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c
index 0482903..3aebb41 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 463cf89..f7bf7bc 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 d694ce8..2126723 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 6c40d41..32cbdb8 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 3d9dc08..b3ba475 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 7d7748d..1d46db8 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;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]