}
static gboolean
-_cogl_texture_2d_is_pot (unsigned int num)
-{
- /* Make sure there is only one bit set */
- return (num & (num - 1)) == 0;
-}
-
-static gboolean
_cogl_texture_2d_can_create (unsigned int width,
unsigned int height,
CoglPixelFormat internal_format)
/* If NPOT textures aren't supported then the size must be a power
of two */
if (!cogl_features_available (COGL_FEATURE_TEXTURE_NPOT) &&
- (!_cogl_texture_2d_is_pot (width) ||
- !_cogl_texture_2d_is_pot (height)))
+ (!_cogl_util_is_pot (width) ||
+ !_cogl_util_is_pot (height)))
return FALSE;
_cogl_pixel_format_to_gl (internal_format,
negative numbers. */
#define COGL_UTIL_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f))
+/* Returns whether the given integer is a power of two */
+static inline gboolean
+_cogl_util_is_pot (unsigned int num)
+{
+ /* Make sure there is only one bit set */
+ return (num & (num - 1)) == 0;
+}
+
#endif /* __COGL_UTIL_H */