Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-cairo.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2012 Intel Corporation
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
23 #error "Only <clutter/clutter.h> can be included directly."
24 #endif
25
26 #ifndef __CLUTTER_CAIRO_H__
27 #define __CLUTTER_CAIRO_H__
28
29 #include <clutter/clutter-types.h>
30
31 G_BEGIN_DECLS
32
33 /**
34  * CLUTTER_CAIRO_FORMAT_ARGB32:
35  *
36  * The #CoglPixelFormat to be used when uploading image data from
37  * and to a Cairo image surface using %CAIRO_FORMAT_ARGB32 and
38  * %CAIRO_FORMAT_RGB24 as #cairo_format_t.
39  *
40  * Since: 1.8
41  */
42
43 /* Cairo stores the data in native byte order as ARGB but Cogl's pixel
44  * formats specify the actual byte order. Therefore we need to use a
45  * different format depending on the architecture
46  */
47 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
48 #define CLUTTER_CAIRO_FORMAT_ARGB32     (COGL_PIXEL_FORMAT_BGRA_8888_PRE)
49 #else
50 #define CLUTTER_CAIRO_FORMAT_ARGB32     (COGL_PIXEL_FORMAT_ARGB_8888_PRE)
51 #endif
52
53 void    clutter_cairo_clear             (cairo_t               *cr);
54 void    clutter_cairo_set_source_color  (cairo_t               *cr,
55                                          const ClutterColor    *color);
56
57 G_END_DECLS
58
59 #endif /* __CLUTTER_CAIRO_H__ */