[PATCH 4/7] glamor: Drop dead glamor_es2_pixmap_read_prepare().

Eric Anholt eric at anholt.net
Tue Jun 30 15:58:11 PDT 2015


It's been unused since I killed glamor_download_pixmap_to_cpu().

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_pixmap.c | 70 --------------------------------------------------
 glamor/glamor_priv.h   |  6 -----
 2 files changed, 76 deletions(-)

diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 0e51550..9a14527 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -1059,73 +1059,3 @@ glamor_upload_pixmap_to_texture(PixmapPtr pixmap)
 
     return ret;
 }
-
-/*
- * as gles2 only support a very small set of color format and
- * type when do glReadPixel,
- * Before we use glReadPixels to get back a textured pixmap,
- * Use shader to convert it to a supported format and thus
- * get a new temporary pixmap returned.
- * */
-
-glamor_pixmap_fbo *
-glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h,
-                               GLenum format, GLenum type, int no_alpha,
-                               int revert, int swap_rb)
-{
-    glamor_pixmap_private *source_priv;
-    glamor_screen_private *glamor_priv;
-    ScreenPtr screen;
-    glamor_pixmap_fbo *temp_fbo;
-    float temp_xscale, temp_yscale, source_xscale, source_yscale;
-    static float vertices[8];
-    static float texcoords[8];
-
-    screen = source->drawable.pScreen;
-
-    glamor_priv = glamor_get_screen_private(screen);
-    source_priv = glamor_get_pixmap_private(source);
-    temp_fbo = glamor_create_fbo(glamor_priv, w, h, format, 0);
-    if (temp_fbo == NULL)
-        return NULL;
-
-    glamor_make_current(glamor_priv);
-    temp_xscale = 1.0 / w;
-    temp_yscale = 1.0 / h;
-
-    glamor_set_normalize_vcoords((struct glamor_pixmap_private *) NULL,
-                                 temp_xscale, temp_yscale, 0, 0, w, h,
-                                 vertices);
-
-    glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE,
-                          2 * sizeof(float), vertices);
-    glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
-
-    pixmap_priv_get_scale(source_priv, &source_xscale, &source_yscale);
-    glamor_set_normalize_tcoords(source_priv, source_xscale,
-                                 source_yscale,
-                                 x, y,
-                                 x + w, y + h,
-                                 texcoords);
-
-    glVertexAttribPointer(GLAMOR_VERTEX_SOURCE, 2, GL_FLOAT, GL_FALSE,
-                          2 * sizeof(float), texcoords);
-    glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
-
-    glActiveTexture(GL_TEXTURE0);
-    glBindTexture(GL_TEXTURE_2D, source_priv->fbo->tex);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
-    glamor_set_destination_pixmap_fbo(glamor_priv, temp_fbo, 0, 0, w, h);
-    glamor_set_alu(screen, GXcopy);
-    glUseProgram(glamor_priv->finish_access_prog[no_alpha]);
-    glUniform1i(glamor_priv->finish_access_revert[no_alpha], revert);
-    glUniform1i(glamor_priv->finish_access_swap_rb[no_alpha], swap_rb);
-
-    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
-    glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
-    glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
-    return temp_fbo;
-}
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index c12bf28..43c1231 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -615,12 +615,6 @@ void glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glamo
  * */
 void glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv);
 
-glamor_pixmap_fbo *glamor_es2_pixmap_read_prepare(PixmapPtr source, int x,
-                                                  int y, int w, int h,
-                                                  GLenum format, GLenum type,
-                                                  int no_alpha, int revert,
-                                                  int swap_rb);
-
 Bool glamor_set_alu(ScreenPtr screen, unsigned char alu);
 Bool glamor_set_planemask(int depth, unsigned long planemask);
 RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
-- 
2.1.4



More information about the xorg-devel mailing list