[Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=16431 >
This made the terrain look right with the "nv" driver, so the image
probably gets corrupted somewhere in the outcommented part.
struct sprite *load_gfxfile(const char *filename)
{
cairo_surface_t *img, *surface;
cairo_t *cr;
int w, h;
img = cairo_image_surface_create_from_png(filename);
if (cairo_surface_status(img) != CAIRO_STATUS_SUCCESS) {
freelog(LOG_FATAL, "Failed reading graphics file: %s", filename);
freelog(LOG_FATAL, " %s", cairo_status_to_string(
cairo_surface_status(img)));
exit(EXIT_FAILURE);
}
w = cairo_image_surface_get_width(img);
h = cairo_image_surface_get_height(img);
/* Creating a surface of the same type as the one used by GDK
* This groups everything server-side, reducing memory use/round trips */
/* TODO: Benchmark glitz to see how much juice you can get from it */
#if 0
cr = gdk_cairo_create(GDK_DRAWABLE(root_window));
assert(cairo_status(cr) == CAIRO_STATUS_SUCCESS);
surface = cairo_surface_create_similar(cairo_get_target(cr),
CAIRO_CONTENT_COLOR_ALPHA, w, h);
assert(cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS);
cairo_destroy(cr);
cr = cairo_create(surface);
assert(cairo_status(cr) == CAIRO_STATUS_SUCCESS);
/* Cleaning that surface and getting a copy of the image */
cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
cairo_rectangle(cr, 0.0, 0.0, w, h);
cairo_fill(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_surface(cr, img, 0.0, 0.0);
cairo_paint(cr);
cairo_destroy(cr);
cairo_surface_destroy(img);
#endif
return surface_to_sprite(/*surface*/img, w, h);
}
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, (continued)
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Vijay Kiran Kamuju, 2006/04/20
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Christian Prochaska, 2006/04/20
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Vijay Kiran Kamuju, 2006/04/20
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/20
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Jason Short, 2006/04/20
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/20
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/20
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Vijay Kiran Kamuju, 2006/04/21
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Daniel Markstedt, 2006/04/21
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Christian Prochaska, 2006/04/21
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client,
Christian Prochaska <=
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/22
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/22
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Christian Prochaska, 2006/04/22
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, John Bauman, 2006/04/22
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Guest, 2006/04/25
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Christian Prochaska, 2006/04/26
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Vasco Alexandre da Silva Costa, 2006/04/26
- [Freeciv-Dev] (PR#16431) [PATCH] cairo conversion of gtk2 client, Christian Prochaska, 2006/04/27
- [Freeciv-Dev] Re: (PR#16431) [PATCH] cairo conversion of gtk2 client, Vasco Alexandre da Silva Costa, 2006/04/28
|
|