4 * Copyright (C) 2008 - 2012 The Geeqie Team
7 * Author: Vladimir Nadvornik
9 * This software is released under the GNU General Public License (GNU GPL).
10 * Please read the included file COPYING for more information.
11 * This software comes with no warranty of any kind, use at your own risk!
20 #include "pixbuf-renderer.h"
21 #include "renderer-clutter.h"
31 #define COGL_ENABLE_EXPERIMENTAL_API
33 #include <clutter/clutter.h>
35 #include <clutter-gtk/clutter-gtk.h>
43 #include "pixbuf_util.h"
47 EXIF_ORIENTATION_UNKNOWN = 0,
48 EXIF_ORIENTATION_TOP_LEFT = 1,
49 EXIF_ORIENTATION_TOP_RIGHT = 2,
50 EXIF_ORIENTATION_BOTTOM_RIGHT = 3,
51 EXIF_ORIENTATION_BOTTOM_LEFT = 4,
52 EXIF_ORIENTATION_LEFT_TOP = 5,
53 EXIF_ORIENTATION_RIGHT_TOP = 6,
54 EXIF_ORIENTATION_RIGHT_BOTTOM = 7,
55 EXIF_ORIENTATION_LEFT_BOTTOM = 8
56 } ExifOrientationType;
59 #define GET_RIGHT_PIXBUF_OFFSET(rc) \
60 (( (rc->stereo_mode & PR_STEREO_RIGHT) && !(rc->stereo_mode & PR_STEREO_SWAP)) || \
61 (!(rc->stereo_mode & PR_STEREO_RIGHT) && (rc->stereo_mode & PR_STEREO_SWAP)) ? \
62 rc->pr->stereo_pixbuf_offset_right : rc->pr->stereo_pixbuf_offset_left )
64 #define GET_LEFT_PIXBUF_OFFSET(rc) \
65 ((!(rc->stereo_mode & PR_STEREO_RIGHT) && !(rc->stereo_mode & PR_STEREO_SWAP)) || \
66 ( (rc->stereo_mode & PR_STEREO_RIGHT) && (rc->stereo_mode & PR_STEREO_SWAP)) ? \
67 rc->pr->stereo_pixbuf_offset_right : rc->pr->stereo_pixbuf_offset_left )
70 typedef struct _OverlayData OverlayData;
81 OverlayRendererFlags flags;
84 typedef struct _RendererClutter RendererClutter;
86 struct _RendererClutter
97 GList *pending_updates;
102 GtkWidget *widget; /* widget and stage may be shared with other renderers */
104 ClutterActor *texture;
107 gboolean clut_updated;
110 typedef struct _RendererClutterAreaParam RendererClutterAreaParam;
111 struct _RendererClutterAreaParam {
121 static void rc_set_shader(CoglHandle material)
126 shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
127 cogl_shader_source (shader,
128 "vec3 checker(vec2 texc, vec3 color0, vec3 color1) \n"
130 " if (mod(int(floor(texc.x) + floor(texc.y)), 2) == 0) \n"
136 "uniform sampler2D tex; \n"
137 "uniform sampler3D clut; \n"
138 "uniform float scale; \n"
139 "uniform float offset; \n"
143 " vec3 bg = checker(gl_FragCoord.xy / 16, vec3(0.6, 0.6, 0.6), vec3(0.4, 0.4, 0.4)); \n"
144 " vec4 img4 = texture2D(tex, gl_TexCoord[0].xy); \n"
145 " vec3 img3 = img4.rgb; \n"
146 " img3 = img3 * scale + offset; \n"
147 " img3 = texture3D(clut, img3); \n"
149 " gl_FragColor = vec4(img3 * img4.a + bg * (1.0 - img4.a), 1.0); \n"
152 cogl_shader_compile(shader);
153 gchar *err = cogl_shader_get_info_log(shader);
157 program = cogl_create_program ();
158 cogl_program_attach_shader (program, shader);
159 cogl_handle_unref (shader);
160 cogl_program_link (program);
162 uniform_no = cogl_program_get_uniform_location (program, "tex");
163 cogl_program_set_uniform_1i (program, uniform_no, 0);
165 uniform_no = cogl_program_get_uniform_location (program, "clut");
166 cogl_program_set_uniform_1i (program, uniform_no, 1);
168 uniform_no = cogl_program_get_uniform_location (program, "scale");
169 cogl_program_set_uniform_1f (program, uniform_no, (double) (CLUT_SIZE - 1) / CLUT_SIZE);
171 uniform_no = cogl_program_get_uniform_location (program, "offset");
172 cogl_program_set_uniform_1f (program, uniform_no, 1.0 / (2 * CLUT_SIZE));
174 cogl_material_set_user_program (material, program);
175 cogl_handle_unref (program);
179 static void rc_prepare_post_process_lut(RendererClutter *rc)
181 PixbufRenderer *pr = rc->pr;
182 static guchar clut[CLUT_SIZE * CLUT_SIZE * CLUT_SIZE * 3];
184 GdkPixbuf *tmp_pixbuf;
188 DEBUG_0("%s clut start", get_exec_time());
190 for (r = 0; r < CLUT_SIZE; r++)
192 for (g = 0; g < CLUT_SIZE; g++)
194 for (b = 0; b < CLUT_SIZE; b++)
196 guchar *ptr = clut + ((b * CLUT_SIZE + g) * CLUT_SIZE + r) * 3;
197 ptr[0] = floor ((double) r / (CLUT_SIZE - 1) * 255.0 + 0.5);
198 ptr[1] = floor ((double) g / (CLUT_SIZE - 1) * 255.0 + 0.5);
199 ptr[2] = floor ((double) b / (CLUT_SIZE - 1) * 255.0 + 0.5);
203 tmp_pixbuf = gdk_pixbuf_new_from_data(clut, GDK_COLORSPACE_RGB, FALSE, 8,
204 CLUT_SIZE * CLUT_SIZE,
206 CLUT_SIZE * CLUT_SIZE * 3,
208 if (pr->func_post_process)
210 pr->func_post_process(pr, &tmp_pixbuf, 0, 0, CLUT_SIZE * CLUT_SIZE, CLUT_SIZE, pr->post_process_user_data);
212 g_object_unref(tmp_pixbuf);
214 DEBUG_0("%s clut upload start", get_exec_time());
216 tex3d = cogl_texture_3d_new_from_data(CLUT_SIZE, CLUT_SIZE, CLUT_SIZE,
218 COGL_PIXEL_FORMAT_RGB_888,
219 COGL_PIXEL_FORMAT_RGB_888,
221 CLUT_SIZE * CLUT_SIZE * 3,
224 material = clutter_texture_get_cogl_material(rc->texture);
225 cogl_material_set_layer(material, 1, tex3d);
226 cogl_handle_unref(tex3d);
227 DEBUG_0("%s clut end", get_exec_time());
228 rc->clut_updated = TRUE;
233 static void rc_sync_actor(RendererClutter *rc)
235 PixbufRenderer *pr = rc->pr;
239 clutter_actor_set_anchor_point(CLUTTER_ACTOR(rc->texture), 0, 0);
241 printf("scale %d %d\n", rc->pr->width, rc->pr->height);
242 printf("pos %d %d\n", rc->pr->x_offset, rc->pr->y_offset);
244 clutter_actor_set_scale(CLUTTER_ACTOR(rc->texture),
245 (gfloat)pr->width / pr->image_width,
246 (gfloat)pr->height / pr->image_height);
248 switch (pr->orientation)
250 case EXIF_ORIENTATION_TOP_LEFT:
252 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
255 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
261 case EXIF_ORIENTATION_TOP_RIGHT:
263 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
266 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
269 anchor_x = pr->width;
272 case EXIF_ORIENTATION_BOTTOM_RIGHT:
274 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
277 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
280 anchor_x = pr->width;
281 anchor_y = pr->height;
283 case EXIF_ORIENTATION_BOTTOM_LEFT:
285 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
288 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
292 anchor_y = pr->height;
294 case EXIF_ORIENTATION_LEFT_TOP:
295 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
298 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
304 case EXIF_ORIENTATION_RIGHT_TOP:
305 /* rotated -90 (270) */
306 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
309 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
313 anchor_y = pr->height;
315 case EXIF_ORIENTATION_RIGHT_BOTTOM:
316 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
319 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
322 anchor_x = pr->width;
323 anchor_y = pr->height;
325 case EXIF_ORIENTATION_LEFT_BOTTOM:
327 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
330 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->texture),
333 anchor_x = pr->width;
337 /* The other values are out of range */
341 clutter_actor_set_position(CLUTTER_ACTOR(rc->texture),
342 pr->x_offset - pr->x_scroll + anchor_x,
343 pr->y_offset - pr->y_scroll + anchor_y);
348 static void renderer_area_clip_add(RendererClutter *rc, gfloat x, gfloat y, gfloat w, gfloat h)
350 PixbufRenderer *pr = rc->pr;
352 gfloat clip_x, clip_y, clip_w, clip_h, clip_x2, clip_y2;
357 clutter_actor_get_clip(rc->texture, &clip_x, &clip_y, &clip_w, &clip_h);
359 clip_x2 = clip_x + clip_w;
360 clip_y2 = clip_y + clip_h;
362 if (clip_x > x) clip_x = x;
363 if (clip_x2 < x2) clip_x2 = x2;
364 if (clip_y > y) clip_y = y;
365 if (clip_y2 < y2) clip_y2 = y2;
367 clip_w = clip_x2 - clip_x;
368 clip_h = clip_y2 - clip_y;
370 printf("clip %f %f %f %f\n", clip_x, clip_y, clip_w, clip_h);
371 clutter_actor_set_clip(rc->texture, clip_x, clip_y, clip_w, clip_h);
374 #define MAX_REGION_AREA (32768 * 1024)
376 static gboolean renderer_area_changed_cb(gpointer data)
378 RendererClutter *rc = (RendererClutter *)data;
379 PixbufRenderer *pr = rc->pr;
381 RendererClutterAreaParam *par = rc->pending_updates->data;
383 gint h = MAX_REGION_AREA / par->w;
385 if (h > par->h) h = par->h;
388 printf("renderer_area_changed_cb %d %d %d %d (%d)\n", par->x, par->y, par->w, h, par->h);
389 DEBUG_0("%s upload start", get_exec_time());
392 CoglHandle texture = clutter_texture_get_cogl_texture(CLUTTER_TEXTURE(rc->texture));
394 cogl_texture_set_region(texture,
395 par->x + GET_RIGHT_PIXBUF_OFFSET(rc),
403 gdk_pixbuf_get_has_alpha(pr->pixbuf) ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888,
404 gdk_pixbuf_get_rowstride(pr->pixbuf),
405 gdk_pixbuf_get_pixels(pr->pixbuf));
407 DEBUG_0("%s upload end", get_exec_time());
408 renderer_area_clip_add(rc, par->x, par->y, par->w, h);
416 rc->pending_updates = g_list_remove(rc->pending_updates, par);
419 if (!rc->pending_updates)
421 clutter_actor_queue_redraw(CLUTTER_ACTOR(rc->texture));
424 /* FIXME: find a better place for this */
425 if (!rc->clut_updated) rc_prepare_post_process_lut(rc);
433 static void renderer_area_changed(void *renderer, gint src_x, gint src_y, gint src_w, gint src_h)
435 RendererClutter *rc = (RendererClutter *)renderer;
436 PixbufRenderer *pr = rc->pr;
437 RendererClutterAreaParam *par;
439 gint width = gdk_pixbuf_get_width(pr->pixbuf);
440 gint height = gdk_pixbuf_get_height(pr->pixbuf);
442 if (pr->stereo_data == STEREO_PIXBUF_SBS || pr->stereo_data == STEREO_PIXBUF_CROSS)
447 if (!pr_clip_region(src_x, src_y, src_w, src_h,
448 GET_RIGHT_PIXBUF_OFFSET(rc), 0, width, height,
449 &src_x, &src_y, &src_w, &src_h)) return;
451 par = g_new0(RendererClutterAreaParam, 1);
453 par->x = src_x - GET_RIGHT_PIXBUF_OFFSET(rc);
457 rc->pending_updates = g_list_append(rc->pending_updates, par);
458 if (!rc->idle_update)
460 rc->idle_update = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, renderer_area_changed_cb, rc, NULL);
464 static void renderer_remove_pending_updates(RendererClutter *rc)
466 if (rc->idle_update) g_idle_remove_by_data(rc);
468 while (rc->pending_updates)
470 RendererClutterAreaParam *par = rc->pending_updates->data;
471 rc->pending_updates = g_list_remove(rc->pending_updates, par);
476 static void renderer_update_pixbuf(void *renderer, gboolean lazy)
478 RendererClutter *rc = (RendererClutter *)renderer;
479 PixbufRenderer *pr = rc->pr;
481 renderer_remove_pending_updates(rc);
485 gint width = gdk_pixbuf_get_width(pr->pixbuf);
486 gint height = gdk_pixbuf_get_height(pr->pixbuf);
488 gint prev_width, prev_height;
490 if (pr->stereo_data == STEREO_PIXBUF_SBS || pr->stereo_data == STEREO_PIXBUF_CROSS)
496 printf("renderer_update_pixbuf\n");
497 clutter_texture_get_base_size(CLUTTER_TEXTURE(rc->texture), &prev_width, &prev_height);
498 printf("change from %d %d to %d %d\n", prev_width, prev_height, width, height);
500 if (width != prev_width || height != prev_height)
502 /* FIXME use CoglMaterial with multiple textures for background, color management, anaglyph, ... */
503 CoglHandle texture = cogl_texture_new_with_size(width,
505 COGL_TEXTURE_NO_AUTO_MIPMAP,
506 gdk_pixbuf_get_has_alpha(pr->pixbuf) ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888);
508 if (texture != COGL_INVALID_HANDLE)
510 clutter_texture_set_cogl_texture(CLUTTER_TEXTURE(rc->texture), texture);
511 cogl_handle_unref(texture);
514 clutter_actor_set_clip(rc->texture, 0, 0, 0, 0); /* visible area is extended as area_changed events arrive */
517 renderer_area_changed(renderer, GET_RIGHT_PIXBUF_OFFSET(rc), 0, width, height);
521 rc->clut_updated = FALSE;
522 printf("renderer_update_pixbuf\n");
528 static void renderer_update_zoom(void *renderer, gboolean lazy)
530 RendererClutter *rc = (RendererClutter *)renderer;
531 PixbufRenderer *pr = rc->pr;
533 printf("renderer_update_zoom\n");
537 static void renderer_invalidate_region(void *renderer, gint x, gint y, gint w, gint h)
541 static OverlayData *rc_overlay_find(RendererClutter *rc, gint id)
545 work = rc->overlay_list;
548 OverlayData *od = work->data;
551 if (od->id == id) return od;
557 static void rc_overlay_actor_destroy_cb(ClutterActor *actor, gpointer user_data)
559 OverlayData *od = user_data;
563 static void rc_overlay_free(RendererClutter *rc, OverlayData *od)
565 rc->overlay_list = g_list_remove(rc->overlay_list, od);
567 if (od->pixbuf) g_object_unref(G_OBJECT(od->pixbuf));
568 if (od->actor) clutter_actor_destroy(od->actor);
572 static void rc_overlay_update_position(RendererClutter *rc, OverlayData *od)
576 pw = gdk_pixbuf_get_width(od->pixbuf);
577 ph = gdk_pixbuf_get_height(od->pixbuf);
581 if (od->flags & OVL_RELATIVE)
583 if (px < 0) px = rc->pr->viewport_width - pw + px;
584 if (py < 0) py = rc->pr->viewport_height - ph + py;
586 if (od->actor) clutter_actor_set_position(od->actor, px, py);
589 static void rc_overlay_update_positions(RendererClutter *rc)
593 work = rc->overlay_list;
596 OverlayData *od = work->data;
599 rc_overlay_update_position(rc, od);
603 static void rc_overlay_free_all(RendererClutter *rc)
607 work = rc->overlay_list;
610 OverlayData *od = work->data;
613 rc_overlay_free(rc, od);
618 static void renderer_overlay_draw(void *renderer, gint x, gint y, gint w, gint h)
622 static gint renderer_overlay_add(void *renderer, GdkPixbuf *pixbuf, gint x, gint y, OverlayRendererFlags flags)
624 RendererClutter *rc = (RendererClutter *)renderer;
625 PixbufRenderer *pr = rc->pr;
629 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), -1);
630 g_return_val_if_fail(pixbuf != NULL, -1);
633 while (rc_overlay_find(rc, id)) id++;
635 od = g_new0(OverlayData, 1);
638 g_object_ref(G_OBJECT(od->pixbuf));
643 od->actor = gtk_clutter_texture_new();
644 g_signal_connect (od->actor, "destroy", G_CALLBACK(rc_overlay_actor_destroy_cb), od);
646 gtk_clutter_texture_set_from_pixbuf(GTK_CLUTTER_TEXTURE (od->actor), pixbuf, NULL);
647 clutter_container_add_actor(CLUTTER_CONTAINER(rc->group), od->actor);
649 rc->overlay_list = g_list_append(rc->overlay_list, od);
650 rc_overlay_update_position(rc, od);
655 static void renderer_overlay_set(void *renderer, gint id, GdkPixbuf *pixbuf, gint x, gint y)
657 RendererClutter *rc = (RendererClutter *)renderer;
658 PixbufRenderer *pr = rc->pr;
661 g_return_if_fail(IS_PIXBUF_RENDERER(pr));
663 od = rc_overlay_find(rc, id);
668 g_object_ref(G_OBJECT(pixbuf));
669 g_object_unref(G_OBJECT(od->pixbuf));
675 if (od->actor) gtk_clutter_texture_set_from_pixbuf(GTK_CLUTTER_TEXTURE(od->actor), pixbuf, NULL);
676 rc_overlay_update_position(rc, od);
680 rc_overlay_free(rc, od);
684 static gboolean renderer_overlay_get(void *renderer, gint id, GdkPixbuf **pixbuf, gint *x, gint *y)
686 RendererClutter *rc = (RendererClutter *)renderer;
688 PixbufRenderer *pr = rc->pr;
691 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE);
693 od = rc_overlay_find(rc, id);
694 if (!od) return FALSE;
696 if (pixbuf) *pixbuf = od->pixbuf;
704 static void renderer_update_sizes(void *renderer)
706 RendererClutter *rc = (RendererClutter *)renderer;
707 ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
709 rc->stereo_off_x = 0;
710 rc->stereo_off_y = 0;
712 if (rc->stereo_mode & PR_STEREO_RIGHT)
714 if (rc->stereo_mode & PR_STEREO_HORIZ)
716 rc->stereo_off_x = rc->pr->viewport_width;
718 else if (rc->stereo_mode & PR_STEREO_VERT)
720 rc->stereo_off_y = rc->pr->viewport_height;
722 else if (rc->stereo_mode & PR_STEREO_FIXED)
724 rc->stereo_off_x = rc->pr->stereo_fixed_x_right;
725 rc->stereo_off_y = rc->pr->stereo_fixed_y_right;
730 if (rc->stereo_mode & PR_STEREO_FIXED)
732 rc->stereo_off_x = rc->pr->stereo_fixed_x_left;
733 rc->stereo_off_y = rc->pr->stereo_fixed_y_left;
736 DEBUG_1("update size: %p %d %d %d %d", rc, rc->stereo_off_x, rc->stereo_off_y, rc->pr->viewport_width, rc->pr->viewport_height);
738 printf("renderer_update_sizes scale %d %d\n", rc->pr->width, rc->pr->height);
740 clutter_stage_set_color(CLUTTER_STAGE(rc->stage), &stage_color);
743 clutter_actor_set_size(rc->group, rc->pr->viewport_width, rc->pr->viewport_height);
744 clutter_actor_set_position(rc->group, rc->stereo_off_x, rc->stereo_off_y);
746 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->group),
748 (rc->stereo_mode & PR_STEREO_MIRROR) ? 180 : 0,
749 rc->pr->viewport_width / 2.0, 0, 0);
751 clutter_actor_set_rotation(CLUTTER_ACTOR(rc->group),
753 (rc->stereo_mode & PR_STEREO_FLIP) ? 180 : 0,
754 0, rc->pr->viewport_height / 2.0, 0);
757 rc_overlay_update_positions(rc);
760 static void renderer_scroll(void *renderer, gint x_off, gint y_off)
762 printf("renderer_scroll\n");
763 RendererClutter *rc = (RendererClutter *)renderer;
764 PixbufRenderer *pr = rc->pr;
769 static void renderer_stereo_set(void *renderer, gint stereo_mode)
771 RendererClutter *rc = (RendererClutter *)renderer;
773 rc->stereo_mode = stereo_mode;
776 static void renderer_free(void *renderer)
778 RendererClutter *rc = (RendererClutter *)renderer;
779 GtkWidget *widget = gtk_bin_get_child(GTK_BIN(rc->pr));
781 renderer_remove_pending_updates(rc);
783 rc_overlay_free_all(rc);
787 /* widget still exists */
788 clutter_actor_destroy(rc->group);
789 if (clutter_group_get_n_children(CLUTTER_GROUP(rc->stage)) == 0)
791 printf("destroy %p\n", rc->widget);
792 /* this was the last user */
793 gtk_widget_destroy(rc->widget);
797 printf("keep %p\n", rc->widget);
798 g_object_unref(G_OBJECT(rc->widget));
804 RendererFuncs *renderer_clutter_new(PixbufRenderer *pr)
806 RendererClutter *rc = g_new0(RendererClutter, 1);
810 rc->f.area_changed = renderer_area_changed;
811 rc->f.update_pixbuf = renderer_update_pixbuf;
812 rc->f.free = renderer_free;
813 rc->f.update_zoom = renderer_update_zoom;
814 rc->f.invalidate_region = renderer_invalidate_region;
815 rc->f.scroll = renderer_scroll;
816 rc->f.update_sizes = renderer_update_sizes;
819 rc->f.overlay_add = renderer_overlay_add;
820 rc->f.overlay_set = renderer_overlay_set;
821 rc->f.overlay_get = renderer_overlay_get;
822 rc->f.overlay_draw = renderer_overlay_draw;
824 rc->f.stereo_set = renderer_stereo_set;
828 rc->stereo_off_x = 0;
829 rc->stereo_off_y = 0;
832 rc->pending_updates = NULL;
834 rc->widget = gtk_bin_get_child(GTK_BIN(rc->pr));
838 if (!GTK_CLUTTER_IS_EMBED(rc->widget))
841 DEBUG_0("pixbuf renderer has a child of other type than gtk_clutter_embed");
847 rc->widget = gtk_clutter_embed_new();
848 gtk_container_add(GTK_CONTAINER(rc->pr), rc->widget);
851 gtk_event_box_set_above_child (GTK_EVENT_BOX(rc->pr), TRUE);
852 rc->stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (rc->widget));
854 rc->group = clutter_group_new();
855 clutter_container_add_actor(CLUTTER_CONTAINER(rc->stage), rc->group);
856 clutter_actor_set_clip_to_allocation(CLUTTER_ACTOR(rc->group), TRUE);
858 rc->texture = clutter_texture_new ();
859 clutter_container_add_actor(CLUTTER_CONTAINER(rc->group), rc->texture);
860 rc_set_shader(clutter_texture_get_cogl_material(rc->texture));
861 g_object_ref(G_OBJECT(rc->widget));
863 gtk_widget_show(rc->widget);
864 return (RendererFuncs *) rc;
868 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */