cogl-pixel-buffer: Add a fallback path
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 2 Feb 2010 12:59:51 +0000 (12:59 +0000)
committerDamien Lespiau <damien.lespiau@intel.com>
Mon, 8 Feb 2010 17:14:49 +0000 (17:14 +0000)
commitd0fe4795368ddc55411fb081832bfcdfdfeb4314
treec8cfb61d164e0ea004604ade3bd0acfaca82b6b7
parentb5d5821304e8ca15ee4411bf7ff8f26a6a23c855
cogl-pixel-buffer: Add a fallback path

First, let's add a new public feature called, surprisingly,
COGL_FEATURE_PBOS to check the availability of PBOs and provide a
fallback path when running on older GL implementations or on OpenGL ES

In case the underlying OpenGL implementation does not provide PBOs, we
need a fallback path (a malloc'ed buffer). The CoglPixelBufer
constructors will instanciate a subclass of CoglBuffer that handles
map/unmap and set_data() with a malloc'ed buffer.

The public feature is useful to check before using set_data() on a
buffer as it will mean doing a memcpy() when not supporting PBOs (in
that case, it's better to create the texture directly instead of using a
CoglBuffer).
clutter/cogl/cogl/cogl-pixel-buffer.c
clutter/cogl/cogl/cogl-texture.c
clutter/cogl/cogl/cogl-types.h
clutter/cogl/cogl/driver/gl/cogl-feature-functions.h