cogl: Use separate materials for set_source_color and texture
authorNeil Roberts <neil@linux.intel.com>
Wed, 27 Oct 2010 14:07:03 +0000 (15:07 +0100)
committerNeil Roberts <neil@linux.intel.com>
Wed, 27 Oct 2010 14:07:03 +0000 (15:07 +0100)
commit65d7a113eeb0de08ccb402fe4ade14fe82fcaff1
tree34d58bf8cbdfd13ba396e521a04d52bcf57ba5aa
parent89cedc78009cee86ffe025cd7c2343d69b199928
cogl: Use separate materials for set_source_color and texture

Previously cogl_set_source_color and cogl_set_source_texture modified
a single global material. If an application then mixes using
cogl_set_source_color and texture then the material will constantly
need a new ARBfp program because the numbers of layers alternates
between 0 and 1. This patch just adds a second global material that is
only used for cogl_set_source_texture. I think it would still end up
flushing the journal if cogl_set_source_texture is used with multiple
different textures but at least it should avoid a recompile unless the
texture target also changes. It might be nice to somehow attach a
material to the CoglTexture for use with cogl_set_source_texture but
it would be difficult to implement this without creating a circular
reference.
clutter/cogl/cogl/cogl-context.c
clutter/cogl/cogl/cogl-context.h
clutter/cogl/cogl/cogl.c