Adapt to exposed CoglSnippetHook
It was exposed few cycles back, so get rid of the duplicated type. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3519>
This commit is contained in:
parent
e091cccec8
commit
fd8d923a34
@ -1,4 +1,5 @@
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import GObject from 'gi://GObject';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
@ -52,7 +53,7 @@ const RadialShaderEffect = GObject.registerClass({
|
||||
}
|
||||
|
||||
vfunc_build_pipeline() {
|
||||
this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT,
|
||||
this.add_glsl_snippet(Cogl.SnippetHook.FRAGMENT,
|
||||
VIGNETTE_DECLARATIONS, VIGNETTE_CODE, true);
|
||||
}
|
||||
|
||||
|
@ -2993,7 +2993,7 @@ const RecolorEffect = GObject.registerClass({
|
||||
cogl_color_out.rgb = \n
|
||||
mix(recolor_color, cogl_color_out.rgb, blend); \n`;
|
||||
|
||||
this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT, decl, src, false);
|
||||
this.add_glsl_snippet(Cogl.SnippetHook.FRAGMENT, decl, src, false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -50,7 +50,7 @@ shell_glsl_effect_create_pipeline (ClutterOffscreenEffect *effect,
|
||||
*/
|
||||
void
|
||||
shell_glsl_effect_add_glsl_snippet (ShellGLSLEffect *effect,
|
||||
ShellSnippetHook hook,
|
||||
CoglSnippetHook hook,
|
||||
const char *declarations,
|
||||
const char *code,
|
||||
gboolean is_replace)
|
||||
@ -62,16 +62,16 @@ shell_glsl_effect_add_glsl_snippet (ShellGLSLEffect *effect,
|
||||
|
||||
if (is_replace)
|
||||
{
|
||||
snippet = cogl_snippet_new ((CoglSnippetHook)hook, declarations, NULL);
|
||||
snippet = cogl_snippet_new (hook, declarations, NULL);
|
||||
cogl_snippet_set_replace (snippet, code);
|
||||
}
|
||||
else
|
||||
{
|
||||
snippet = cogl_snippet_new ((CoglSnippetHook)hook, declarations, code);
|
||||
snippet = cogl_snippet_new (hook, declarations, code);
|
||||
}
|
||||
|
||||
if (hook == SHELL_SNIPPET_HOOK_VERTEX ||
|
||||
hook == SHELL_SNIPPET_HOOK_FRAGMENT)
|
||||
if (hook == COGL_SNIPPET_HOOK_VERTEX ||
|
||||
hook == COGL_SNIPPET_HOOK_FRAGMENT)
|
||||
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
|
||||
else
|
||||
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
|
||||
|
@ -3,27 +3,6 @@
|
||||
|
||||
#include "st.h"
|
||||
|
||||
/**
|
||||
* ShellSnippetHook:
|
||||
* Temporary hack to work around Cogl not exporting CoglSnippetHook in
|
||||
* the 1.0 API. Don't use.
|
||||
*/
|
||||
typedef enum {
|
||||
/* Per pipeline vertex hooks */
|
||||
SHELL_SNIPPET_HOOK_VERTEX = 0,
|
||||
SHELL_SNIPPET_HOOK_VERTEX_TRANSFORM,
|
||||
|
||||
/* Per pipeline fragment hooks */
|
||||
SHELL_SNIPPET_HOOK_FRAGMENT = 2048,
|
||||
|
||||
/* Per layer vertex hooks */
|
||||
SHELL_SNIPPET_HOOK_TEXTURE_COORD_TRANSFORM = 4096,
|
||||
|
||||
/* Per layer fragment hooks */
|
||||
SHELL_SNIPPET_HOOK_LAYER_FRAGMENT = 6144,
|
||||
SHELL_SNIPPET_HOOK_TEXTURE_LOOKUP
|
||||
} ShellSnippetHook;
|
||||
|
||||
#define SHELL_TYPE_GLSL_EFFECT (shell_glsl_effect_get_type ())
|
||||
G_DECLARE_DERIVABLE_TYPE (ShellGLSLEffect, shell_glsl_effect,
|
||||
SHELL, GLSL_EFFECT, ClutterOffscreenEffect)
|
||||
@ -38,7 +17,7 @@ struct _ShellGLSLEffectClass
|
||||
};
|
||||
|
||||
void shell_glsl_effect_add_glsl_snippet (ShellGLSLEffect *effect,
|
||||
ShellSnippetHook hook,
|
||||
CoglSnippetHook hook,
|
||||
const char *declarations,
|
||||
const char *code,
|
||||
gboolean is_replace);
|
||||
|
Loading…
x
Reference in New Issue
Block a user