pixel-array: Only allow allocation of arrays with a 2D size
authorRobert Bragg <robert@linux.intel.com>
Sat, 3 Jul 2010 23:49:31 +0000 (00:49 +0100)
committerRobert Bragg <robert@linux.intel.com>
Mon, 5 Jul 2010 14:20:04 +0000 (15:20 +0100)
commit8a5aed36fe8e9cd57c4644653a8e7103ca946bc3
treeec478f8e7155839f479e4b0241ab1fac9be8beb5
parentcfef390d87076454195d6b2288cb7fa9c17acf4b
pixel-array: Only allow allocation of arrays with a 2D size

This removes cogl_pixel_array_new which just took a size in bytes.

Without the image size and pixel format then the driver often doesn't
have enough information to allocate optimal GPU memory that can be
textured from directly. This is because GPUs often have ways to
spatially alter the layout of a texture to improve cache access patterns
which may require special alignment and padding dependant in the images
width, height and bpp.

Although currently we are limited by OpenGL because it doesn't let us
pass on the width and height when allocating a PBO, the hope is that we
can define a better extension at some point.
clutter/cogl/cogl/cogl-pixel-array.c
clutter/cogl/cogl/cogl-pixel-array.h
tests/conform/test-cogl-pixel-buffer.c