mutter/clutter/cogl/common
Owen W. Taylor c3448314d5 Default to a blend function that expects premultiplied colors
Many operations, like mixing two textures together or alpha-blending
onto a destination with alpha, are done most logically if texture data
is in premultiplied form. We also have many sources of premultiplied
texture data, like X pixmaps, FBOs, cairo surfaces. Rather than trying
to work with two different types of texture data, simplify things by
always premultiplying texture data before uploading to GL.

Because the default blend function is changed to accommodate this,
uses of pure-color CoglMaterial need to be adapted to add
premultiplication.

gl/cogl-texture.c gles/cogl-texture.c: Always premultiply
  non-premultiplied texture data before uploading to GL.

cogl-material.c cogl-material.h: Switch the default blend functions
  to ONE, ONE_MINUS_SRC_ALPHA so they work correctly with premultiplied
  data.

cogl.c: Make cogl_set_source_color() premultiply the color.

cogl.h.in color-material.h: Add some documentation about
  premultiplication and its interaction with color values.

cogl-pango-render.c clutter-texture.c tests/interactive/test-cogl-offscreen.c:
  Use premultiplied colors.

http://bugzilla.openedhand.com/show_bug.cgi?id=1406

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2009-06-11 14:17:52 +01:00
..
cogl-bitmap-fallback.c Implement premultiplication for CoglBitmap 2009-06-11 14:17:51 +01:00
cogl-bitmap-pixbuf.c Implement premultiplication for CoglBitmap 2009-06-11 14:17:51 +01:00
cogl-bitmap-private.h Implement premultiplication for CoglBitmap 2009-06-11 14:17:51 +01:00
cogl-bitmap.c Implement premultiplication for CoglBitmap 2009-06-11 14:17:51 +01:00
cogl-blend-string.c [build] Fix compiler warnings 2009-06-05 16:46:12 +01:00
cogl-blend-string.h [cogl-material] Support string based blending and layer combine descriptions 2009-05-28 02:43:28 +01:00
cogl-clip-stack.c [cogl-clip-stack] Support pushing rectangles onto the stack using window coords 2009-05-12 15:44:33 +01:00
cogl-clip-stack.h [cogl] Updates all file headers and removes lots of trailing white space 2009-05-02 04:12:25 +01:00
cogl-color.c Add cogl_color_premultiply() 2009-06-11 14:17:51 +01:00
cogl-current-matrix.c Rename 'near' and 'far' variables to 'z_near' and 'z_far' 2009-06-04 11:48:51 +01:00
cogl-current-matrix.h [cogl] Updates all file headers and removes lots of trailing white space 2009-05-02 04:12:25 +01:00
cogl-debug.c [cogl-material] Support string based blending and layer combine descriptions 2009-05-28 02:43:28 +01:00
cogl-enum-types.c.in Use g_once when registering enumeration types 2009-05-29 12:40:23 +01:00
cogl-enum-types.h.in [cogl] Generate enumeration GTypes 2009-05-29 12:31:47 +01:00
cogl-fixed.c [cogl] Updates all file headers and removes lots of trailing white space 2009-05-02 04:12:25 +01:00
cogl-handle.h [material] Reduce the material API in preperation for releasing Clutter 1.0 2009-05-28 02:43:34 +01:00
cogl-internal.h [build] The cogl GE macro wasn't passing an int according to the format string 2009-05-21 15:10:38 +01:00
cogl-material-private.h [cogl] Move the texture filters to be a property of the material layer 2009-06-04 19:03:40 +01:00
cogl-material.c Default to a blend function that expects premultiplied colors 2009-06-11 14:17:52 +01:00
cogl-matrix-stack.c [cogl matrix] Support ortho and perspective projections. 2009-05-28 02:43:35 +01:00
cogl-matrix-stack.h [cogl matrix] Support ortho and perspective projections. 2009-05-28 02:43:35 +01:00
cogl-matrix.c [cogl matrix] Support ortho and perspective projections. 2009-05-28 02:43:35 +01:00
cogl-primitives.c [cogl-primitives] Fix an unused variable warning when building GLES 2009-06-04 22:20:18 +01:00
cogl-primitives.h [cogl] Updates all file headers and removes lots of trailing white space 2009-05-02 04:12:25 +01:00
cogl-util.c [cogl] Generate enumeration GTypes 2009-05-29 12:31:47 +01:00
cogl-util.h [cogl] Updates all file headers and removes lots of trailing white space 2009-05-02 04:12:25 +01:00
cogl-vertex-buffer-private.h Use GL_QUADS for flushing a quad batch 2009-06-01 17:29:01 +01:00
cogl-vertex-buffer.c Fix a compiler warning 2009-06-05 16:39:18 +01:00
cogl.c Default to a blend function that expects premultiplied colors 2009-06-11 14:17:52 +01:00
Makefile.am [build] Fix dist issues 2009-05-29 17:10:27 +01:00
stb_image.c Merged clutter-ivan branch into trunk. 2008-04-25 13:37:36 +00:00