[bitmap] Fixes _cogl_bitmap_fallback_unpremult
authorRobert Bragg <robert@linux.intel.com>
Sun, 7 Jun 2009 14:58:56 +0000 (15:58 +0100)
committerRobert Bragg <robert@linux.intel.com>
Thu, 11 Jun 2009 13:17:52 +0000 (14:17 +0100)
commit9d3aa576045ce0aea51ef767b74596bb4582570f
tree6f463ade29ab04e4d7781f472d65fe2df8f0011e
parentcb959ef457a670a5e827963d4a85f6c732993295
[bitmap] Fixes _cogl_bitmap_fallback_unpremult

The _cogl_unpremult_alpha_{first,last} functions which
_cogl_bitmap_fallback_unpremult depends on were incorrectly casting each
of the byte components of a texel to a gulong and performing shifts as
if it were dealing with the whole texel.

It now just uses array indexing to access the byte components without
needing to cast or manually shift any bits around.

Even though we used to depend on unpremult whenever we used a
ClutterCairoTexture, clutter_cairo_texture_context_destroy had it's own
unpremult code which worked which is why this bug wouldn't have been noticed
before.
clutter/cogl/common/cogl-bitmap-fallback.c