mesa: Turn get_readpixels_transfer_ops() in to a global function
authorAnuj Phogat <anuj.phogat@gmail.com>
Wed, 20 May 2015 00:44:52 +0000 (17:44 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 24 Jul 2015 17:48:58 +0000 (10:48 -0700)
This utility function is utilized in a later patch.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/main/readpix.c
src/mesa/main/readpix.h

index 32e31ffae2f52ebb30311a615e9dad24e559876c..25a09873fe0f29b08b9e0f8909fd9287c264f32e 100644 (file)
@@ -64,9 +64,11 @@ _mesa_need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format)
 /**
  * Return transfer op flags for this ReadPixels operation.
  */
-static GLbitfield
-get_readpixels_transfer_ops(const struct gl_context *ctx, mesa_format texFormat,
-                            GLenum format, GLenum type, GLboolean uses_blit)
+GLbitfield
+_mesa_get_readpixels_transfer_ops(const struct gl_context *ctx,
+                                  mesa_format texFormat,
+                                  GLenum format, GLenum type,
+                                  GLboolean uses_blit)
 {
    GLbitfield transferOps = ctx->_ImageTransferState;
 
@@ -153,8 +155,8 @@ _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
       }
 
       /* And finally, see if there are any transfer ops. */
-      return get_readpixels_transfer_ops(ctx, rb->Format, format, type,
-                                         uses_blit) != 0;
+      return _mesa_get_readpixels_transfer_ops(ctx, rb->Format, format, type,
+                                               uses_blit) != 0;
    }
    return GL_FALSE;
 }
@@ -420,8 +422,8 @@ read_rgba_pixels( struct gl_context *ctx,
    if (!rb)
       return;
 
-   transferOps = get_readpixels_transfer_ops(ctx, rb->Format, format, type,
-                                             GL_FALSE);
+   transferOps = _mesa_get_readpixels_transfer_ops(ctx, rb->Format, format,
+                                                   type, GL_FALSE);
    /* Describe the dst format */
    dst_is_integer = _mesa_is_enum_format_integer(format);
    dst_stride = _mesa_image_row_stride(packing, width, format, type);
index 1636dd9ce3e7ed917b6155d5eef499253a2dbe84..f8940361fb4de8df2745f7664125bb1ef8d9315b 100644 (file)
@@ -40,6 +40,12 @@ _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
 extern GLboolean
 _mesa_need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format);
 
+extern GLbitfield
+_mesa_get_readpixels_transfer_ops(const struct gl_context *ctx,
+                                  mesa_format texFormat,
+                                  GLenum format, GLenum type,
+                                  GLboolean uses_blit);
+
 extern void
 _mesa_readpixels(struct gl_context *ctx,
                  GLint x, GLint y, GLsizei width, GLsizei height,