clutter: Remove duplicated ShaderType
As we have the exact same one in Cogl. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
This commit is contained in:
parent
1ba28bc6b4
commit
d92bb351da
@ -235,19 +235,6 @@ typedef enum
|
|||||||
CLUTTER_TEXT_DIRECTION_RTL
|
CLUTTER_TEXT_DIRECTION_RTL
|
||||||
} ClutterTextDirection;
|
} ClutterTextDirection;
|
||||||
|
|
||||||
/**
|
|
||||||
* ClutterShaderType:
|
|
||||||
* @CLUTTER_VERTEX_SHADER: a vertex shader
|
|
||||||
* @CLUTTER_FRAGMENT_SHADER: a fragment shader
|
|
||||||
*
|
|
||||||
* The type of GLSL shader program
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CLUTTER_VERTEX_SHADER,
|
|
||||||
CLUTTER_FRAGMENT_SHADER
|
|
||||||
} ClutterShaderType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterModifierType:
|
* ClutterModifierType:
|
||||||
* @CLUTTER_SHIFT_MASK: Mask applied by the Shift key
|
* @CLUTTER_SHIFT_MASK: Mask applied by the Shift key
|
||||||
|
@ -135,7 +135,7 @@ typedef struct _ClutterShaderEffectPrivate
|
|||||||
{
|
{
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
|
|
||||||
ClutterShaderType shader_type;
|
CoglShaderType shader_type;
|
||||||
|
|
||||||
CoglProgram *program;
|
CoglProgram *program;
|
||||||
CoglShader *shader;
|
CoglShader *shader;
|
||||||
@ -302,20 +302,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
|
|||||||
ClutterShaderEffectPrivate *priv =
|
ClutterShaderEffectPrivate *priv =
|
||||||
clutter_shader_effect_get_instance_private (self);
|
clutter_shader_effect_get_instance_private (self);
|
||||||
|
|
||||||
switch (priv->shader_type)
|
return cogl_shader_new (priv->shader_type);
|
||||||
{
|
|
||||||
case CLUTTER_FRAGMENT_SHADER:
|
|
||||||
return cogl_shader_new (COGL_SHADER_TYPE_FRAGMENT);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CLUTTER_VERTEX_SHADER:
|
|
||||||
return cogl_shader_new (COGL_SHADER_TYPE_VERTEX);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -451,8 +438,8 @@ clutter_shader_effect_class_init (ClutterShaderEffectClass *klass)
|
|||||||
*/
|
*/
|
||||||
obj_props[PROP_SHADER_TYPE] =
|
obj_props[PROP_SHADER_TYPE] =
|
||||||
g_param_spec_enum ("shader-type", NULL, NULL,
|
g_param_spec_enum ("shader-type", NULL, NULL,
|
||||||
CLUTTER_TYPE_SHADER_TYPE,
|
COGL_TYPE_SHADER_TYPE,
|
||||||
CLUTTER_FRAGMENT_SHADER,
|
COGL_SHADER_TYPE_FRAGMENT,
|
||||||
G_PARAM_WRITABLE |
|
G_PARAM_WRITABLE |
|
||||||
G_PARAM_STATIC_STRINGS |
|
G_PARAM_STATIC_STRINGS |
|
||||||
G_PARAM_CONSTRUCT_ONLY);
|
G_PARAM_CONSTRUCT_ONLY);
|
||||||
@ -474,13 +461,12 @@ clutter_shader_effect_init (ClutterShaderEffect *effect)
|
|||||||
ClutterShaderEffectPrivate *priv =
|
ClutterShaderEffectPrivate *priv =
|
||||||
clutter_shader_effect_get_instance_private (effect);
|
clutter_shader_effect_get_instance_private (effect);
|
||||||
|
|
||||||
priv->shader_type = CLUTTER_FRAGMENT_SHADER;
|
priv->shader_type = COGL_SHADER_TYPE_FRAGMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_shader_effect_new:
|
* clutter_shader_effect_new:
|
||||||
* @shader_type: the type of the shader, either %CLUTTER_FRAGMENT_SHADER,
|
* @shader_type: the type of the shader
|
||||||
* or %CLUTTER_VERTEX_SHADER
|
|
||||||
*
|
*
|
||||||
* Creates a new #ClutterShaderEffect, to be applied to an actor using
|
* Creates a new #ClutterShaderEffect, to be applied to an actor using
|
||||||
* [method@Actor.add_effect].
|
* [method@Actor.add_effect].
|
||||||
@ -492,7 +478,7 @@ clutter_shader_effect_init (ClutterShaderEffect *effect)
|
|||||||
* Use g_object_unref() when done.
|
* Use g_object_unref() when done.
|
||||||
*/
|
*/
|
||||||
ClutterEffect *
|
ClutterEffect *
|
||||||
clutter_shader_effect_new (ClutterShaderType shader_type)
|
clutter_shader_effect_new (CoglShaderType shader_type)
|
||||||
{
|
{
|
||||||
return g_object_new (CLUTTER_TYPE_SHADER_EFFECT,
|
return g_object_new (CLUTTER_TYPE_SHADER_EFFECT,
|
||||||
"shader-type", shader_type,
|
"shader-type", shader_type,
|
||||||
|
@ -62,7 +62,7 @@ struct _ClutterShaderEffectClass
|
|||||||
};
|
};
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterEffect * clutter_shader_effect_new (ClutterShaderType shader_type);
|
ClutterEffect * clutter_shader_effect_new (CoglShaderType shader_type);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
gboolean clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
gboolean clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
|
||||||
|
@ -311,6 +311,19 @@ typedef enum /*< prefix=COGL_READ_PIXELS >*/
|
|||||||
COGL_READ_PIXELS_COLOR_BUFFER = 1L << 0
|
COGL_READ_PIXELS_COLOR_BUFFER = 1L << 0
|
||||||
} CoglReadPixelsFlags;
|
} CoglReadPixelsFlags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CoglShaderType:
|
||||||
|
* @COGL_SHADER_TYPE_VERTEX: A program for processing vertices
|
||||||
|
* @COGL_SHADER_TYPE_FRAGMENT: A program for processing fragments
|
||||||
|
*
|
||||||
|
* Types of shaders
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
COGL_SHADER_TYPE_VERTEX,
|
||||||
|
COGL_SHADER_TYPE_FRAGMENT
|
||||||
|
} CoglShaderType;
|
||||||
|
|
||||||
typedef struct _CoglAttribute CoglAttribute;
|
typedef struct _CoglAttribute CoglAttribute;
|
||||||
typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
|
typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
|
||||||
typedef struct _CoglAtlas CoglAtlas;
|
typedef struct _CoglAtlas CoglAtlas;
|
||||||
|
@ -131,19 +131,6 @@ G_DECLARE_FINAL_TYPE (CoglShader,
|
|||||||
SHADER,
|
SHADER,
|
||||||
GObject)
|
GObject)
|
||||||
|
|
||||||
/**
|
|
||||||
* CoglShaderType:
|
|
||||||
* @COGL_SHADER_TYPE_VERTEX: A program for processing vertices
|
|
||||||
* @COGL_SHADER_TYPE_FRAGMENT: A program for processing fragments
|
|
||||||
*
|
|
||||||
* Types of shaders
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
COGL_SHADER_TYPE_VERTEX,
|
|
||||||
COGL_SHADER_TYPE_FRAGMENT
|
|
||||||
} CoglShaderType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_shader_new:
|
* cogl_shader_new:
|
||||||
* @shader_type: COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT.
|
* @shader_type: COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT.
|
||||||
|
@ -54,7 +54,6 @@ cogl_headers = [
|
|||||||
'cogl-texture-2d-sliced.h',
|
'cogl-texture-2d-sliced.h',
|
||||||
'cogl-texture.h',
|
'cogl-texture.h',
|
||||||
'cogl-trace.h',
|
'cogl-trace.h',
|
||||||
'cogl-types.h',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
cogl_nonintrospected_headers = [
|
cogl_nonintrospected_headers = [
|
||||||
@ -331,6 +330,7 @@ endif
|
|||||||
cogl_enum_headers = [
|
cogl_enum_headers = [
|
||||||
'cogl-buffer.h',
|
'cogl-buffer.h',
|
||||||
'cogl-pixel-format.h',
|
'cogl-pixel-format.h',
|
||||||
|
'cogl-types.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
cogl_headers += [
|
cogl_headers += [
|
||||||
|
@ -204,7 +204,7 @@ test_bind_constraint_main (int argc, char *argv[])
|
|||||||
* properties; so we use the ActorMeta:enabled property to toggle
|
* properties; so we use the ActorMeta:enabled property to toggle
|
||||||
* the shader
|
* the shader
|
||||||
*/
|
*/
|
||||||
effect = clutter_shader_effect_new (CLUTTER_FRAGMENT_SHADER);
|
effect = clutter_shader_effect_new (COGL_SHADER_TYPE_FRAGMENT);
|
||||||
clutter_shader_effect_set_shader_source (CLUTTER_SHADER_EFFECT (effect),
|
clutter_shader_effect_set_shader_source (CLUTTER_SHADER_EFFECT (effect),
|
||||||
desaturare_glsl_shader);
|
desaturare_glsl_shader);
|
||||||
clutter_shader_effect_set_uniform (CLUTTER_SHADER_EFFECT (effect),
|
clutter_shader_effect_set_uniform (CLUTTER_SHADER_EFFECT (effect),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user