diff --git a/cogl/cogl-clip-stack.h b/cogl/cogl-clip-stack.h index f89a9c34d..674405dd3 100644 --- a/cogl/cogl-clip-stack.h +++ b/cogl/cogl-clip-stack.h @@ -92,12 +92,12 @@ typedef enum struct _CoglClipStack { - CoglClipStackType type; - /* This will be null if there is no parent. If it is not null then this node must be holding a reference to the parent */ CoglClipStack *parent; + CoglClipStackType type; + /* All clip entries have a window-space bounding box which we can use to calculate a scissor. The scissor limits the clip so that we don't need to do a full stencil clear if the stencil buffer is @@ -121,6 +121,9 @@ struct _CoglClipStackRect float x1; float y1; + /* The matrix that was current when the clip was set */ + CoglMatrixEntry *matrix_entry; + /* If this is true then the clip for this rectangle is entirely described by the scissor bounds. This implies that the rectangle is screen aligned and we don't need to use the stencil buffer to @@ -130,9 +133,6 @@ struct _CoglClipStackRect journal. In that case we can use the original clip coordinates and modify the rectangle instead. */ CoglBool can_be_scissor; - - /* The matrix that was current when the clip was set */ - CoglMatrixEntry *matrix_entry; }; struct _CoglClipStackWindowRect diff --git a/cogl/cogl-journal-private.h b/cogl/cogl-journal-private.h index f5190f655..6f839d383 100644 --- a/cogl/cogl-journal-private.h +++ b/cogl/cogl-journal-private.h @@ -66,11 +66,11 @@ typedef struct _CoglJournal typedef struct _CoglJournalEntry { CoglPipeline *pipeline; - int n_layers; CoglMatrixEntry *modelview_entry; CoglClipStack *clip_stack; /* Offset into ctx->logged_vertices */ size_t array_offset; + int n_layers; } CoglJournalEntry; CoglJournal * diff --git a/cogl/cogl-matrix-stack-private.h b/cogl/cogl-matrix-stack-private.h index 5d0e911bc..33a32d1c6 100644 --- a/cogl/cogl-matrix-stack-private.h +++ b/cogl/cogl-matrix-stack-private.h @@ -130,8 +130,8 @@ typedef struct _CoglMatrixEntrySave { CoglMatrixEntry _parent_data; - CoglBool cache_valid; CoglMatrix *cache; + CoglBool cache_valid; } CoglMatrixEntrySave; diff --git a/cogl/cogl-pipeline-layer-private.h b/cogl/cogl-pipeline-layer-private.h index 7b047507e..125b96785 100644 --- a/cogl/cogl-pipeline-layer-private.h +++ b/cogl/cogl-pipeline-layer-private.h @@ -179,10 +179,10 @@ typedef struct /* The texture matrix dscribes how to transform texture coordinates */ CoglMatrix matrix; - CoglBool point_sprite_coords; - CoglPipelineSnippetList vertex_snippets; CoglPipelineSnippetList fragment_snippets; + + CoglBool point_sprite_coords; } CoglPipelineLayerBigState; struct _CoglPipelineLayer @@ -218,7 +218,7 @@ struct _CoglPipelineLayer /* A mask of which state groups are different in this layer * in comparison to its parent. */ - unsigned long differences; + unsigned int differences; /* Common differences * @@ -231,14 +231,14 @@ struct _CoglPipelineLayer /* Each layer is directly associated with a single texture unit */ int unit_index; - /* The texture for this layer, or NULL for an empty - * layer */ - CoglTexture *texture; /* The type of the texture. This is always set even if the texture is NULL and it will be used to determine what type of texture lookups to use in any shaders generated by the pipeline backends. */ CoglTextureType texture_type; + /* The texture for this layer, or NULL for an empty + * layer */ + CoglTexture *texture; const CoglSamplerCacheEntry *sampler_cache_entry; diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h index 0682e744a..56700b5ba 100644 --- a/cogl/cogl-pipeline-private.h +++ b/cogl/cogl-pipeline-private.h @@ -382,11 +382,6 @@ struct _CoglPipeline * type to track the tree heirachy so we can share code... */ CoglNode _parent; - /* We need to track if a pipeline is referenced in the journal - * because we can't allow modification to these pipelines without - * flushing the journal first */ - unsigned long journal_ref_count; - /* When weak pipelines are destroyed the user is notified via this * callback */ CoglPipelineDestroyCallback destroy_callback; @@ -395,28 +390,33 @@ struct _CoglPipeline * private data is passed to the above callback */ void *destroy_data; + /* We need to track if a pipeline is referenced in the journal + * because we can't allow modification to these pipelines without + * flushing the journal first */ + unsigned int journal_ref_count; + /* A mask of which sparse state groups are different in this * pipeline in comparison to its parent. */ - unsigned long differences; + unsigned int differences; /* Whenever a pipeline is modified we increment the age. There's no * guarantee that it won't wrap but it can nevertheless be a * convenient mechanism to determine when a pipeline has been * changed to you can invalidate some some associated cache that * depends on the old state. */ - unsigned long age; + unsigned int age; /* This is the primary color of the pipeline. * * This is a sparse property, ref COGL_PIPELINE_STATE_COLOR */ - CoglColor color; + CoglColor color; /* A pipeline may be made up with multiple layers used to combine * textures together. * * This is sparse state, ref COGL_PIPELINE_STATE_LAYERS */ - GList *layer_differences; unsigned int n_layers; + GList *layer_differences; /* As a basic way to reduce memory usage we divide the pipeline * state into two groups; the minimal state modified in 90% of diff --git a/cogl/cogl-primitive-private.h b/cogl/cogl-primitive-private.h index c3fd99184..9d03a6bf6 100644 --- a/cogl/cogl-primitive-private.h +++ b/cogl/cogl-primitive-private.h @@ -36,10 +36,10 @@ struct _CoglPrimitive { CoglObject _parent; + CoglIndices *indices; CoglVerticesMode mode; int first_vertex; int n_vertices; - CoglIndices *indices; int immutable_ref;