Re: Regarding Porting/Compilation of Cairo in AOSP
[email protected] Fri, 1 Jun 2018 14:08:20 -0400
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Hi Jaymin,
It looks like you just have a typo there. Use cairo.h instead of cario.h.
Easy to use pkg-config to bring in the dependencies or to check the dependencies that cairo needs. Test a little sample code to see if it helps out.
Eric
//gcc -Wall cairo1.c -o cairo1 `pkg-config --cflags --libs cairo`
#include<stdio.h>
#include<cairo.h>
int main()
{
double width=600.0;
double height=600.0;
cairo_surface_t *surface=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cr=cairo_create(surface);
//Paint the green background.
cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0);
cairo_paint(cr);
//Draw a blue rectangle.
cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, 1.0);
cairo_translate(cr, width/4.0, height/4.0);
cairo_rectangle(cr, 0.0, 0.0, width/2.0, height/2.0);
cairo_fill(cr);
printf("Output cairo1.png\n");
cairo_surface_write_to_png(surface, "cairo1.png");
printf("Status %i\n", cairo_status(cr));
cairo_destroy(cr);
cairo_surface_destroy(surface);
return 0;
}
--
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo