diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-09-07 23:44:37 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-09-19 16:35:59 +0100 |
commit | 9b58b6f4729b7d359a5b01f47bb2f7647c977d98 (patch) | |
tree | 731a174ec86dffcd77b595ac7419986909335cae /cogl/cogl-pipeline-private.h | |
parent | c7969a33af44f043fadc418ca4ede1d3c1b1444f (diff) | |
download | cogl-9b58b6f4729b7d359a5b01f47bb2f7647c977d98.tar.gz |
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>
Diffstat (limited to 'cogl/cogl-pipeline-private.h')
-rw-r--r-- | cogl/cogl-pipeline-private.h | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h index 6e8fc359..628ba355 100644 --- a/cogl/cogl-pipeline-private.h +++ b/cogl/cogl-pipeline-private.h @@ -610,6 +610,21 @@ typedef struct CoglPipelineLayer *layer; } CoglPipelineLayerCacheEntry; +/* Sometimes when evaluating pipelines, either during comparisons or + * if calculating a hash value we need to tweak the evaluation + * semantics */ +typedef enum _CoglPipelineEvalFlags +{ + COGL_PIPELINE_EVAL_FLAG_NONE = 0 +} CoglPipelineEvalFlags; + +typedef struct _CoglPipelineHashState +{ + unsigned long layer_differences; + CoglPipelineEvalFlags flags; + unsigned int hash; +} CoglPipelineHashState; + /* * CoglPipelineDestroyCallback * @pipeline: The #CoglPipeline that has been destroyed @@ -842,6 +857,27 @@ _cogl_pipeline_get_authority (CoglPipeline *pipeline, return authority; } +typedef gboolean (*CoglPipelineStateComparitor) (CoglPipeline *authority0, + CoglPipeline *authority1); + +void +_cogl_pipeline_update_authority (CoglPipeline *pipeline, + CoglPipeline *authority, + CoglPipelineState state, + CoglPipelineStateComparitor comparitor); + +void +_cogl_pipeline_pre_change_notify (CoglPipeline *pipeline, + CoglPipelineState change, + const CoglColor *new_color, + gboolean from_layer_change); + +void +_cogl_pipeline_prune_redundant_ancestry (CoglPipeline *pipeline); + +void _cogl_pipeline_update_blend_enable (CoglPipeline *pipeline, + CoglPipelineState changes); + /* * SECTION:cogl-pipeline-internals * @short_description: Functions for creating custom primitives that make use @@ -1069,14 +1105,6 @@ unsigned long _cogl_pipeline_compare_differences (CoglPipeline *pipeline0, CoglPipeline *pipeline1); -/* Sometimes when evaluating pipelines, either during comparisons or - * if calculating a hash value we need to tweak the evaluation - * semantics */ -typedef enum _CoglPipelineEvalFlags -{ - COGL_PIPELINE_EVAL_FLAG_NONE = 0 -} CoglPipelineEvalFlags; - gboolean _cogl_pipeline_equal (CoglPipeline *pipeline0, CoglPipeline *pipeline1, |