Commit Graph

2 Commits

Author SHA1 Message Date
Neil Roberts
dbff3a357e Make backface culling be part of the legacy state
This adds an internal function to set the backface culling state on a
pipeline. This includes properties to set the culling mode (front,
back or both) and also to set which face is considered the front
(COGL_WINDING_CLOCKWISE or COGL_WINDING_COUNTER_CLOCKWISE). The actual
front face flushed to GL depends on whether we are rendering to an
offscreen buffer or not. This means that when changing between on- and
off- screen framebuffers it now checks whether the last flushed
pipeline has backface culling enabled and forces a reflush of the cull
face state if so.

The backface culling is now set on a pipeline as part of the legacy
state. This is important because some code in Cogl assumes it can
flush a temporary pipeline to revert to a known state, but previously
this wouldn't disable backface culling so things such as flushing the
clip stack could get confused.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-19 16:40:07 +01:00
Robert Bragg
9b58b6f472 pipeline: split out all core state apis
Since cogl-pipeline.c has become very unwieldy this make a start at
trying to shape this code back into a manageable state. This patche
moves all the API relating to core pipeline state into
cogl-pipeline-state.c. This doesn't move code relating to layer state
out nor does it move any of the code supporting the core design
of CoglPipeline itself.

This change alone factors out 2k lines of code from cogl-pipeline.c
which is obviously a good start. The next step will be to factor
out the layer state and then probably look at breaking all of this
state code down into state-groups.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-19 16:35:59 +01:00