[PATCH 2/7] glamor: Drop CloseScreen-time GL resource cleanup code.
Eric Anholt
eric at anholt.net
Fri Jun 19 19:09:36 PDT 2015
These will all be freed when the context is freed.
Signed-off-by: Eric Anholt <eric at anholt.net>
---
glamor/glamor.c | 5 -----
glamor/glamor_core.c | 11 -----------
glamor/glamor_gradient.c | 21 ---------------------
glamor/glamor_priv.h | 3 ---
glamor/glamor_render.c | 21 ---------------------
glamor/glamor_vbo.c | 1 -
6 files changed, 62 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 71ca4f4..a951cec 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -585,13 +585,8 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_screen_private *glamor_priv;
glamor_priv = glamor_get_screen_private(screen);
- glamor_fini_composite_shaders(screen);
glamor_fini_vbo(screen);
glamor_fini_pixmap_fbo(screen);
- glamor_fini_finish_access_shaders(screen);
-#ifdef GLAMOR_GRADIENT_SHADER
- glamor_fini_gradient_shader(screen);
-#endif
glamor_pixmap_fini(screen);
free(glamor_priv);
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 965024e..4f3526c 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -283,17 +283,6 @@ glamor_init_finish_access_shaders(ScreenPtr screen)
glUniform1i(glamor_priv->finish_access_swap_rb[1], 0);
}
-void
-glamor_fini_finish_access_shaders(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glDeleteProgram(glamor_priv->finish_access_prog[0]);
- glDeleteProgram(glamor_priv->finish_access_prog[1]);
-}
-
GCOps glamor_gc_ops = {
.FillSpans = glamor_fill_spans,
.SetSpans = glamor_set_spans,
diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
index d34131d..30c29f6 100644
--- a/glamor/glamor_gradient.c
+++ b/glamor/glamor_gradient.c
@@ -582,27 +582,6 @@ glamor_init_gradient_shader(ScreenPtr screen)
_glamor_create_radial_gradient_program(screen, RADIAL_LARGE_STOPS, 0);
}
-void
-glamor_fini_gradient_shader(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- int i = 0;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
-
- for (i = 0; i < 3; i++) {
- /* Linear Gradient */
- if (glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][i])
- glDeleteProgram(glamor_priv->gradient_prog
- [SHADER_GRADIENT_LINEAR][i]);
-
- if (glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][i])
- glDeleteProgram(glamor_priv->gradient_prog
- [SHADER_GRADIENT_RADIAL][i]);
- }
-}
-
static void
_glamor_gradient_convert_trans_matrix(PictTransform *from, float to[3][3],
int width, int height, int normalize)
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 480d13b..438d1e9 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -645,7 +645,6 @@ glamor_pixmap_fbo *glamor_create_fbo_array(glamor_screen_private *glamor_priv,
/* glamor_core.c */
void glamor_init_finish_access_shaders(ScreenPtr screen);
-void glamor_fini_finish_access_shaders(ScreenPtr screen);
Bool glamor_get_drawable_location(const DrawablePtr drawable);
void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
@@ -703,7 +702,6 @@ void glamor_composite(CARD8 op,
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
void glamor_init_composite_shaders(ScreenPtr screen);
-void glamor_fini_composite_shaders(ScreenPtr screen);
void glamor_composite_rects(CARD8 op,
PicturePtr pDst,
xRenderColor *color, int nRect, xRectangle *rects);
@@ -722,7 +720,6 @@ void glamor_trapezoids(CARD8 op,
/* glamor_gradient.c */
void glamor_init_gradient_shader(ScreenPtr screen);
-void glamor_fini_gradient_shader(ScreenPtr screen);
PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen,
PicturePtr src_picture,
int x_source, int y_source,
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 05eee91..1849cce 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -414,27 +414,6 @@ glamor_init_composite_shaders(ScreenPtr screen)
free(eb);
}
-void
-glamor_fini_composite_shaders(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
- glamor_composite_shader *shader;
- int i, j, k;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_make_current(glamor_priv);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- glDeleteBuffers(1, &glamor_priv->ebo);
-
- for (i = 0; i < SHADER_SOURCE_COUNT; i++)
- for (j = 0; j < SHADER_MASK_COUNT; j++)
- for (k = 0; k < SHADER_IN_COUNT; k++) {
- shader = &glamor_priv->composite_shader[i][j][k];
- if (shader->prog)
- glDeleteProgram(shader->prog);
- }
-}
-
static Bool
glamor_set_composite_op(ScreenPtr screen,
CARD8 op, struct blendinfo *op_info_result,
diff --git a/glamor/glamor_vbo.c b/glamor/glamor_vbo.c
index e906101..d74a005 100644
--- a/glamor/glamor_vbo.c
+++ b/glamor/glamor_vbo.c
@@ -171,7 +171,6 @@ glamor_fini_vbo(ScreenPtr screen)
glamor_make_current(glamor_priv);
- glDeleteBuffers(1, &glamor_priv->vbo);
if (!glamor_priv->has_map_buffer_range)
free(glamor_priv->vb);
}
--
2.1.4
More information about the xorg-devel
mailing list