Fix bug in _cairo_gl_has_extension
[platform/core/graphics/cairo.git] / src / cairo-xcb-private.h
1 /* Cairo - a vector graphics library with display and print output
2  *
3  * Copyright © 2005 Red Hat, Inc.
4  * Copyright © 2009 Intel Corporation
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it either under the terms of the GNU Lesser General Public
8  * License version 2.1 as published by the Free Software Foundation
9  * (the "LGPL") or, at your option, under the terms of the Mozilla
10  * Public License Version 1.1 (the "MPL"). If you do not alter this
11  * notice, a recipient may use your version of this file under either
12  * the MPL or the LGPL.
13  *
14  * You should have received a copy of the LGPL along with this library
15  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
17  * You should have received a copy of the MPL along with this library
18  * in the file COPYING-MPL-1.1
19  *
20  * The contents of this file are subject to the Mozilla Public License
21  * Version 1.1 (the "License"); you may not use this file except in
22  * compliance with the License. You may obtain a copy of the License at
23  * http://www.mozilla.org/MPL/
24  *
25  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27  * the specific language governing rights and limitations.
28  *
29  * The Original Code is the cairo graphics library.
30  *
31  * The Initial Developer of the Original Code is Red Hat, Inc.
32  *
33  * Contributors(s):
34  *      Chris Wilson <chris@chris-wilson.co.uk>
35  */
36
37 #ifndef CAIRO_XCB_PRIVATE_H
38 #define CAIRO_XCB_PRIVATE_H
39
40 #include "cairoint.h"
41
42 #include "cairo-xcb.h"
43
44 #include "cairo-cache-private.h"
45 #include "cairo-compiler-private.h"
46 #include "cairo-device-private.h"
47 #include "cairo-error-private.h"
48 #include "cairo-freelist-private.h"
49 #include "cairo-list-private.h"
50 #include "cairo-mutex-private.h"
51 #include "cairo-pattern-private.h"
52 #include "cairo-reference-count-private.h"
53 #include "cairo-scaled-font-private.h"
54 #include "cairo-spans-private.h"
55 #include "cairo-surface-private.h"
56
57 #include <xcb/xcb.h>
58 #include <xcb/render.h>
59 #include <xcb/xcbext.h>
60 #include <pixman.h>
61
62 #define XLIB_COORD_MAX 32767
63
64 /* maximum number of cached GC's */
65 #define GC_CACHE_SIZE 4
66
67 #define CAIRO_XCB_RENDER_AT_LEAST(major, minor) \
68         ((XCB_RENDER_MAJOR_VERSION > major) ||  \
69         ((XCB_RENDER_MAJOR_VERSION == major) && (XCB_RENDER_MINOR_VERSION >= minor)))
70
71 typedef struct _cairo_xcb_connection cairo_xcb_connection_t;
72 typedef struct _cairo_xcb_font cairo_xcb_font_t;
73 typedef struct _cairo_xcb_screen cairo_xcb_screen_t;
74 typedef struct _cairo_xcb_surface cairo_xcb_surface_t;
75 typedef struct _cairo_xcb_picture cairo_xcb_picture_t;
76 typedef struct _cairo_xcb_shm_mem_pool cairo_xcb_shm_mem_pool_t;
77 typedef struct _cairo_xcb_shm_info cairo_xcb_shm_info_t;
78 typedef struct _cairo_xcb_resources cairo_xcb_resources_t;
79
80 struct _cairo_xcb_shm_info {
81     cairo_xcb_connection_t *connection;
82     uint32_t shm;
83     uint32_t offset;
84     size_t size;
85     void *mem;
86     cairo_xcb_shm_mem_pool_t *pool;
87     xcb_get_input_focus_cookie_t sync;
88     cairo_list_t pending;
89 };
90
91 struct _cairo_xcb_surface {
92     cairo_surface_t base;
93     cairo_image_surface_t *fallback;
94     cairo_boxes_t fallback_damage;
95
96     cairo_xcb_connection_t *connection;
97     cairo_xcb_screen_t *screen;
98
99     xcb_drawable_t drawable;
100     cairo_bool_t owns_pixmap;
101
102     cairo_bool_t deferred_clear;
103     cairo_color_t deferred_clear_color;
104
105     int width;
106     int height;
107     int depth;
108
109     xcb_render_picture_t picture;
110     xcb_render_pictformat_t xrender_format;
111     pixman_format_code_t pixman_format;
112     uint32_t precision;
113
114     cairo_list_t link;
115 };
116
117 struct _cairo_xcb_picture {
118     cairo_surface_t base;
119
120     cairo_xcb_screen_t *screen;
121     xcb_render_picture_t picture;
122     xcb_render_pictformat_t xrender_format;
123     pixman_format_code_t pixman_format;
124
125     int width, height;
126
127     cairo_extend_t extend;
128     cairo_filter_t filter;
129     cairo_bool_t has_component_alpha;
130     xcb_render_transform_t transform;
131
132     int x0, y0;
133     int x, y;
134
135     cairo_list_t link;
136 };
137
138 #if CAIRO_HAS_XLIB_XCB_FUNCTIONS
139 typedef struct _cairo_xlib_xcb_surface {
140     cairo_surface_t base;
141
142     cairo_xcb_surface_t *xcb;
143
144     /* original settings for query */
145     void *display;
146     void *screen;
147     void *visual;
148     void *format;
149 } cairo_xlib_xcb_surface_t;
150 #endif
151
152
153 enum {
154     GLYPHSET_INDEX_ARGB32,
155     GLYPHSET_INDEX_A8,
156     GLYPHSET_INDEX_A1,
157     NUM_GLYPHSETS
158 };
159
160 typedef struct _cairo_xcb_font_glyphset_free_glyphs {
161     xcb_render_glyphset_t   glyphset;
162     int                     glyph_count;
163     xcb_render_glyph_t      glyph_indices[128];
164 } cairo_xcb_font_glyphset_free_glyphs_t;
165
166 typedef struct _cairo_xcb_font_glyphset_info {
167     xcb_render_glyphset_t   glyphset;
168     cairo_format_t          format;
169     xcb_render_pictformat_t xrender_format;
170     cairo_xcb_font_glyphset_free_glyphs_t *pending_free_glyphs;
171 } cairo_xcb_font_glyphset_info_t;
172
173 struct _cairo_xcb_font {
174     cairo_scaled_font_private_t      base;
175     cairo_scaled_font_t             *scaled_font;
176     cairo_xcb_connection_t          *connection;
177     cairo_xcb_font_glyphset_info_t  glyphset_info[NUM_GLYPHSETS];
178     cairo_list_t link;
179 };
180
181 struct _cairo_xcb_screen {
182     cairo_xcb_connection_t *connection;
183
184     xcb_screen_t           *xcb_screen;
185     xcb_render_sub_pixel_t  subpixel_order;
186
187     xcb_gcontext_t gc[GC_CACHE_SIZE];
188     uint8_t gc_depths[GC_CACHE_SIZE];
189
190     cairo_surface_t *stock_colors[CAIRO_STOCK_NUM_COLORS];
191     struct {
192         cairo_surface_t *picture;
193         cairo_color_t color;
194     } solid_cache[16];
195     int solid_cache_size;
196
197     cairo_cache_t linear_pattern_cache;
198     cairo_cache_t radial_pattern_cache;
199     cairo_freelist_t pattern_cache_entry_freelist;
200
201     cairo_list_t link;
202     cairo_list_t surfaces;
203     cairo_list_t pictures;
204
205     cairo_bool_t has_font_options;
206     cairo_font_options_t font_options;
207 };
208
209 struct _cairo_xcb_connection {
210     cairo_device_t device;
211
212     xcb_connection_t *xcb_connection;
213
214     xcb_render_pictformat_t standard_formats[5];
215     cairo_hash_table_t *xrender_formats;
216     cairo_hash_table_t *visual_to_xrender_format;
217
218     unsigned int maximum_request_length;
219     unsigned int flags;
220     unsigned int original_flags;
221
222     int force_precision;
223
224     const xcb_setup_t *root;
225     const xcb_query_extension_reply_t *render;
226     const xcb_query_extension_reply_t *shm;
227     xcb_render_sub_pixel_t *subpixel_orders;
228
229     cairo_list_t free_xids;
230     cairo_freepool_t xid_pool;
231
232     cairo_mutex_t shm_mutex;
233     cairo_list_t shm_pools;
234     cairo_list_t shm_pending;
235     cairo_freepool_t shm_info_freelist;
236
237     cairo_mutex_t screens_mutex;
238     cairo_list_t screens;
239
240     cairo_list_t fonts;
241
242     cairo_list_t link;
243 };
244
245 struct _cairo_xcb_resources {
246     cairo_bool_t xft_antialias;
247     int xft_lcdfilter;
248     cairo_bool_t xft_hinting;
249     int xft_hintstyle;
250     int xft_rgba;
251 };
252
253 enum {
254     CAIRO_XCB_HAS_RENDER                        = 0x0001,
255     CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES        = 0x0002,
256     CAIRO_XCB_RENDER_HAS_COMPOSITE              = 0x0004,
257     CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS   = 0x0008,
258     CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS       = 0x0010,
259     CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM      = 0x0020,
260     CAIRO_XCB_RENDER_HAS_FILTERS                = 0x0040,
261     CAIRO_XCB_RENDER_HAS_PDF_OPERATORS          = 0x0080,
262     CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT        = 0x0100,
263     CAIRO_XCB_RENDER_HAS_GRADIENTS              = 0x0200,
264     CAIRO_XCB_RENDER_HAS_FILTER_GOOD            = 0x0400,
265     CAIRO_XCB_RENDER_HAS_FILTER_BEST            = 0x0800,
266
267     CAIRO_XCB_HAS_SHM                           = 0x80000000,
268
269     CAIRO_XCB_RENDER_MASK = CAIRO_XCB_HAS_RENDER |
270                             CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES |
271                             CAIRO_XCB_RENDER_HAS_COMPOSITE |
272                             CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS |
273                             CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS |
274                             CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM |
275                             CAIRO_XCB_RENDER_HAS_FILTERS |
276                             CAIRO_XCB_RENDER_HAS_PDF_OPERATORS |
277                             CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT |
278                             CAIRO_XCB_RENDER_HAS_GRADIENTS |
279                             CAIRO_XCB_RENDER_HAS_FILTER_GOOD |
280                             CAIRO_XCB_RENDER_HAS_FILTER_BEST,
281     CAIRO_XCB_SHM_MASK    = CAIRO_XCB_HAS_SHM
282 };
283
284 #define CAIRO_XCB_SHM_SMALL_IMAGE 8192
285
286 cairo_private extern const cairo_surface_backend_t _cairo_xcb_surface_backend;
287
288 /**
289  * _cairo_surface_is_xcb:
290  * @surface: a #cairo_surface_t
291  *
292  * Checks if a surface is an #cairo_xcb_surface_t
293  *
294  * Return value: %TRUE if the surface is an xcb surface
295  **/
296 static inline cairo_bool_t
297 _cairo_surface_is_xcb (const cairo_surface_t *surface)
298 {
299     /* _cairo_surface_nil sets a NULL backend so be safe */
300     return surface->backend && surface->backend->type == CAIRO_SURFACE_TYPE_XCB;
301 }
302
303 cairo_private cairo_xcb_connection_t *
304 _cairo_xcb_connection_get (xcb_connection_t *connection);
305
306 static inline cairo_xcb_connection_t *
307 _cairo_xcb_connection_reference (cairo_xcb_connection_t *connection)
308 {
309     return (cairo_xcb_connection_t *) cairo_device_reference (&connection->device);
310 }
311
312 cairo_private xcb_render_pictformat_t
313 _cairo_xcb_connection_get_xrender_format (cairo_xcb_connection_t *connection,
314                                           pixman_format_code_t pixman_format);
315
316 cairo_private xcb_render_pictformat_t
317 _cairo_xcb_connection_get_xrender_format_for_visual (cairo_xcb_connection_t *connection,
318                                                      const xcb_visualid_t visual);
319
320 static inline cairo_status_t cairo_warn
321 _cairo_xcb_connection_acquire (cairo_xcb_connection_t *connection)
322 {
323     return cairo_device_acquire (&connection->device);
324 }
325
326 cairo_private uint32_t
327 _cairo_xcb_connection_get_xid (cairo_xcb_connection_t *connection);
328
329 cairo_private void
330 _cairo_xcb_connection_put_xid (cairo_xcb_connection_t *connection,
331                                uint32_t xid);
332
333 static inline void
334 _cairo_xcb_connection_release (cairo_xcb_connection_t *connection)
335 {
336     cairo_device_release (&connection->device);
337 }
338
339 static inline void
340 _cairo_xcb_connection_destroy (cairo_xcb_connection_t *connection)
341 {
342     cairo_device_destroy (&connection->device);
343 }
344
345 cairo_private cairo_int_status_t
346 _cairo_xcb_connection_allocate_shm_info (cairo_xcb_connection_t *display,
347                                          size_t size,
348                                          cairo_bool_t might_reuse,
349                                          cairo_xcb_shm_info_t **shm_info_out);
350
351 cairo_private void
352 _cairo_xcb_shm_info_destroy (cairo_xcb_shm_info_t *shm_info);
353
354 cairo_private void
355 _cairo_xcb_connection_shm_mem_pools_flush (cairo_xcb_connection_t *connection);
356
357 cairo_private void
358 _cairo_xcb_connection_shm_mem_pools_fini (cairo_xcb_connection_t *connection);
359
360 cairo_private void
361 _cairo_xcb_font_close (cairo_xcb_font_t *font);
362
363 cairo_private cairo_xcb_screen_t *
364 _cairo_xcb_screen_get (xcb_connection_t *connection,
365                        xcb_screen_t *screen);
366
367 cairo_private void
368 _cairo_xcb_screen_finish (cairo_xcb_screen_t *screen);
369
370 cairo_private xcb_gcontext_t
371 _cairo_xcb_screen_get_gc (cairo_xcb_screen_t *screen,
372                           xcb_drawable_t drawable,
373                           int depth);
374
375 cairo_private void
376 _cairo_xcb_screen_put_gc (cairo_xcb_screen_t *screen, int depth, xcb_gcontext_t gc);
377
378 cairo_private cairo_font_options_t *
379 _cairo_xcb_screen_get_font_options (cairo_xcb_screen_t *screen);
380
381 cairo_private cairo_status_t
382 _cairo_xcb_screen_store_linear_picture (cairo_xcb_screen_t *screen,
383                                         const cairo_linear_pattern_t *linear,
384                                         cairo_surface_t *picture);
385
386 cairo_private cairo_surface_t *
387 _cairo_xcb_screen_lookup_linear_picture (cairo_xcb_screen_t *screen,
388                                          const cairo_linear_pattern_t *linear);
389
390 cairo_private cairo_status_t
391 _cairo_xcb_screen_store_radial_picture (cairo_xcb_screen_t *screen,
392                                         const cairo_radial_pattern_t *radial,
393                                         cairo_surface_t *picture);
394
395 cairo_private cairo_surface_t *
396 _cairo_xcb_screen_lookup_radial_picture (cairo_xcb_screen_t *screen,
397                                          const cairo_radial_pattern_t *radial);
398
399 cairo_private cairo_surface_t *
400 _cairo_xcb_surface_create_similar_image (void *abstrct_other,
401                                          cairo_format_t format,
402                                          int width,
403                                          int height);
404
405 cairo_private cairo_surface_t *
406 _cairo_xcb_surface_create_similar (void                 *abstract_other,
407                                    cairo_content_t       content,
408                                    int                   width,
409                                    int                   height);
410
411 cairo_private cairo_surface_t *
412 _cairo_xcb_surface_create_internal (cairo_xcb_screen_t          *screen,
413                                     xcb_drawable_t               drawable,
414                                     cairo_bool_t                 owns_pixmap,
415                                     pixman_format_code_t         pixman_format,
416                                     xcb_render_pictformat_t      xrender_format,
417                                     int                          width,
418                                     int                          height);
419
420 cairo_private_no_warn cairo_bool_t
421 _cairo_xcb_surface_get_extents (void *abstract_surface,
422                                 cairo_rectangle_int_t *extents);
423
424 cairo_private cairo_int_status_t
425 _cairo_xcb_render_compositor_paint (const cairo_compositor_t     *compositor,
426                                     cairo_composite_rectangles_t *extents);
427
428 cairo_private cairo_int_status_t
429 _cairo_xcb_render_compositor_mask (const cairo_compositor_t     *compositor,
430                                    cairo_composite_rectangles_t *extents);
431
432 cairo_private cairo_int_status_t
433 _cairo_xcb_render_compositor_stroke (const cairo_compositor_t     *compositor,
434                                      cairo_composite_rectangles_t *extents,
435                                      const cairo_path_fixed_t     *path,
436                                      const cairo_stroke_style_t   *style,
437                                      const cairo_matrix_t         *ctm,
438                                      const cairo_matrix_t         *ctm_inverse,
439                                      double                        tolerance,
440                                      cairo_antialias_t             antialias);
441
442 cairo_private cairo_int_status_t
443 _cairo_xcb_render_compositor_fill (const cairo_compositor_t     *compositor,
444                                    cairo_composite_rectangles_t *extents,
445                                    const cairo_path_fixed_t     *path,
446                                    cairo_fill_rule_t             fill_rule,
447                                    double                        tolerance,
448                                    cairo_antialias_t             antialias);
449
450 cairo_private cairo_int_status_t
451 _cairo_xcb_render_compositor_glyphs (const cairo_compositor_t     *compositor,
452                                      cairo_composite_rectangles_t *extents,
453                                      cairo_scaled_font_t          *scaled_font,
454                                      cairo_glyph_t                *glyphs,
455                                      int                           num_glyphs,
456                                      cairo_bool_t                  overlap);
457 cairo_private void
458 _cairo_xcb_surface_scaled_font_fini (cairo_scaled_font_t *scaled_font);
459
460 cairo_private void
461 _cairo_xcb_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
462                                       cairo_scaled_font_t  *scaled_font);
463
464 cairo_private cairo_status_t
465 _cairo_xcb_surface_clear (cairo_xcb_surface_t *dst);
466
467 cairo_private cairo_status_t
468 _cairo_xcb_surface_core_copy_boxes (cairo_xcb_surface_t         *dst,
469                                    const cairo_pattern_t        *src_pattern,
470                                    const cairo_rectangle_int_t  *extents,
471                                    const cairo_boxes_t          *boxes);
472
473 cairo_private cairo_status_t
474 _cairo_xcb_surface_core_fill_boxes (cairo_xcb_surface_t *dst,
475                                     const cairo_color_t *color,
476                                     cairo_boxes_t *boxes);
477
478 cairo_private xcb_pixmap_t
479 _cairo_xcb_connection_create_pixmap (cairo_xcb_connection_t *connection,
480                                      uint8_t depth,
481                                      xcb_drawable_t drawable,
482                                      uint16_t width,
483                                      uint16_t height);
484
485 cairo_private void
486 _cairo_xcb_connection_free_pixmap (cairo_xcb_connection_t *connection,
487                                    xcb_pixmap_t pixmap);
488
489 cairo_private xcb_gcontext_t
490 _cairo_xcb_connection_create_gc (cairo_xcb_connection_t *connection,
491                                  xcb_drawable_t drawable,
492                                  uint32_t value_mask,
493                                  uint32_t *values);
494
495 cairo_private void
496 _cairo_xcb_connection_free_gc (cairo_xcb_connection_t *connection,
497                                xcb_gcontext_t gc);
498
499 cairo_private void
500 _cairo_xcb_connection_change_gc (cairo_xcb_connection_t *connection,
501                                  xcb_gcontext_t gc,
502                                  uint32_t value_mask,
503                                  uint32_t *values);
504
505 cairo_private void
506 _cairo_xcb_connection_copy_area (cairo_xcb_connection_t *connection,
507                                  xcb_drawable_t src,
508                                  xcb_drawable_t dst,
509                                  xcb_gcontext_t gc,
510                                  int16_t src_x,
511                                  int16_t src_y,
512                                  int16_t dst_x,
513                                  int16_t dst_y,
514                                  uint16_t width,
515                                  uint16_t height);
516
517 cairo_private void
518 _cairo_xcb_connection_put_image (cairo_xcb_connection_t *connection,
519                                  xcb_drawable_t dst,
520                                  xcb_gcontext_t gc,
521                                  uint16_t width,
522                                  uint16_t height,
523                                  int16_t dst_x,
524                                  int16_t dst_y,
525                                  uint8_t depth,
526                                  uint32_t length,
527                                  void *data);
528
529 cairo_private void
530 _cairo_xcb_connection_put_subimage (cairo_xcb_connection_t *connection,
531                                     xcb_drawable_t dst,
532                                     xcb_gcontext_t gc,
533                                     int16_t src_x,
534                                     int16_t src_y,
535                                     uint16_t width,
536                                     uint16_t height,
537                                     uint16_t cpp,
538                                     int stride,
539                                     int16_t dst_x,
540                                     int16_t dst_y,
541                                     uint8_t depth,
542                                     void *data);
543
544 cairo_private xcb_get_image_reply_t *
545 _cairo_xcb_connection_get_image (cairo_xcb_connection_t *connection,
546                                  xcb_drawable_t src,
547                                  int16_t src_x,
548                                  int16_t src_y,
549                                  uint16_t width,
550                                  uint16_t height);
551
552 cairo_private void
553 _cairo_xcb_connection_poly_fill_rectangle (cairo_xcb_connection_t *connection,
554                                            xcb_drawable_t dst,
555                                            xcb_gcontext_t gc,
556                                            uint32_t num_rectangles,
557                                            xcb_rectangle_t *rectangles);
558
559 cairo_private cairo_status_t
560 _cairo_xcb_shm_image_create (cairo_xcb_connection_t *connection,
561                              pixman_format_code_t pixman_format,
562                              int width, int height,
563                              cairo_image_surface_t **image_out,
564                              cairo_xcb_shm_info_t **shm_info_out);
565
566 #if CAIRO_HAS_XCB_SHM_FUNCTIONS
567 cairo_private uint32_t
568 _cairo_xcb_connection_shm_attach (cairo_xcb_connection_t *connection,
569                                   uint32_t id,
570                                   cairo_bool_t readonly);
571
572 cairo_private void
573 _cairo_xcb_connection_shm_put_image (cairo_xcb_connection_t *connection,
574                                      xcb_drawable_t dst,
575                                      xcb_gcontext_t gc,
576                                      uint16_t total_width,
577                                      uint16_t total_height,
578                                      int16_t src_x,
579                                      int16_t src_y,
580                                      uint16_t width,
581                                      uint16_t height,
582                                      int16_t dst_x,
583                                      int16_t dst_y,
584                                      uint8_t depth,
585                                      uint32_t shm,
586                                      uint32_t offset);
587
588 cairo_private cairo_status_t
589 _cairo_xcb_connection_shm_get_image (cairo_xcb_connection_t *connection,
590                                      xcb_drawable_t src,
591                                      int16_t src_x,
592                                      int16_t src_y,
593                                      uint16_t width,
594                                      uint16_t height,
595                                      uint32_t shmseg,
596                                      uint32_t offset);
597
598 cairo_private void
599 _cairo_xcb_connection_shm_detach (cairo_xcb_connection_t *connection,
600                                   uint32_t segment);
601 #else
602 static inline void
603 _cairo_xcb_connection_shm_put_image (cairo_xcb_connection_t *connection,
604                                      xcb_drawable_t dst,
605                                      xcb_gcontext_t gc,
606                                      uint16_t total_width,
607                                      uint16_t total_height,
608                                      int16_t src_x,
609                                      int16_t src_y,
610                                      uint16_t width,
611                                      uint16_t height,
612                                      int16_t dst_x,
613                                      int16_t dst_y,
614                                      uint8_t depth,
615                                      uint32_t shm,
616                                      uint32_t offset)
617 {
618     ASSERT_NOT_REACHED;
619 }
620 #endif
621
622 cairo_private void
623 _cairo_xcb_connection_render_create_picture (cairo_xcb_connection_t  *connection,
624                                              xcb_render_picture_t     picture,
625                                              xcb_drawable_t           drawable,
626                                              xcb_render_pictformat_t  format,
627                                              uint32_t                 value_mask,
628                                              uint32_t                *value_list);
629
630 cairo_private void
631 _cairo_xcb_connection_render_change_picture (cairo_xcb_connection_t     *connection,
632                                              xcb_render_picture_t  picture,
633                                              uint32_t              value_mask,
634                                              uint32_t             *value_list);
635
636 cairo_private void
637 _cairo_xcb_connection_render_set_picture_clip_rectangles (cairo_xcb_connection_t      *connection,
638                                                           xcb_render_picture_t   picture,
639                                                           int16_t                clip_x_origin,
640                                                           int16_t                clip_y_origin,
641                                                           uint32_t               rectangles_len,
642                                                           xcb_rectangle_t       *rectangles);
643
644 cairo_private void
645 _cairo_xcb_connection_render_free_picture (cairo_xcb_connection_t *connection,
646                                            xcb_render_picture_t  picture);
647
648 cairo_private void
649 _cairo_xcb_connection_render_composite (cairo_xcb_connection_t     *connection,
650                                         uint8_t               op,
651                                         xcb_render_picture_t  src,
652                                         xcb_render_picture_t  mask,
653                                         xcb_render_picture_t  dst,
654                                         int16_t               src_x,
655                                         int16_t               src_y,
656                                         int16_t               mask_x,
657                                         int16_t               mask_y,
658                                         int16_t               dst_x,
659                                         int16_t               dst_y,
660                                         uint16_t              width,
661                                         uint16_t              height);
662
663 cairo_private void
664 _cairo_xcb_connection_render_trapezoids (cairo_xcb_connection_t *connection,
665                                          uint8_t                       op,
666                                          xcb_render_picture_t          src,
667                                          xcb_render_picture_t          dst,
668                                          xcb_render_pictformat_t       mask_format,
669                                          int16_t                       src_x,
670                                          int16_t                       src_y,
671                                          uint32_t                      traps_len,
672                                          xcb_render_trapezoid_t       *traps);
673
674 cairo_private void
675 _cairo_xcb_connection_render_create_glyph_set (cairo_xcb_connection_t   *connection,
676                                                xcb_render_glyphset_t     id,
677                                                xcb_render_pictformat_t  format);
678
679 cairo_private void
680 _cairo_xcb_connection_render_free_glyph_set (cairo_xcb_connection_t      *connection,
681                                              xcb_render_glyphset_t  glyphset);
682
683 cairo_private void
684 _cairo_xcb_connection_render_add_glyphs (cairo_xcb_connection_t             *connection,
685                                          xcb_render_glyphset_t         glyphset,
686                                          uint32_t                      num_glyphs,
687                                          uint32_t                     *glyphs_id,
688                                          xcb_render_glyphinfo_t       *glyphs,
689                                          uint32_t                      data_len,
690                                          uint8_t                      *data);
691
692 cairo_private void
693 _cairo_xcb_connection_render_free_glyphs (cairo_xcb_connection_t         *connection,
694                                           xcb_render_glyphset_t     glyphset,
695                                           uint32_t                  num_glyphs,
696                                           xcb_render_glyph_t       *glyphs);
697
698 cairo_private void
699 _cairo_xcb_connection_render_composite_glyphs_8 (cairo_xcb_connection_t        *connection,
700                                                  uint8_t                  op,
701                                                  xcb_render_picture_t     src,
702                                                  xcb_render_picture_t     dst,
703                                                  xcb_render_pictformat_t  mask_format,
704                                                  xcb_render_glyphset_t    glyphset,
705                                                  int16_t                  src_x,
706                                                  int16_t                  src_y,
707                                                  uint32_t                 glyphcmds_len,
708                                                  uint8_t                 *glyphcmds);
709
710 cairo_private void
711 _cairo_xcb_connection_render_composite_glyphs_16 (cairo_xcb_connection_t        *connection,
712                                                   uint8_t                  op,
713                                                   xcb_render_picture_t     src,
714                                                   xcb_render_picture_t     dst,
715                                                   xcb_render_pictformat_t  mask_format,
716                                                   xcb_render_glyphset_t    glyphset,
717                                                   int16_t                  src_x,
718                                                   int16_t                  src_y,
719                                                   uint32_t                 glyphcmds_len,
720                                                   uint8_t                 *glyphcmds);
721
722 cairo_private void
723 _cairo_xcb_connection_render_composite_glyphs_32 (cairo_xcb_connection_t        *connection,
724                                                   uint8_t                  op,
725                                                   xcb_render_picture_t     src,
726                                                   xcb_render_picture_t     dst,
727                                                   xcb_render_pictformat_t  mask_format,
728                                                   xcb_render_glyphset_t    glyphset,
729                                                   int16_t                  src_x,
730                                                   int16_t                  src_y,
731                                                   uint32_t                 glyphcmds_len,
732                                                   uint8_t                 *glyphcmds);
733
734 cairo_private void
735 _cairo_xcb_connection_render_fill_rectangles (cairo_xcb_connection_t      *connection,
736                                               uint8_t                op,
737                                               xcb_render_picture_t   dst,
738                                               xcb_render_color_t     color,
739                                               uint32_t               num_rects,
740                                               xcb_rectangle_t       *rects);
741
742 cairo_private void
743 _cairo_xcb_connection_render_set_picture_transform (cairo_xcb_connection_t       *connection,
744                                                     xcb_render_picture_t    picture,
745                                                     xcb_render_transform_t  *transform);
746
747 cairo_private void
748 _cairo_xcb_connection_render_set_picture_filter (cairo_xcb_connection_t         *connection,
749                                                  xcb_render_picture_t      picture,
750                                                  uint16_t                  filter_len,
751                                                  char                     *filter,
752                                                  uint32_t                  values_len,
753                                                  xcb_render_fixed_t       *values);
754
755 cairo_private void
756 _cairo_xcb_connection_render_create_solid_fill (cairo_xcb_connection_t     *connection,
757                                                 xcb_render_picture_t  picture,
758                                                 xcb_render_color_t    color);
759
760 cairo_private void
761 _cairo_xcb_connection_render_create_linear_gradient (cairo_xcb_connection_t         *connection,
762                                                      xcb_render_picture_t      picture,
763                                                      xcb_render_pointfix_t     p1,
764                                                      xcb_render_pointfix_t     p2,
765                                                      uint32_t                  num_stops,
766                                                      xcb_render_fixed_t *stops,
767                                                      xcb_render_color_t *colors);
768
769 cairo_private void
770 _cairo_xcb_connection_render_create_radial_gradient (cairo_xcb_connection_t         *connection,
771                                                      xcb_render_picture_t      picture,
772                                                      xcb_render_pointfix_t     inner,
773                                                      xcb_render_pointfix_t     outer,
774                                                      xcb_render_fixed_t        inner_radius,
775                                                      xcb_render_fixed_t        outer_radius,
776                                                      uint32_t                  num_stops,
777                                                      xcb_render_fixed_t *stops,
778                                                      xcb_render_color_t *colors);
779
780 cairo_private void
781 _cairo_xcb_connection_render_create_conical_gradient (cairo_xcb_connection_t         *c,
782                                                       xcb_render_picture_t      picture,
783                                                       xcb_render_pointfix_t     center,
784                                                       xcb_render_fixed_t        angle,
785                                                       uint32_t                  num_stops,
786                                                       xcb_render_fixed_t *stops,
787                                                       xcb_render_color_t *colors);
788
789 cairo_private cairo_xcb_picture_t *
790 _cairo_xcb_gaussian_filter (cairo_xcb_surface_t *target,
791                             cairo_xcb_picture_t *orig_pict,
792                             const cairo_pattern_t *pattern);
793
794 #if CAIRO_HAS_XLIB_XCB_FUNCTIONS
795 slim_hidden_proto (cairo_xcb_surface_create);
796 slim_hidden_proto (cairo_xcb_surface_create_for_bitmap);
797 slim_hidden_proto (cairo_xcb_surface_create_with_xrender_format);
798 slim_hidden_proto (cairo_xcb_surface_set_size);
799 slim_hidden_proto (cairo_xcb_surface_set_drawable);
800 slim_hidden_proto (cairo_xcb_device_debug_get_precision);
801 slim_hidden_proto_no_warn (cairo_xcb_device_debug_set_precision);
802 slim_hidden_proto_no_warn (cairo_xcb_device_debug_cap_xrender_version);
803 #endif
804
805 cairo_private void
806 _cairo_xcb_resources_get (cairo_xcb_screen_t *screen,
807                           cairo_xcb_resources_t *resources);
808
809 #endif /* CAIRO_XCB_PRIVATE_H */