cogl: remove WrapModeOverrides from FlushOptions

This removes the possibility to specify wrap mode overrides within a
CoglPipelineFlushOptions struct since the right way to handle these
overrides is by copying the user's material and making the changes to
that copy before flushing. All primitives code has already switched away
from using these wrap mode overrides so this patch just removes unused
code and types. It also remove the wrap_mode_overrides argument for
_cogl_journal_log_quad.
This commit is contained in:
Robert Bragg 2010-11-11 15:08:38 +00:00
parent b8c9ee7e88
commit fb564cc2ca
5 changed files with 1 additions and 97 deletions

View File

@ -47,8 +47,6 @@ _cogl_journal_log_quad (const float *position,
int n_layers, int n_layers,
guint32 fallback_layers, guint32 fallback_layers,
CoglHandle layer0_override_texture, CoglHandle layer0_override_texture,
const CoglPipelineWrapModeOverrides *
wrap_mode_overrides,
const float *tex_coords, const float *tex_coords,
unsigned int tex_coords_len); unsigned int tex_coords_len);

View File

@ -772,8 +772,6 @@ _cogl_journal_log_quad (const float *position,
int n_layers, int n_layers,
guint32 fallback_layers, guint32 fallback_layers,
CoglHandle layer0_override_texture, CoglHandle layer0_override_texture,
const CoglPipelineWrapModeOverrides *
wrap_mode_overrides,
const float *tex_coords, const float *tex_coords,
unsigned int tex_coords_len) unsigned int tex_coords_len)
{ {
@ -933,11 +931,6 @@ _cogl_journal_log_quad (const float *position,
flush_options.flags |= COGL_PIPELINE_FLUSH_LAYER0_OVERRIDE; flush_options.flags |= COGL_PIPELINE_FLUSH_LAYER0_OVERRIDE;
flush_options.layer0_override_texture = layer0_override_texture; flush_options.layer0_override_texture = layer0_override_texture;
} }
if (wrap_mode_overrides)
{
flush_options.flags |= COGL_PIPELINE_FLUSH_WRAP_MODE_OVERRIDES;
flush_options.wrap_mode_overrides = *wrap_mode_overrides;
}
if (G_UNLIKELY (flush_options.flags)) if (G_UNLIKELY (flush_options.flags))
{ {

View File

@ -635,17 +635,13 @@ _cogl_pipeline_pre_paint_for_layer (CoglPipeline *pipeline,
* not passing the option at all. * not passing the option at all.
* @COGL_PIPELINE_FLUSH_SKIP_GL_COLOR: When flushing the GL state for the * @COGL_PIPELINE_FLUSH_SKIP_GL_COLOR: When flushing the GL state for the
* pipeline don't call glColor. * pipeline don't call glColor.
* @COGL_PIPELINE_FLUSH_WRAP_MODE_OVERRIDES: Specifies that a bitmask
* of overrides for the wrap modes for some or all layers is
* given.
*/ */
typedef enum _CoglPipelineFlushFlag typedef enum _CoglPipelineFlushFlag
{ {
COGL_PIPELINE_FLUSH_FALLBACK_MASK = 1L<<0, COGL_PIPELINE_FLUSH_FALLBACK_MASK = 1L<<0,
COGL_PIPELINE_FLUSH_DISABLE_MASK = 1L<<1, COGL_PIPELINE_FLUSH_DISABLE_MASK = 1L<<1,
COGL_PIPELINE_FLUSH_LAYER0_OVERRIDE = 1L<<2, COGL_PIPELINE_FLUSH_LAYER0_OVERRIDE = 1L<<2,
COGL_PIPELINE_FLUSH_SKIP_GL_COLOR = 1L<<3, COGL_PIPELINE_FLUSH_SKIP_GL_COLOR = 1L<<3
COGL_PIPELINE_FLUSH_WRAP_MODE_OVERRIDES = 1L<<4
} CoglPipelineFlushFlag; } CoglPipelineFlushFlag;
/* This isn't defined in the GLES headers */ /* This isn't defined in the GLES headers */
@ -667,31 +663,6 @@ typedef enum _CoglPipelineWrapModeInternal
COGL_PIPELINE_WRAP_MODE_INTERNAL_AUTOMATIC = GL_ALWAYS COGL_PIPELINE_WRAP_MODE_INTERNAL_AUTOMATIC = GL_ALWAYS
} CoglPipelineWrapModeInternal; } CoglPipelineWrapModeInternal;
typedef enum _CoglPipelineWrapModeOverride
{
COGL_PIPELINE_WRAP_MODE_OVERRIDE_NONE = 0,
COGL_PIPELINE_WRAP_MODE_OVERRIDE_REPEAT =
COGL_PIPELINE_WRAP_MODE_INTERNAL_REPEAT,
COGL_PIPELINE_WRAP_MODE_OVERRIDE_CLAMP_TO_EDGE =
COGL_PIPELINE_WRAP_MODE_INTERNAL_CLAMP_TO_EDGE,
COGL_PIPELINE_WRAP_MODE_OVERRIDE_CLAMP_TO_BORDER =
COGL_PIPELINE_WRAP_MODE_INTERNAL_CLAMP_TO_BORDER,
} CoglPipelineWrapModeOverride;
/* There can't be more than 32 layers because we need to fit a bitmask
of the layers into a guint32 */
#define COGL_PIPELINE_MAX_LAYERS 32
typedef struct _CoglPipelineWrapModeOverrides
{
struct
{
CoglPipelineWrapModeOverride s;
CoglPipelineWrapModeOverride t;
CoglPipelineWrapModeOverride p;
} values[COGL_PIPELINE_MAX_LAYERS];
} CoglPipelineWrapModeOverrides;
/* /*
* CoglPipelineFlushOptions: * CoglPipelineFlushOptions:
* *
@ -703,7 +674,6 @@ typedef struct _CoglPipelineFlushOptions
guint32 fallback_layers; guint32 fallback_layers;
guint32 disable_layers; guint32 disable_layers;
CoglHandle layer0_override_texture; CoglHandle layer0_override_texture;
CoglPipelineWrapModeOverrides wrap_mode_overrides;
} CoglPipelineFlushOptions; } CoglPipelineFlushOptions;

View File

@ -2640,49 +2640,6 @@ cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
return authority->big_state->point_sprite_coords; return authority->big_state->point_sprite_coords;
} }
typedef struct
{
CoglPipeline *pipeline;
CoglPipelineWrapModeOverrides *wrap_mode_overrides;
int i;
} CoglPipelineWrapModeOverridesState;
static gboolean
apply_wrap_mode_overrides_cb (CoglPipelineLayer *layer,
void *user_data)
{
CoglPipelineWrapModeOverridesState *state = user_data;
CoglPipelineLayer *authority =
_cogl_pipeline_layer_get_authority (layer,
COGL_PIPELINE_LAYER_STATE_WRAP_MODES);
CoglPipelineWrapModeInternal wrap_mode_s;
CoglPipelineWrapModeInternal wrap_mode_t;
CoglPipelineWrapModeInternal wrap_mode_p;
g_return_val_if_fail (state->i < 32, FALSE);
wrap_mode_s = state->wrap_mode_overrides->values[state->i].s;
if (wrap_mode_s == COGL_PIPELINE_WRAP_MODE_OVERRIDE_NONE)
wrap_mode_s = (CoglPipelineWrapModeInternal)authority->wrap_mode_s;
wrap_mode_t = state->wrap_mode_overrides->values[state->i].t;
if (wrap_mode_t == COGL_PIPELINE_WRAP_MODE_OVERRIDE_NONE)
wrap_mode_t = (CoglPipelineWrapModeInternal)authority->wrap_mode_t;
wrap_mode_p = state->wrap_mode_overrides->values[state->i].p;
if (wrap_mode_p == COGL_PIPELINE_WRAP_MODE_OVERRIDE_NONE)
wrap_mode_p = (CoglPipelineWrapModeInternal)authority->wrap_mode_p;
_cogl_pipeline_set_layer_wrap_modes (state->pipeline,
layer,
authority,
wrap_mode_s,
wrap_mode_t,
wrap_mode_p);
state->i++;
return TRUE;
}
typedef struct typedef struct
{ {
CoglPipeline *pipeline; CoglPipeline *pipeline;
@ -2754,18 +2711,6 @@ _cogl_pipeline_apply_overrides (CoglPipeline *pipeline,
override_layer_texture_cb, override_layer_texture_cb,
&state); &state);
} }
if (options->flags & COGL_PIPELINE_FLUSH_WRAP_MODE_OVERRIDES)
{
CoglPipelineWrapModeOverridesState state;
state.pipeline = pipeline;
state.wrap_mode_overrides = &options->wrap_mode_overrides;
state.i = 0;
_cogl_pipeline_foreach_layer_internal (pipeline,
apply_wrap_mode_overrides_cb,
&state);
}
} }
static gboolean static gboolean

View File

@ -125,7 +125,6 @@ log_quad_sub_textures_cb (CoglHandle texture_handle,
1, /* one layer */ 1, /* one layer */
0, /* don't need to use fallbacks */ 0, /* don't need to use fallbacks */
texture_override, /* replace the layer0 texture */ texture_override, /* replace the layer0 texture */
NULL, /* we never use wrap mode overrides */
subtexture_coords, subtexture_coords,
4); 4);
} }
@ -547,7 +546,6 @@ _cogl_multitexture_quad_single_primitive (const float *position,
n_layers, n_layers,
0, /* we don't need fallback layers */ 0, /* we don't need fallback layers */
COGL_INVALID_HANDLE, /* no texture override */ COGL_INVALID_HANDLE, /* no texture override */
NULL, /* we never use wrap mode overrides */
final_tex_coords, final_tex_coords,
n_layers * 4); n_layers * 4);