CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
if (outline == NULL)
- outline = cogl_pipeline_new ();
+ {
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
+ outline = cogl_pipeline_new (ctx);
+ }
_clutter_paint_volume_complete (pv);
#include "config.h"
#endif
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
#include "clutter-blur-effect.h"
#include "cogl/cogl.h"
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
CoglSnippet *snippet;
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
- klass->base_pipeline = cogl_pipeline_new ();
+ klass->base_pipeline = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_TEXTURE_LOOKUP,
box_blur_glsl_declarations,
#include "config.h"
#endif
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
#include "clutter-colorize-effect.h"
#include "cogl/cogl.h"
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
CoglSnippet *snippet;
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
- klass->base_pipeline = cogl_pipeline_new ();
+ klass->base_pipeline = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
colorize_glsl_declarations,
struct _ClutterDeformEffectPrivate
{
- CoglHandle back_material;
+ CoglPipeline *back_pipeline;
gint x_tiles;
gint y_tiles;
cogl_pipeline_set_depth_state (pipeline, &depth_state, NULL);
/* enable backface culling if we have a back material */
- if (priv->back_material != COGL_INVALID_HANDLE)
+ if (priv->back_pipeline != NULL)
cogl_pipeline_set_cull_face_mode (pipeline,
COGL_PIPELINE_CULL_FACE_MODE_BACK);
/* draw the front */
- if (material != COGL_INVALID_HANDLE)
+ if (material != NULL)
cogl_framebuffer_draw_primitive (fb, pipeline, priv->primitive);
/* draw the back */
- if (priv->back_material != COGL_INVALID_HANDLE)
+ if (priv->back_pipeline != NULL)
{
CoglPipeline *back_pipeline;
/* We probably shouldn't be modifying the user's material so
instead we make a temporary copy */
- back_pipeline = cogl_pipeline_copy (priv->back_material);
+ back_pipeline = cogl_pipeline_copy (priv->back_pipeline);
cogl_pipeline_set_depth_state (back_pipeline, &depth_state, NULL);
cogl_pipeline_set_cull_face_mode (pipeline,
COGL_PIPELINE_CULL_FACE_MODE_FRONT);
if (G_UNLIKELY (priv->lines_primitive != NULL))
{
- CoglPipeline *lines_pipeline = cogl_pipeline_new ();
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
+ CoglPipeline *lines_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4f (lines_pipeline, 1.0, 0, 0, 1.0);
cogl_framebuffer_draw_primitive (fb, lines_pipeline,
priv->lines_primitive);
}
static inline void
-clutter_deform_effect_free_back_material (ClutterDeformEffect *self)
+clutter_deform_effect_free_back_pipeline (ClutterDeformEffect *self)
{
ClutterDeformEffectPrivate *priv = self->priv;
- if (priv->back_material != NULL)
+ if (priv->back_pipeline != NULL)
{
- cogl_handle_unref (priv->back_material);
- priv->back_material = COGL_INVALID_HANDLE;
+ cogl_object_unref (priv->back_pipeline);
+ priv->back_pipeline = NULL;
}
}
ClutterDeformEffect *self = CLUTTER_DEFORM_EFFECT (gobject);
clutter_deform_effect_free_arrays (self);
- clutter_deform_effect_free_back_material (self);
+ clutter_deform_effect_free_back_pipeline (self);
G_OBJECT_CLASS (clutter_deform_effect_parent_class)->finalize (gobject);
}
break;
case PROP_BACK_MATERIAL:
- g_value_set_boxed (value, priv->back_material);
+ g_value_set_boxed (value, priv->back_pipeline);
break;
default:
ClutterDeformEffectPrivate);
self->priv->x_tiles = self->priv->y_tiles = DEFAULT_N_TILES;
- self->priv->back_material = COGL_INVALID_HANDLE;
+ self->priv->back_pipeline = NULL;
clutter_deform_effect_init_arrays (self);
}
CoglHandle material)
{
ClutterDeformEffectPrivate *priv;
+ CoglPipeline *pipeline = COGL_PIPELINE (material);
g_return_if_fail (CLUTTER_IS_DEFORM_EFFECT (effect));
- g_return_if_fail (material == COGL_INVALID_HANDLE || cogl_is_material (material));
+ g_return_if_fail (pipeline == NULL || cogl_is_pipeline (pipeline));
priv = effect->priv;
- clutter_deform_effect_free_back_material (effect);
+ clutter_deform_effect_free_back_pipeline (effect);
- priv->back_material = material;
- if (priv->back_material != COGL_INVALID_HANDLE)
- cogl_handle_ref (priv->back_material);
+ priv->back_pipeline = material;
+ if (priv->back_pipeline != NULL)
+ cogl_object_ref (priv->back_pipeline);
clutter_deform_effect_invalidate (effect);
}
{
g_return_val_if_fail (CLUTTER_IS_DEFORM_EFFECT (effect), NULL);
- return effect->priv->back_material;
+ return effect->priv->back_pipeline;
}
/**
#include "config.h"
#endif
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
#include <math.h>
#include "clutter-desaturate-effect.h"
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
CoglSnippet *snippet;
- klass->base_pipeline = cogl_pipeline_new ();
+ klass->base_pipeline = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
desaturate_glsl_declarations,
#include "config.h"
#endif
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
#include "clutter-offscreen-effect.h"
#include "cogl/cogl.h"
struct _ClutterOffscreenEffectPrivate
{
CoglHandle offscreen;
- CoglMaterial *target;
+ CoglPipeline *target;
CoglHandle texture;
ClutterActor *actor;
priv->offscreen != COGL_INVALID_HANDLE)
return TRUE;
- if (priv->target == COGL_INVALID_HANDLE)
+ if (priv->target == NULL)
{
- priv->target = cogl_material_new ();
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
+
+ priv->target = cogl_pipeline_new (ctx);
/* We're always going to render the texture at a 1:1 texel:pixel
ratio so we can use 'nearest' filtering to decrease the
effects of rounding errors in the geometry calculation */
- cogl_material_set_layer_filters (priv->target,
+ cogl_pipeline_set_layer_filters (priv->target,
0, /* layer_index */
- COGL_MATERIAL_FILTER_NEAREST,
- COGL_MATERIAL_FILTER_NEAREST);
+ COGL_PIPELINE_FILTER_NEAREST,
+ COGL_PIPELINE_FILTER_NEAREST);
}
if (priv->texture != COGL_INVALID_HANDLE)
if (priv->texture == COGL_INVALID_HANDLE)
return FALSE;
- cogl_material_set_layer (priv->target, 0, priv->texture);
+ cogl_pipeline_set_layer_texture (priv->target, 0, priv->texture);
priv->fbo_width = fbo_width;
priv->fbo_height = fbo_height;
g_warning ("%s: Unable to create an Offscreen buffer", G_STRLOC);
cogl_handle_unref (priv->target);
- priv->target = COGL_INVALID_HANDLE;
+ priv->target = NULL;
priv->fbo_width = 0;
priv->fbo_height = 0;
paint_opacity = clutter_actor_get_paint_opacity (priv->actor);
- cogl_material_set_color4ub (priv->target,
+ cogl_pipeline_set_color4ub (priv->target,
paint_opacity,
paint_opacity,
paint_opacity,
ClutterOffscreenEffectPrivate *priv = self->priv;
if (priv->offscreen == COGL_INVALID_HANDLE ||
- priv->target == COGL_INVALID_HANDLE ||
+ priv->target == NULL ||
priv->actor == NULL)
return;
clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect)
{
g_return_val_if_fail (CLUTTER_IS_OFFSCREEN_EFFECT (effect),
- COGL_INVALID_HANDLE);
+ NULL);
- return effect->priv->target;
+ return (CoglMaterial *)effect->priv->target;
}
/**
#include "config.h"
#endif
+#define CLUTTER_ENABLE_EXPERIMENTAL_API
+
#include "clutter-config.h"
#include "clutter-stage-cogl.h"
if (may_use_clipped_redraw &&
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
{
- static CoglMaterial *outline = NULL;
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
+ static CoglPipeline *outline = NULL;
cairo_rectangle_int_t *clip = &stage_cogl->bounding_redraw_clip;
ClutterActor *actor = CLUTTER_ACTOR (wrapper);
CoglHandle vbo;
if (outline == NULL)
{
- outline = cogl_material_new ();
- cogl_material_set_color4ub (outline, 0xff, 0x00, 0x00, 0xff);
+ outline = cogl_pipeline_new (ctx);
+ cogl_pipeline_set_color4ub (outline, 0xff, 0x00, 0x00, 0xff);
}
vbo = cogl_vertex_buffer_new (4);
if (G_UNLIKELY (priv->pipeline == NULL))
{
+ CoglContext *ctx =
+ clutter_backend_get_cogl_context (clutter_get_default_backend ());
guint8 paint_opacity = clutter_actor_get_paint_opacity (self);
- priv->pipeline = cogl_pipeline_new ();
+ priv->pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (priv->pipeline,
paint_opacity,
paint_opacity,