clutter-shader-effect: Add a get_static_shader_source virtual
This is used as an alternative to calling clutter_shader_effect_set_shader_source. A ClutterShaderEffect subclass is now expected to implement this method to return the source for the effect that will be used for all instances of this subclass. It is only called once regardless of the number of instances created. That way Clutter can avoid recompiling the shader source for every new instance of the effect. https://bugzilla.gnome.org/show_bug.cgi?id=660512 Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
@ -62,6 +62,11 @@ struct _ClutterShaderEffect
|
||||
|
||||
/**
|
||||
* ClutterShaderEffectClass:
|
||||
* @get_static_shader_source: Returns the GLSL source code to use for
|
||||
* instances of this shader effect. Note that this function is only
|
||||
* called once per subclass of #ClutterShaderEffect regardless of how
|
||||
* many instances are used. It is expected that subclasses will return
|
||||
* a copy of a static string from this function.
|
||||
*
|
||||
* The <structname>ClutterShaderEffectClass</structname> structure contains
|
||||
* only private data
|
||||
@ -73,13 +78,16 @@ struct _ClutterShaderEffectClass
|
||||
/*< private >*/
|
||||
ClutterOffscreenEffectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
gchar * (* get_static_shader_source) (ClutterShaderEffect *effect);
|
||||
|
||||
/*< private >*/
|
||||
/* padding */
|
||||
void (*_clutter_shader1) (void);
|
||||
void (*_clutter_shader2) (void);
|
||||
void (*_clutter_shader3) (void);
|
||||
void (*_clutter_shader4) (void);
|
||||
void (*_clutter_shader5) (void);
|
||||
void (*_clutter_shader6) (void);
|
||||
};
|
||||
|
||||
GType clutter_shader_effect_get_type (void) G_GNUC_CONST;
|
||||
|
Reference in New Issue
Block a user