summaryrefslogtreecommitdiff
path: root/cogl/cogl-texture.h
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-02-25 20:04:45 +0000
committerNeil Roberts <neil@linux.intel.com>2012-03-05 18:47:45 +0000
commit3700cc26a58cbf6ba255506b85acc9d93348a1fb (patch)
tree097b019dea15874d8b556a337cd7a6f24587eec8 /cogl/cogl-texture.h
parent10a38bb14fac3ba8dc05115feb04bde56dc590e7 (diff)
downloadcogl-3700cc26a58cbf6ba255506b85acc9d93348a1fb.tar.gz
Change API so that CoglPixelBuffer no longer knows its w/h/format
The idea is that CoglPixelBuffer should just be a buffer that can be used for pixel data and it has no idea about the details of any images that are stored in it. This is analogous to CoglAttributeBuffer which itself does not have any information about the attributes. When you want to use a pixel buffer you should create a CoglBitmap which points to a region of the attribute buffer and provides the extra needed information such as the width, height and format. That way it is also possible to use a single CoglPixelBuffer with multiple bitmaps. The changes that are made are: • cogl_pixel_buffer_new_with_size has been removed and in its place is cogl_bitmap_new_with_size. This will create a pixel buffer at the right size and rowstride for the given width/height/format and immediately create a single CoglBitmap to point into it. The old function had an out-parameter for the stride of the image but with the new API this should be queriable from the bitmap (although there is no function for this yet). • There is now a public cogl_pixel_buffer_new constructor. This takes a size in bytes and data pointer similarly to cogl_attribute_buffer_new. • cogl_texture_new_from_buffer has been removed. If you want to create a texture from a pixel buffer you should wrap it up in a bitmap first. There is already API to create a texture from a bitmap. This patch also does a bit of header juggling because cogl-context.h was including cogl-texture.h and cogl-framebuffer.h which were causing some circular dependencies when cogl-bitmap.h includes cogl-context.h. These weren't actually needed in cogl-context.h itself but a few other headers were relying on them being included so this adds the #includes where necessary. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture.h')
-rw-r--r--cogl/cogl-texture.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 5bbd06af..f7468e91 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -491,49 +491,6 @@ cogl_texture_new_from_sub_texture (CoglTexture *full_texture,
int sub_width,
int sub_height);
-#if defined (COGL_ENABLE_EXPERIMENTAL_API)
-
-#define cogl_texture_new_from_buffer cogl_texture_new_from_buffer_EXP
-/**
- * cogl_texture_new_from_buffer:
- * @buffer: A #CoglPixelBuffer pointer
- * @width: width of texture in pixels or 0
- * @height: height of texture in pixels or 0
- * @flags: optional flags for the texture, or %COGL_TEXTURE_NONE
- * @format: the #CoglPixelFormat the buffer is stored in in RAM
- * @internal_format: the #CoglPixelFormat that will be used for storing
- * the buffer on the GPU. If %COGL_PIXEL_FORMAT_ANY is given then a
- * premultiplied format similar to the format of the source data will
- * be used. The default blending equations of Cogl expect premultiplied
- * color data; the main use of passing a non-premultiplied format here
- * is if you have non-premultiplied source data and are going to adjust
- * the blend mode (see cogl_material_set_blend()) or use the data for
- * something other than straight blending
- * @rowstride: the memory offset in bytes between the starts of
- * scanlines in @data. If 0 is given the row stride will be deduced from
- * @width and @format or the stride given by cogl_pixel_buffer_new_for_size()
- * @offset: offset in bytes in @buffer from where the texture data starts
- *
- * Creates a new texture using the buffer specified by @handle. If the buffer
- * has been created using cogl_pixel_buffer_new_for_size() it's possible to omit
- * the height and width values already specified at creation time.
- *
- * Return value: A newly created #CoglTexture or %NULL on failure
- *
- * Since: 1.2
- * Stability: Unstable
- */
-CoglTexture *
-cogl_texture_new_from_buffer (CoglPixelBuffer *buffer,
- unsigned int width,
- unsigned int height,
- CoglTextureFlags flags,
- CoglPixelFormat format,
- CoglPixelFormat internal_format,
- unsigned int rowstride,
- unsigned int offset);
-#endif
-
#ifndef COGL_DISABLE_DEPRECATED
/**