cogl: Make cogl_util_next_p2 internal and fix the documentation
cogl_util_next_p2 is declared in cogl-util.h which is a private header so it shouldn't be possible for an application to use it. It's probably not a function we'd like to export from Cogl so it seems better to keep it private. This patch renames it to _cogl_util_next_p2 so that it won't be exported from the shared library. The documentation for the function is also slightly wrong because it stated that the function returned the next power greater than 'a'. However the code would actually return 'a' if it's already a power of two. I think the actual behaviour is more useful so this patch changes the documentation rather than the code.
This commit is contained in:
parent
42dacf97f8
commit
7338541452
@ -783,8 +783,8 @@ _cogl_texture_2d_sliced_slices_create (CoglTexture2DSliced *tex_2ds,
|
||||
}
|
||||
else
|
||||
{
|
||||
max_width = cogl_util_next_p2 (width);
|
||||
max_height = cogl_util_next_p2 (height);
|
||||
max_width = _cogl_util_next_p2 (width);
|
||||
max_height = _cogl_util_next_p2 (height);
|
||||
tex_2ds->gl_target = GL_TEXTURE_2D;
|
||||
slices_for_size = _cogl_pot_slices_for_size;
|
||||
}
|
||||
|
@ -40,16 +40,17 @@
|
||||
#include "cogl-handle.h"
|
||||
#include "cogl-util.h"
|
||||
|
||||
/**
|
||||
/*
|
||||
* cogl_util_next_p2:
|
||||
* @a: Value to get the next power
|
||||
* @a: Value to get the next power of two
|
||||
*
|
||||
* Calculates the next power greater than @a.
|
||||
* Calculates the next power of two greater than or equal to @a.
|
||||
*
|
||||
* Return value: The next power after @a.
|
||||
* Return value: @a if @a is already a power of two, otherwise returns
|
||||
* the next nearest power of two.
|
||||
*/
|
||||
int
|
||||
cogl_util_next_p2 (int a)
|
||||
_cogl_util_next_p2 (int a)
|
||||
{
|
||||
int rval = 1;
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
cogl_util_next_p2 (int a);
|
||||
_cogl_util_next_p2 (int a);
|
||||
|
||||
/* The signbit macro is defined by ISO C99 so it should be available,
|
||||
however if it's not we can fallback to an evil hack */
|
||||
|
Loading…
Reference in New Issue
Block a user