Hello, everybody

I have a question related to Clutter image rendering. My program reads
images from SVG file:

#define EMPTY_PATH  (GNOME_PIXMAPSDIR "/empty.svg")

// private section
...
    QuodBoard* m_board;
    ClutterActor* cells[MAX_ROW][MAX_COL];
...

GdkPixbuf* pixbuf[4];           /* Pixbuf for coins images */

pixbuf[EMPTY_CELL] = gdk_pixbuf_new_from_file_at_size(EMPTY_PATH,
coin_width, coin_height, &err);
...

After that, I get stage from ClutterEmbed:
ClutterActor *stage = gtk_clutter_embed_get_stage(GTK_CLUTTER_EMBED(self));

After that I create actors and remember them in private section:
/* Create Actors */
    for (row = 0; row < MAX_ROW; row++)
        for (col = 0; col < MAX_COL; col++)
        {
            cell = quod_board_get_cell(priv->m_board, row, col);
            priv->cells[row][col] =
gtk_clutter_texture_new_from_pixbuf(pixbuf[cell]);          // Initial
space is EMPTY_CELL

            clutter_actor_set_position(priv->cells[row][col],
                                       col * (coin_width +
BOARD_DELTA) + BOARD_DELTA,
                                       row * (coin_height +
BOARD_DELTA) + BOARD_DELTA);

            clutter_container_add_actor(CLUTTER_CONTAINER(stage),
                                        CLUTTER_ACTOR(priv->cells[row][col]));
        }

So I have several questions with my code:
1. When I remember actor's pointer into internal structure, should I
increase the reference of it (g_object_ref_sink), to make my pointer
non-floating? An if I want to delete it, I have to unref it _once_.
2. When I do all the steps above, I've got these results:
http://img253.imageshack.us/img253/3088/39800308.png
     1 - The window got from my code
     2 - The image got from my original code, made with GTKmm, Cairo
and RSVG (RSVG renderes, Cairo draws)
     3 - the border of the source image isn't transparent
     4 - it's color for debugging purposes

As you can see, the images at the first position have some strange
border. I think it is caused by opengl anti-aliasing, or maybe the
pixbuf is renders svg worse than RSVG (2). Near the one (at the right)
there is my large view of the same svg file (it isn't still
transparent);

I thought it might happen due to my rezlooks gtk engine (or possible
light-color theme), so I've changed it:
http://img235.imageshack.us/img235/3341/88164329.png (the order is the
same). It looks like these images are equal (or possibly equal).

Can you help me with this problem, what can you suggest to me? At the
moment, I'm thinking about pixbuf creation with maximum possible size
(for example 400x400 pixels), and then shrink it. But I'm not sure,
will it be a good idea to store such large image in memory, or better
recreate all clutter field when I resize my window?

I really stuck with it :(

Thank you in advance,
Vlad Volodin
-- 
To unsubscribe send a mail to [email protected]

Reply via email to