cogl-texture-driver-gles: Don't copy the bitmap if alignment matches
authorNeil Roberts <neil@linux.intel.com>
Fri, 17 Dec 2010 16:09:26 +0000 (16:09 +0000)
committerNeil Roberts <neil@linux.intel.com>
Mon, 10 Jan 2011 16:55:00 +0000 (16:55 +0000)
commite1cbef23f5118c748eb38c16ebb00de3f51686b7
tree9c0a405085648fd2078c0a438d5f40e119cf680b
parentb3058c097dfb834018ab3598d002a7be595e78ff
cogl-texture-driver-gles: Don't copy the bitmap if alignment matches

When uploading data for GLES we need to deal with cases where the
rowstride is too large to be described only by GL_UNPACK_ALIGNMENT
because there is no GL_UNPACK_ROW_LENGTH. Previously for the
sub-region uploading code it would always copy the bitmap and for the
code to upload the whole image it would copy the bitmap unless the
rowstride == bpp*width. Neither paths took into account that we don't
need to copy if the rowstride is just an alignment of bpp*width. This
moves the bitmap copying code to a separate function that is used by
both upload methods. It only copies the bitmap if the rowstride is not
just an alignment of bpp*width.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2491
clutter/cogl/cogl/driver/gles/cogl-texture-driver-gles.c