[Cogl] [PATCH] Move _cogl_texture_get_gl_format to -texture-gl.c

Robert Bragg robert at sixbynine.org
Thu Dec 6 03:53:56 PST 2012


From: Robert Bragg <robert at linux.intel.com>

This moves the _cogl_texture_get_gl_format function from cogl-texture.c
to cogl-texture-gl.c and renames it _cogl_texture_gl_get_format.
---
 cogl/cogl-atlas-texture.c                      |    2 +-
 cogl/cogl-sub-texture.c                        |    2 +-
 cogl/cogl-texture-2d-sliced.c                  |    2 +-
 cogl/cogl-texture-private.h                    |    3 ---
 cogl/cogl-texture.c                            |    6 ------
 cogl/driver/gl/cogl-texture-gl-private.h       |    3 +++
 cogl/driver/gl/cogl-texture-gl.c               |    6 ++++++
 cogl/driver/gl/gl/cogl-texture-driver-gl.c     |    4 ++--
 cogl/driver/gl/gles/cogl-texture-driver-gles.c |    4 ++--
 cogl/winsys/cogl-texture-pixmap-x11.c          |    2 +-
 10 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index a3e9e7e..af98a0e 100644
--- a/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl-atlas-texture.c
@@ -634,7 +634,7 @@ _cogl_atlas_texture_get_gl_format (CoglTexture *tex)
   CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
 
   /* Forward on to the sub texture */
-  return _cogl_texture_get_gl_format (atlas_tex->sub_texture);
+  return _cogl_texture_gl_get_format (atlas_tex->sub_texture);
 }
 
 static int
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index e512d48..1eb7326 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -415,7 +415,7 @@ _cogl_sub_texture_get_gl_format (CoglTexture *tex)
 {
   CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
 
-  return _cogl_texture_get_gl_format (sub_tex->full_texture);
+  return _cogl_texture_gl_get_format (sub_tex->full_texture);
 }
 
 static int
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index 6d1f530..636f565 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -1353,7 +1353,7 @@ _cogl_texture_2d_sliced_get_gl_format (CoglTexture *tex)
 
   /* Pass the call on to the first slice */
   slice_tex = g_array_index (tex_2ds->slice_textures, CoglTexture2D *, 0);
-  return _cogl_texture_get_gl_format (COGL_TEXTURE (slice_tex));
+  return _cogl_texture_gl_get_format (COGL_TEXTURE (slice_tex));
 }
 
 static int
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h
index a41d06c..881d722 100644
--- a/cogl/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
@@ -208,9 +208,6 @@ CoglTransformResult
 _cogl_texture_transform_quad_coords_to_gl (CoglTexture *texture,
                                            float *coords);
 
-GLenum
-_cogl_texture_get_gl_format (CoglTexture *texture);
-
 void
 _cogl_texture_pre_paint (CoglTexture *texture, CoglTexturePrePaintFlags flags);
 
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 22874a3..d0ba54d 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -361,12 +361,6 @@ _cogl_texture_transform_quad_coords_to_gl (CoglTexture *texture,
   return texture->vtable->transform_quad_coords_to_gl (texture, coords);
 }
 
-GLenum
-_cogl_texture_get_gl_format (CoglTexture *texture)
-{
-  return texture->vtable->get_gl_format (texture);
-}
-
 CoglBool
 cogl_texture_get_gl_texture (CoglTexture *texture,
 			     GLuint *out_gl_handle,
diff --git a/cogl/driver/gl/cogl-texture-gl-private.h b/cogl/driver/gl/cogl-texture-gl-private.h
index 4ed671b..ed4e001 100644
--- a/cogl/driver/gl/cogl-texture-gl-private.h
+++ b/cogl/driver/gl/cogl-texture-gl-private.h
@@ -53,4 +53,7 @@ _cogl_texture_gl_maybe_update_max_level (CoglTexture *texture,
 void
 _cogl_texture_gl_generate_mipmaps (CoglTexture *texture);
 
+GLenum
+_cogl_texture_gl_get_format (CoglTexture *texture);
+
 #endif /* _COGL_TEXTURE_GL_PRIVATE_H_ */
diff --git a/cogl/driver/gl/cogl-texture-gl.c b/cogl/driver/gl/cogl-texture-gl.c
index 55e4a8c..3dd4607 100644
--- a/cogl/driver/gl/cogl-texture-gl.c
+++ b/cogl/driver/gl/cogl-texture-gl.c
@@ -135,3 +135,9 @@ _cogl_texture_gl_generate_mipmaps (CoglTexture *texture)
                                    _cogl_texture_is_foreign (texture));
   GE( ctx, glGenerateMipmap (gl_target) );
 }
+
+GLenum
+_cogl_texture_gl_get_format (CoglTexture *texture)
+{
+  return texture->vtable->get_gl_format (texture);
+}
diff --git a/cogl/driver/gl/gl/cogl-texture-driver-gl.c b/cogl/driver/gl/gl/cogl-texture-driver-gl.c
index fffa626..8c20ead 100644
--- a/cogl/driver/gl/gl/cogl-texture-driver-gl.c
+++ b/cogl/driver/gl/gl/cogl-texture-driver-gl.c
@@ -243,7 +243,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
        */
       ctx->glTexImage2D (gl_target,
                          level,
-                         _cogl_texture_get_gl_format (texture),
+                         _cogl_texture_gl_get_format (texture),
                          width,
                          height,
                          0,
@@ -264,7 +264,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
         {
           ctx->glTexImage2D (gl_target,
                              level,
-                             _cogl_texture_get_gl_format (texture),
+                             _cogl_texture_gl_get_format (texture),
                              level_width,
                              level_height,
                              0,
diff --git a/cogl/driver/gl/gles/cogl-texture-driver-gles.c b/cogl/driver/gl/gles/cogl-texture-driver-gles.c
index 6180e67..6c2abe7 100644
--- a/cogl/driver/gl/gles/cogl-texture-driver-gles.c
+++ b/cogl/driver/gl/gles/cogl-texture-driver-gles.c
@@ -282,7 +282,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
        */
       ctx->glTexImage2D (gl_target,
                          level,
-                         _cogl_texture_get_gl_format (texture),
+                         _cogl_texture_gl_get_format (texture),
                          width,
                          height,
                          0,
@@ -302,7 +302,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
         {
           ctx->glTexImage2D (gl_target,
                              level,
-                             _cogl_texture_get_gl_format (texture),
+                             _cogl_texture_gl_get_format (texture),
                              level_width,
                              level_height,
                              0,
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c
index 1dc523b..22e952a 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.c
+++ b/cogl/winsys/cogl-texture-pixmap-x11.c
@@ -945,7 +945,7 @@ _cogl_texture_pixmap_x11_get_gl_format (CoglTexture *tex)
   CoglTexturePixmapX11 *tex_pixmap = COGL_TEXTURE_PIXMAP_X11 (tex);
   CoglTexture *child_tex = _cogl_texture_pixmap_x11_get_texture (tex_pixmap);
 
-  return _cogl_texture_get_gl_format (child_tex);
+  return _cogl_texture_gl_get_format (child_tex);
 }
 
 static int
-- 
1.7.7.6



More information about the Cogl mailing list