mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
cogl: Remove cogl_material_set_blend
This function is deprecated and must be replaced to the alternative. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2058>
This commit is contained in:
parent
f90f8f84c3
commit
afdbb71926
@ -64,13 +64,3 @@ cogl_material_set_color4ub (CoglMaterial *material,
|
|||||||
cogl_pipeline_set_color4ub (COGL_PIPELINE (material),
|
cogl_pipeline_set_color4ub (COGL_PIPELINE (material),
|
||||||
red, green, blue, alpha);
|
red, green, blue, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
cogl_material_set_blend (CoglMaterial *material,
|
|
||||||
const char *blend_string,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
return cogl_pipeline_set_blend (COGL_PIPELINE (material),
|
|
||||||
blend_string,
|
|
||||||
error);
|
|
||||||
}
|
|
||||||
|
@ -218,97 +218,6 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
|
|||||||
CoglMaterialAlphaFunc alpha_func,
|
CoglMaterialAlphaFunc alpha_func,
|
||||||
float alpha_reference);
|
float alpha_reference);
|
||||||
|
|
||||||
/**
|
|
||||||
* cogl_material_set_blend:
|
|
||||||
* @material: A #CoglMaterial object
|
|
||||||
* @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
|
|
||||||
* describing the desired blend function.
|
|
||||||
* @error: return location for a #GError that may report lack of driver
|
|
||||||
* support if you give separate blend string statements for the alpha
|
|
||||||
* channel and RGB channels since some drivers, or backends such as
|
|
||||||
* GLES 1.1, don't support this feature. May be %NULL, in which case a
|
|
||||||
* warning will be printed out using GLib's logging facilities if an
|
|
||||||
* error is encountered.
|
|
||||||
*
|
|
||||||
* If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link>
|
|
||||||
* for an overview of what blend strings are, and their syntax.
|
|
||||||
*
|
|
||||||
* Blending occurs after the alpha test function, and combines fragments with
|
|
||||||
* the framebuffer.
|
|
||||||
|
|
||||||
* Currently the only blend function Cogl exposes is ADD(). So any valid
|
|
||||||
* blend statements will be of the form:
|
|
||||||
*
|
|
||||||
* |[
|
|
||||||
* <channel-mask>=ADD(SRC_COLOR*(<factor>), DST_COLOR*(<factor>))
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* <warning>The brackets around blend factors are currently not
|
|
||||||
* optional!</warning>
|
|
||||||
*
|
|
||||||
* This is the list of source-names usable as blend factors:
|
|
||||||
* <itemizedlist>
|
|
||||||
* <listitem><para>SRC_COLOR: The color of the incoming fragment</para></listitem>
|
|
||||||
* <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
|
|
||||||
* <listitem><para>CONSTANT: The constant set via cogl_material_set_blend_constant()</para></listitem>
|
|
||||||
* </itemizedlist>
|
|
||||||
*
|
|
||||||
* The source names can be used according to the
|
|
||||||
* <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
|
|
||||||
* so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
|
|
||||||
* "(CONSTANT[RGB])"
|
|
||||||
*
|
|
||||||
* These can also be used as factors:
|
|
||||||
* <itemizedlist>
|
|
||||||
* <listitem>0: (0, 0, 0, 0)</listitem>
|
|
||||||
* <listitem>1: (1, 1, 1, 1)</listitem>
|
|
||||||
* <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
|
|
||||||
* </itemizedlist>
|
|
||||||
*
|
|
||||||
* <note>Remember; all color components are normalized to the range [0, 1]
|
|
||||||
* before computing the result of blending.</note>
|
|
||||||
*
|
|
||||||
* <example id="cogl-Blend-Strings-blend-unpremul">
|
|
||||||
* <title>Blend Strings/1</title>
|
|
||||||
* <para>Blend a non-premultiplied source over a destination with
|
|
||||||
* premultiplied alpha:</para>
|
|
||||||
* <programlisting>
|
|
||||||
* "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
|
|
||||||
* "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
|
|
||||||
* </programlisting>
|
|
||||||
* </example>
|
|
||||||
*
|
|
||||||
* <example id="cogl-Blend-Strings-blend-premul">
|
|
||||||
* <title>Blend Strings/2</title>
|
|
||||||
* <para>Blend a premultiplied source over a destination with
|
|
||||||
* premultiplied alpha</para>
|
|
||||||
* <programlisting>
|
|
||||||
* "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
|
|
||||||
* </programlisting>
|
|
||||||
* </example>
|
|
||||||
*
|
|
||||||
* The default blend string is:
|
|
||||||
* |[
|
|
||||||
* RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* That gives normal alpha-blending when the calculated color for the material
|
|
||||||
* is in premultiplied form.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the blend string was successfully parsed, and the
|
|
||||||
* described blending is supported by the underlying driver/hardware. If
|
|
||||||
* there was an error, %FALSE is returned and @error is set accordingly (if
|
|
||||||
* present).
|
|
||||||
*
|
|
||||||
* Since: 1.0
|
|
||||||
* Deprecated: 1.16: Use cogl_pipeline_set_blend() instead
|
|
||||||
*/
|
|
||||||
COGL_DEPRECATED_FOR (cogl_pipeline_set_blend)
|
|
||||||
COGL_EXPORT gboolean
|
|
||||||
cogl_material_set_blend (CoglMaterial *material,
|
|
||||||
const char *blend_string,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __COGL_MATERIAL_H__ */
|
#endif /* __COGL_MATERIAL_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user