[mutter] cogl: Remove unused cogl_texture_new_from_foreign



commit fb40e2eefb6eaa59b910fd744574fbde8b2d1e00
Author: Adam Jackson <ajax redhat com>
Date:   Fri Mar 8 10:17:32 2019 -0500

    cogl: Remove unused cogl_texture_new_from_foreign
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/546

 clutter/tests/interactive/meson.build             |   1 -
 clutter/tests/interactive/test-cogl-tex-foreign.c | 276 ----------------------
 cogl/cogl/cogl-texture-2d-sliced.c                |   4 +-
 cogl/cogl/cogl.symbols                            |   1 -
 cogl/cogl/deprecated/cogl-auto-texture.c          |  76 ------
 cogl/cogl/deprecated/cogl-auto-texture.h          |  38 ---
 6 files changed, 1 insertion(+), 395 deletions(-)
---
diff --git a/clutter/tests/interactive/meson.build b/clutter/tests/interactive/meson.build
index cae5e7b79..50e6fd569 100644
--- a/clutter/tests/interactive/meson.build
+++ b/clutter/tests/interactive/meson.build
@@ -31,7 +31,6 @@ clutter_tests_interactive_test_sources = [
   'test-fbo.c',
   'test-cogl-tex-tile.c',
   'test-cogl-tex-convert.c',
-  'test-cogl-tex-foreign.c',
   'test-cogl-offscreen.c',
   'test-cogl-tex-polygon.c',
   'test-cogl-multitexture.c',
diff --git a/cogl/cogl/cogl-texture-2d-sliced.c b/cogl/cogl/cogl-texture-2d-sliced.c
index ab302450a..b5628acbf 100644
--- a/cogl/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl/cogl-texture-2d-sliced.c
@@ -931,9 +931,7 @@ _cogl_texture_2d_sliced_new_from_foreign (CoglContext *ctx,
    * in GLES, hence such a function prototype.
    */
 
-  /* This should only be called when the texture target is 2D. If a
-     rectangle texture is used then _cogl_texture_new_from_foreign
-     will create a cogl_texture_rectangle instead */
+  /* This should only be called when the texture target is 2D. */
   _COGL_RETURN_VAL_IF_FAIL (gl_target == GL_TEXTURE_2D, NULL);
 
   /* Assert it is a valid GL texture object */
diff --git a/cogl/cogl/cogl.symbols b/cogl/cogl/cogl.symbols
index 4fbf2246b..a80c50cc9 100644
--- a/cogl/cogl/cogl.symbols
+++ b/cogl/cogl/cogl.symbols
@@ -908,7 +908,6 @@ cogl_texture_is_sliced
 cogl_texture_new_from_bitmap
 cogl_texture_new_from_data
 cogl_texture_new_from_file
-cogl_texture_new_from_foreign
 cogl_texture_new_from_sub_texture
 cogl_texture_new_with_size
 #ifdef COGL_HAS_X11
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.c b/cogl/cogl/deprecated/cogl-auto-texture.c
index 5fc2732aa..9465c76d1 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.c
+++ b/cogl/cogl/deprecated/cogl-auto-texture.c
@@ -314,82 +314,6 @@ cogl_texture_new_from_file (const char        *filename,
   return texture;
 }
 
-CoglTexture *
-cogl_texture_new_from_foreign (GLuint           gl_handle,
-                              GLenum           gl_target,
-                              GLuint           width,
-                              GLuint           height,
-                              GLuint           x_pot_waste,
-                              GLuint           y_pot_waste,
-                              CoglPixelFormat  format)
-{
-  _COGL_GET_CONTEXT (ctx, NULL);
-
-#ifdef HAVE_COGL_GL
-  if (gl_target == GL_TEXTURE_RECTANGLE_ARB)
-    {
-      CoglTextureRectangle *texture_rectangle;
-      CoglSubTexture *sub_texture;
-
-      if (x_pot_waste != 0 || y_pot_waste != 0)
-        {
-          /* It shouldn't be necessary to have waste in this case since
-           * the texture isn't limited to power of two sizes. */
-          g_warning ("You can't create a foreign GL_TEXTURE_RECTANGLE cogl "
-                     "texture with waste\n");
-          return NULL;
-        }
-
-      texture_rectangle = cogl_texture_rectangle_new_from_foreign (ctx,
-                                                                   gl_handle,
-                                                                   width,
-                                                                   height,
-                                                                   format);
-      _cogl_texture_set_internal_format (COGL_TEXTURE (texture_rectangle),
-                                         format);
-
-      /* CoglTextureRectangle textures work with non-normalized
-       * coordinates, but the semantics for this function that people
-       * depend on are that all returned texture works with normalized
-       * coordinates so we wrap with a CoglSubTexture... */
-      sub_texture = cogl_sub_texture_new (ctx,
-                                          COGL_TEXTURE (texture_rectangle),
-                                          0, 0, width, height);
-      return COGL_TEXTURE (sub_texture);
-    }
-#endif
-
-  if (x_pot_waste != 0 || y_pot_waste != 0)
-    {
-      CoglTexture *tex =
-        COGL_TEXTURE (_cogl_texture_2d_sliced_new_from_foreign (ctx,
-                                                                gl_handle,
-                                                                gl_target,
-                                                                width,
-                                                                height,
-                                                                x_pot_waste,
-                                                                y_pot_waste,
-                                                                format));
-      _cogl_texture_set_internal_format (tex, format);
-
-      cogl_texture_allocate (tex, NULL);
-      return tex;
-    }
-  else
-    {
-      CoglTexture *tex =
-        COGL_TEXTURE (cogl_texture_2d_gl_new_from_foreign (ctx,
-                                                           gl_handle,
-                                                           width,
-                                                           height,
-                                                           format));
-      _cogl_texture_set_internal_format (tex, format);
-
-      cogl_texture_allocate (tex, NULL);
-      return tex;
-    }
-}
-
 CoglTexture *
 cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
                                    int sub_x,
diff --git a/cogl/cogl/deprecated/cogl-auto-texture.h b/cogl/cogl/deprecated/cogl-auto-texture.h
index e37d18301..47fda828b 100644
--- a/cogl/cogl/deprecated/cogl-auto-texture.h
+++ b/cogl/cogl/deprecated/cogl-auto-texture.h
@@ -125,44 +125,6 @@ cogl_texture_new_from_data (int width,
                             int rowstride,
                             const uint8_t *data);
 
-/**
- * cogl_texture_new_from_foreign:
- * @gl_handle: opengl handle of foreign texture.
- * @gl_target: opengl target type of foreign texture
- * @width: width of foreign texture
- * @height: height of foreign texture.
- * @x_pot_waste: horizontal waste on the right hand edge of the texture.
- * @y_pot_waste: vertical waste on the bottom edge of the texture.
- * @format: format of the foreign texture.
- *
- * Creates a #CoglTexture based on an existing OpenGL texture; the
- * width, height and format are passed along since it is not always
- * possible to query these from OpenGL.
- *
- * The waste arguments allow you to create a Cogl texture that maps to
- * a region smaller than the real OpenGL texture. For instance if your
- * hardware only supports power-of-two textures you may load a
- * non-power-of-two image into a larger power-of-two texture and use
- * the waste arguments to tell Cogl which region should be mapped to
- * the texture coordinate range [0:1].
- *
- * Return value: (transfer full): A newly created #CoglTexture or
- *               %NULL on failure
- *
- * Since: 0.8
- * Deprecated: 1.18: Use specific constructors such as
- *                   cogl_texture_2d_new_from_foreign()
- */
-COGL_DEPRECATED_FOR (cogl_texture_2d_new_from_foreign)
-CoglTexture *
-cogl_texture_new_from_foreign (unsigned int gl_handle,
-                               unsigned int gl_target,
-                               unsigned int width,
-                               unsigned int height,
-                               unsigned int x_pot_waste,
-                               unsigned int y_pot_waste,
-                               CoglPixelFormat format);
-
 /**
  * cogl_texture_new_from_bitmap:
  * @bitmap: A #CoglBitmap pointer


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]