From 06c75ea2e7cdbf9631478620bad469548ace6baa Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 15 Jan 2014 16:43:55 +0000 Subject: [PATCH] Tweak documentation for the CoglTexture interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following changes are made to the documentation for CoglTexture: • The description of the default value for the components property is changed to say that it is always RGBA for textures created by the ‘_with_size’ textures. Previously it said that the default is based on the pixel format used the first time data is set on the texture, but this is only true if the data is set using a constructor. • Added documentation for the CoglTextureComponents enum. • Changed it to say that it _specifies_ what components are required for sampling rather than determinging [sic] them. • Added ‘Since: 1.18’ to cogl_texture_{set,get}_{components,premultiplied} • Changed the since tag for CoglTextureError from 2.0 to 1.8. • Added documentation for COGL_TEXTURE_ERROR_{FORMAT,TYPE}. • Added the following to the cogl2-sections.txt file: COGL_TEXTURE_ERROR CoglTextureError cogl_texture_allocate cogl_texture_set_components cogl_texture_get_components cogl_texture_set_premultiplied cogl_texture_get_premultiplied Reviewed-by: Robert Bragg (cherry picked from commit 2f12c4329c519fa14b927b2dcd708dddcc903c32) --- cogl/cogl-texture.h | 45 ++++++++++++++----- .../cogl-2.0-experimental-sections.txt | 10 +++++ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h index 5836920cf..08fa08574 100644 --- a/cogl/cogl-texture.h +++ b/cogl/cogl-texture.h @@ -67,7 +67,7 @@ COGL_BEGIN_DECLS * * #CoglError domain for texture errors. * - * Since: 2.0 + * Since: 1.8 * Stability: Unstable */ #define COGL_TEXTURE_ERROR (cogl_texture_error_quark ()) @@ -76,10 +76,13 @@ COGL_BEGIN_DECLS /** * CoglTextureError: * @COGL_TEXTURE_ERROR_SIZE: Unsupported size + * @COGL_TEXTURE_ERROR_FORMAT: Unsupported format + * @COGL_TEXTURE_ERROR_TYPE: A primitive texture type that is + * unsupported by the driver was used * * Error codes that can be thrown when allocating textures. * - * Since: 2.0 + * Since: 1.8 * Stability: Unstable */ typedef enum { @@ -121,6 +124,17 @@ uint32_t cogl_texture_error_quark (void); CoglBool cogl_is_texture (void *object); +/** + * CoglTextureComponents: + * @COGL_TEXTURE_COMPONENTS_A: Only the alpha component + * @COGL_TEXTURE_COMPONENTS_RGB: Red, green and blue components + * @COGL_TEXTURE_COMPONENTS_RGBA: Red, green, blue and alpha components + * @COGL_TEXTURE_COMPONENTS_DEPTH: Only a depth component + * + * See cogl_texture_set_components(). + * + * Since: 1.18 + */ typedef enum _CoglTextureComponents { COGL_TEXTURE_COMPONENTS_A = 1, @@ -133,15 +147,18 @@ typedef enum _CoglTextureComponents * cogl_texture_set_components: * @texture: a #CoglTexture pointer. * - * Affects the internal storage format for this texture by - * determinging what components will be required for sampling later. + * Affects the internal storage format for this texture by specifying + * what components will be required for sampling later. * * This api affects how data is uploaded to the GPU since unused * components can potentially be discarded from source data. * - * By default the required components are automatically determined - * using the format of the source data that is first uploaded to - * the given @texture. + * For textures created by the ‘_with_size’ constructors the default + * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take + * a %CoglBitmap or a data pointer default to the same components as + * the pixel format of the data. + * + * Since: 1.18 */ void cogl_texture_set_components (CoglTexture *texture, @@ -154,9 +171,12 @@ cogl_texture_set_components (CoglTexture *texture, * Queries what components the given @texture stores internally as set * via cogl_texture_set_components(). * - * By default the required components are automatically determined - * using the format of the source data that is first uploaded to - * the given @texture. + * For textures created by the ‘_with_size’ constructors the default + * is %COGL_TEXTURE_COMPONENTS_RGBA. The other constructors which take + * a %CoglBitmap or a data pointer default to the same components as + * the pixel format of the data. + * + * Since: 1.18 */ CoglTextureComponents cogl_texture_get_components (CoglTexture *texture); @@ -168,7 +188,7 @@ cogl_texture_get_components (CoglTexture *texture); * components are pre-multiplied by an alpha * component. * - * Affects the internal storage format for this texture by determining + * Affects the internal storage format for this texture by specifying * whether red, green and blue color components should be stored as * pre-multiplied alpha values. * @@ -189,6 +209,8 @@ cogl_texture_get_components (CoglTexture *texture); * converted. * * By default the @premultipled state is @TRUE. + * + * Since: 1.18 */ void cogl_texture_set_premultiplied (CoglTexture *texture, @@ -207,6 +229,7 @@ cogl_texture_set_premultiplied (CoglTexture *texture, * Return value: %TRUE if red, green and blue components are * internally stored pre-multiplied by the alpha * value or %FALSE if not. + * Since: 1.18 */ CoglBool cogl_texture_get_premultiplied (CoglTexture *texture); diff --git a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt index a73569908..94a1e6505 100644 --- a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt +++ b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt @@ -400,6 +400,11 @@ CoglTexture cogl_is_texture +COGL_TEXTURE_ERROR +CoglTextureError + + +cogl_texture_allocate cogl_texture_get_width cogl_texture_get_height cogl_texture_is_sliced @@ -407,6 +412,11 @@ cogl_texture_get_data cogl_texture_set_data cogl_texture_set_region CoglTextureType +CoglTextureComponents +cogl_texture_set_components +cogl_texture_get_components +cogl_texture_set_premultiplied +cogl_texture_get_premultiplied COGL_TEXTURE_MAX_WASTE