diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-10-08 14:13:03 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-11-01 12:03:01 +0000 |
commit | 1d8fd64e1cd74a44cb60689bd5ee2c8c8f518b20 (patch) | |
tree | 37dd4f394f2411a9e35f9a3f7e0b7533d1056a8b /cogl/cogl-texture-private.h | |
parent | c11036cd13140eede00d2b7d79547ffe7b9676e1 (diff) | |
download | cogl-1d8fd64e1cd74a44cb60689bd5ee2c8c8f518b20.tar.gz |
meta-texture: This publicly exposes CoglMetaTexture
CoglMetaTexture is an interface for dealing with high level textures
that may be comprised of one or more low-level textures internally. The
interface allows the development of primitive drawing APIs that can draw
with high-level textures (such as atlas textures) even though the
GPU doesn't natively understand these texture types.
There is currently just one function that's part of this interface:
cogl_meta_texture_foreach_in_region() which allows an application to
resolve the internal, low-level textures of a high-level texture.
cogl_rectangle() uses this API for example so that it can easily emulate
the _REPEAT wrap mode for textures that the hardware can't natively
handle repeating of.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture-private.h')
-rw-r--r-- | cogl/cogl-texture-private.h | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 0ca0a45b..1ca05610 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -27,17 +27,10 @@ #include "cogl-bitmap-private.h" #include "cogl-handle.h" #include "cogl-pipeline-private.h" +#include "cogl-spans.h" typedef struct _CoglTextureVtable CoglTextureVtable; -typedef void (*CoglTextureSliceCallback) (CoglTexture *texture, - const float *slice_coords, - const float *virtual_coords, - void *user_data); - -typedef void (* CoglTextureManualRepeatCallback) (const float *coords, - void *user_data); - /* Encodes three possibiloities result of transforming a quad */ typedef enum { /* quad doesn't cross the boundaries of a texture */ @@ -92,7 +85,7 @@ struct _CoglTextureVtable float virtual_ty_1, float virtual_tx_2, float virtual_ty_2, - CoglTextureSliceCallback callback, + CoglMetaTextureCallback callback, void *user_data); int (* get_max_waste) (CoglTexture *tex); @@ -189,15 +182,6 @@ _cogl_texture_register_texture_type (GQuark type); _cogl_texture_register_texture_type (_cogl_handle_ \ ## type_name ## _get_type ())) -void -_cogl_texture_foreach_sub_texture_in_region (CoglTexture *texture, - float virtual_tx_1, - float virtual_ty_1, - float virtual_tx_2, - float virtual_ty_2, - CoglTextureSliceCallback callback, - void *user_data); - gboolean _cogl_texture_can_hardware_repeat (CoglTexture *texture); @@ -256,17 +240,6 @@ _cogl_texture_prep_gl_alignment_for_pixels_upload (int pixels_rowstride); void _cogl_texture_prep_gl_alignment_for_pixels_download (int pixels_rowstride); -/* Utility function for implementing manual repeating. Even texture - backends that always support hardware repeating need this because - when foreach_sub_texture_in_region is invoked Cogl will set the - wrap mode to GL_CLAMP_TO_EDGE so hardware repeating can't be - done */ -void -_cogl_texture_iterate_manual_repeats (CoglTextureManualRepeatCallback callback, - float tx_1, float ty_1, - float tx_2, float ty_2, - void *user_data); - /* Utility function to use as a fallback for getting the data of any texture via the framebuffer */ @@ -289,4 +262,18 @@ _cogl_texture_get_associated_framebuffers (CoglTexture *texture); void _cogl_texture_flush_journal_rendering (CoglTexture *texture); +void +_cogl_texture_spans_foreach_in_region (CoglSpan *x_spans, + int n_x_spans, + CoglSpan *y_spans, + int n_y_spans, + CoglTexture **textures, + float *virtual_coords, + float x_normalize_factor, + float y_normalize_factor, + CoglPipelineWrapMode wrap_x, + CoglPipelineWrapMode wrap_y, + CoglMetaTextureCallback callback, + void *user_data); + #endif /* __COGL_TEXTURE_PRIVATE_H */ |