Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  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 "cairo-xcb.h"
  41.  
  42. #include "cairoint.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.  
  79. struct _cairo_xcb_shm_info {
  80.     cairo_xcb_connection_t *connection;
  81.     uint32_t shm;
  82.     uint32_t offset;
  83.     size_t size;
  84.     void *mem;
  85.     cairo_xcb_shm_mem_pool_t *pool;
  86.     xcb_get_input_focus_cookie_t sync;
  87.     cairo_list_t pending;
  88. };
  89.  
  90. struct _cairo_xcb_surface {
  91.     cairo_surface_t base;
  92.     cairo_image_surface_t *fallback;
  93.     cairo_boxes_t fallback_damage;
  94.  
  95.     cairo_xcb_connection_t *connection;
  96.     cairo_xcb_screen_t *screen;
  97.  
  98.     xcb_drawable_t drawable;
  99.     cairo_bool_t owns_pixmap;
  100.  
  101.     cairo_bool_t deferred_clear;
  102.     cairo_color_t deferred_clear_color;
  103.  
  104.     int width;
  105.     int height;
  106.     int depth;
  107.  
  108.     xcb_render_picture_t picture;
  109.     xcb_render_pictformat_t xrender_format;
  110.     pixman_format_code_t pixman_format;
  111.     uint32_t precision;
  112.  
  113.     cairo_list_t link;
  114. };
  115.  
  116. struct _cairo_xcb_picture {
  117.     cairo_surface_t base;
  118.  
  119.     cairo_xcb_screen_t *screen;
  120.     xcb_render_picture_t picture;
  121.     xcb_render_pictformat_t xrender_format;
  122.     pixman_format_code_t pixman_format;
  123.  
  124.     int width, height;
  125.  
  126.     cairo_extend_t extend;
  127.     cairo_filter_t filter;
  128.     cairo_bool_t has_component_alpha;
  129.     xcb_render_transform_t transform;
  130.  
  131.     int x0, y0;
  132.     int x, y;
  133.  
  134.     cairo_list_t link;
  135. };
  136.  
  137. #if CAIRO_HAS_XLIB_XCB_FUNCTIONS
  138. typedef struct _cairo_xlib_xcb_surface {
  139.     cairo_surface_t base;
  140.  
  141.     cairo_xcb_surface_t *xcb;
  142.  
  143.     /* original settings for query */
  144.     void *display;
  145.     void *screen;
  146.     void *visual;
  147.     void *format;
  148. } cairo_xlib_xcb_surface_t;
  149. #endif
  150.  
  151.  
  152. enum {
  153.     GLYPHSET_INDEX_ARGB32,
  154.     GLYPHSET_INDEX_A8,
  155.     GLYPHSET_INDEX_A1,
  156.     NUM_GLYPHSETS
  157. };
  158.  
  159. typedef struct _cairo_xcb_font_glyphset_free_glyphs {
  160.     xcb_render_glyphset_t   glyphset;
  161.     int                     glyph_count;
  162.     xcb_render_glyph_t      glyph_indices[128];
  163. } cairo_xcb_font_glyphset_free_glyphs_t;
  164.  
  165. typedef struct _cairo_xcb_font_glyphset_info {
  166.     xcb_render_glyphset_t   glyphset;
  167.     cairo_format_t          format;
  168.     xcb_render_pictformat_t xrender_format;
  169.     cairo_xcb_font_glyphset_free_glyphs_t *pending_free_glyphs;
  170. } cairo_xcb_font_glyphset_info_t;
  171.  
  172. struct _cairo_xcb_font {
  173.     cairo_scaled_font_private_t      base;
  174.     cairo_scaled_font_t             *scaled_font;
  175.     cairo_xcb_connection_t          *connection;
  176.     cairo_xcb_font_glyphset_info_t  glyphset_info[NUM_GLYPHSETS];
  177.     cairo_list_t link;
  178. };
  179.  
  180. struct _cairo_xcb_screen {
  181.     cairo_xcb_connection_t *connection;
  182.  
  183.     xcb_screen_t            *xcb_screen;
  184.  
  185.     xcb_gcontext_t gc[GC_CACHE_SIZE];
  186.     uint8_t gc_depths[GC_CACHE_SIZE];
  187.  
  188.     cairo_surface_t *stock_colors[CAIRO_STOCK_NUM_COLORS];
  189.     struct {
  190.         cairo_surface_t *picture;
  191.         cairo_color_t color;
  192.     } solid_cache[16];
  193.     int solid_cache_size;
  194.  
  195.     cairo_cache_t linear_pattern_cache;
  196.     cairo_cache_t radial_pattern_cache;
  197.     cairo_freelist_t pattern_cache_entry_freelist;
  198.  
  199.     cairo_list_t link;
  200.     cairo_list_t surfaces;
  201.     cairo_list_t pictures;
  202. };
  203.  
  204. struct _cairo_xcb_connection {
  205.     cairo_device_t device;
  206.  
  207.     xcb_connection_t *xcb_connection;
  208.  
  209.     xcb_render_pictformat_t standard_formats[5];
  210.     cairo_hash_table_t *xrender_formats;
  211.     cairo_hash_table_t *visual_to_xrender_format;
  212.  
  213.     unsigned int maximum_request_length;
  214.     unsigned int flags;
  215.     unsigned int original_flags;
  216.  
  217.     int force_precision;
  218.  
  219.     const xcb_setup_t *root;
  220.     const xcb_query_extension_reply_t *render;
  221.     const xcb_query_extension_reply_t *shm;
  222.  
  223.     cairo_list_t free_xids;
  224.     cairo_freepool_t xid_pool;
  225.  
  226.     cairo_mutex_t shm_mutex;
  227.     cairo_list_t shm_pools;
  228.     cairo_list_t shm_pending;
  229.     cairo_freepool_t shm_info_freelist;
  230.  
  231.     cairo_mutex_t screens_mutex;
  232.     cairo_list_t screens;
  233.  
  234.     cairo_list_t fonts;
  235.  
  236.     cairo_list_t link;
  237. };
  238.  
  239. enum {
  240.     CAIRO_XCB_HAS_RENDER                        = 0x0001,
  241.     CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES        = 0x0002,
  242.     CAIRO_XCB_RENDER_HAS_COMPOSITE              = 0x0004,
  243.     CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS   = 0x0008,
  244.     CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS       = 0x0010,
  245.     CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM      = 0x0020,
  246.     CAIRO_XCB_RENDER_HAS_FILTERS                = 0x0040,
  247.     CAIRO_XCB_RENDER_HAS_PDF_OPERATORS          = 0x0080,
  248.     CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT        = 0x0100,
  249.     CAIRO_XCB_RENDER_HAS_GRADIENTS              = 0x0200,
  250.  
  251.     CAIRO_XCB_HAS_SHM                           = 0x80000000,
  252.  
  253.     CAIRO_XCB_RENDER_MASK = CAIRO_XCB_HAS_RENDER |
  254.                             CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES |
  255.                             CAIRO_XCB_RENDER_HAS_COMPOSITE |
  256.                             CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS |
  257.                             CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS |
  258.                             CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM |
  259.                             CAIRO_XCB_RENDER_HAS_FILTERS |
  260.                             CAIRO_XCB_RENDER_HAS_PDF_OPERATORS |
  261.                             CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT |
  262.                             CAIRO_XCB_RENDER_HAS_GRADIENTS,
  263.     CAIRO_XCB_SHM_MASK    = CAIRO_XCB_HAS_SHM
  264. };
  265.  
  266. #define CAIRO_XCB_SHM_SMALL_IMAGE 8192
  267.  
  268. cairo_private extern const cairo_surface_backend_t _cairo_xcb_surface_backend;
  269.  
  270. cairo_private cairo_xcb_connection_t *
  271. _cairo_xcb_connection_get (xcb_connection_t *connection);
  272.  
  273. static inline cairo_xcb_connection_t *
  274. _cairo_xcb_connection_reference (cairo_xcb_connection_t *connection)
  275. {
  276.     return (cairo_xcb_connection_t *) cairo_device_reference (&connection->device);
  277. }
  278.  
  279. cairo_private xcb_render_pictformat_t
  280. _cairo_xcb_connection_get_xrender_format (cairo_xcb_connection_t *connection,
  281.                                           pixman_format_code_t pixman_format);
  282.  
  283. cairo_private xcb_render_pictformat_t
  284. _cairo_xcb_connection_get_xrender_format_for_visual (cairo_xcb_connection_t *connection,
  285.                                                      const xcb_visualid_t visual);
  286.  
  287. static inline cairo_status_t cairo_warn
  288. _cairo_xcb_connection_acquire (cairo_xcb_connection_t *connection)
  289. {
  290.     return cairo_device_acquire (&connection->device);
  291. }
  292.  
  293. cairo_private uint32_t
  294. _cairo_xcb_connection_get_xid (cairo_xcb_connection_t *connection);
  295.  
  296. cairo_private void
  297. _cairo_xcb_connection_put_xid (cairo_xcb_connection_t *connection,
  298.                                uint32_t xid);
  299.  
  300. static inline void
  301. _cairo_xcb_connection_release (cairo_xcb_connection_t *connection)
  302. {
  303.     cairo_device_release (&connection->device);
  304. }
  305.  
  306. static inline void
  307. _cairo_xcb_connection_destroy (cairo_xcb_connection_t *connection)
  308. {
  309.     cairo_device_destroy (&connection->device);
  310. }
  311.  
  312. cairo_private cairo_int_status_t
  313. _cairo_xcb_connection_allocate_shm_info (cairo_xcb_connection_t *display,
  314.                                          size_t size,
  315.                                          cairo_bool_t might_reuse,
  316.                                          cairo_xcb_shm_info_t **shm_info_out);
  317.  
  318. cairo_private void
  319. _cairo_xcb_shm_info_destroy (cairo_xcb_shm_info_t *shm_info);
  320.  
  321. cairo_private void
  322. _cairo_xcb_connection_shm_mem_pools_flush (cairo_xcb_connection_t *connection);
  323.  
  324. cairo_private void
  325. _cairo_xcb_connection_shm_mem_pools_fini (cairo_xcb_connection_t *connection);
  326.  
  327. cairo_private void
  328. _cairo_xcb_font_close (cairo_xcb_font_t *font);
  329.  
  330. cairo_private cairo_xcb_screen_t *
  331. _cairo_xcb_screen_get (xcb_connection_t *connection,
  332.                        xcb_screen_t *screen);
  333.  
  334. cairo_private void
  335. _cairo_xcb_screen_finish (cairo_xcb_screen_t *screen);
  336.  
  337. cairo_private xcb_gcontext_t
  338. _cairo_xcb_screen_get_gc (cairo_xcb_screen_t *screen,
  339.                           xcb_drawable_t drawable,
  340.                           int depth);
  341.  
  342. cairo_private void
  343. _cairo_xcb_screen_put_gc (cairo_xcb_screen_t *screen, int depth, xcb_gcontext_t gc);
  344.  
  345. cairo_private cairo_status_t
  346. _cairo_xcb_screen_store_linear_picture (cairo_xcb_screen_t *screen,
  347.                                         const cairo_linear_pattern_t *linear,
  348.                                         cairo_surface_t *picture);
  349.  
  350. cairo_private cairo_surface_t *
  351. _cairo_xcb_screen_lookup_linear_picture (cairo_xcb_screen_t *screen,
  352.                                          const cairo_linear_pattern_t *linear);
  353.  
  354. cairo_private cairo_status_t
  355. _cairo_xcb_screen_store_radial_picture (cairo_xcb_screen_t *screen,
  356.                                         const cairo_radial_pattern_t *radial,
  357.                                         cairo_surface_t *picture);
  358.  
  359. cairo_private cairo_surface_t *
  360. _cairo_xcb_screen_lookup_radial_picture (cairo_xcb_screen_t *screen,
  361.                                          const cairo_radial_pattern_t *radial);
  362.  
  363. cairo_private cairo_surface_t *
  364. _cairo_xcb_surface_create_similar_image (void *abstrct_other,
  365.                                          cairo_format_t format,
  366.                                          int width,
  367.                                          int height);
  368.  
  369. cairo_private cairo_surface_t *
  370. _cairo_xcb_surface_create_similar (void                 *abstract_other,
  371.                                    cairo_content_t       content,
  372.                                    int                   width,
  373.                                    int                   height);
  374.  
  375. cairo_private cairo_surface_t *
  376. _cairo_xcb_surface_create_internal (cairo_xcb_screen_t          *screen,
  377.                                     xcb_drawable_t               drawable,
  378.                                     cairo_bool_t                 owns_pixmap,
  379.                                     pixman_format_code_t         pixman_format,
  380.                                     xcb_render_pictformat_t      xrender_format,
  381.                                     int                          width,
  382.                                     int                          height);
  383.  
  384. cairo_private_no_warn cairo_bool_t
  385. _cairo_xcb_surface_get_extents (void *abstract_surface,
  386.                                 cairo_rectangle_int_t *extents);
  387.  
  388. cairo_private cairo_int_status_t
  389. _cairo_xcb_render_compositor_paint (const cairo_compositor_t     *compositor,
  390.                                     cairo_composite_rectangles_t *extents);
  391.  
  392. cairo_private cairo_int_status_t
  393. _cairo_xcb_render_compositor_mask (const cairo_compositor_t     *compositor,
  394.                                    cairo_composite_rectangles_t *extents);
  395.  
  396. cairo_private cairo_int_status_t
  397. _cairo_xcb_render_compositor_stroke (const cairo_compositor_t     *compositor,
  398.                                      cairo_composite_rectangles_t *extents,
  399.                                      const cairo_path_fixed_t     *path,
  400.                                      const cairo_stroke_style_t   *style,
  401.                                      const cairo_matrix_t         *ctm,
  402.                                      const cairo_matrix_t         *ctm_inverse,
  403.                                      double                        tolerance,
  404.                                      cairo_antialias_t             antialias);
  405.  
  406. cairo_private cairo_int_status_t
  407. _cairo_xcb_render_compositor_fill (const cairo_compositor_t     *compositor,
  408.                                    cairo_composite_rectangles_t *extents,
  409.                                    const cairo_path_fixed_t     *path,
  410.                                    cairo_fill_rule_t             fill_rule,
  411.                                    double                        tolerance,
  412.                                    cairo_antialias_t             antialias);
  413.  
  414. cairo_private cairo_int_status_t
  415. _cairo_xcb_render_compositor_glyphs (const cairo_compositor_t     *compositor,
  416.                                      cairo_composite_rectangles_t *extents,
  417.                                      cairo_scaled_font_t          *scaled_font,
  418.                                      cairo_glyph_t                *glyphs,
  419.                                      int                           num_glyphs,
  420.                                      cairo_bool_t                  overlap);
  421. cairo_private void
  422. _cairo_xcb_surface_scaled_font_fini (cairo_scaled_font_t *scaled_font);
  423.  
  424. cairo_private void
  425. _cairo_xcb_surface_scaled_glyph_fini (cairo_scaled_glyph_t *scaled_glyph,
  426.                                       cairo_scaled_font_t  *scaled_font);
  427.  
  428. cairo_private cairo_status_t
  429. _cairo_xcb_surface_clear (cairo_xcb_surface_t *dst);
  430.  
  431. cairo_private cairo_status_t
  432. _cairo_xcb_surface_core_copy_boxes (cairo_xcb_surface_t         *dst,
  433.                                    const cairo_pattern_t        *src_pattern,
  434.                                    const cairo_rectangle_int_t  *extents,
  435.                                    const cairo_boxes_t          *boxes);
  436.  
  437. cairo_private cairo_status_t
  438. _cairo_xcb_surface_core_fill_boxes (cairo_xcb_surface_t *dst,
  439.                                     const cairo_color_t *color,
  440.                                     cairo_boxes_t *boxes);
  441.  
  442. cairo_private xcb_pixmap_t
  443. _cairo_xcb_connection_create_pixmap (cairo_xcb_connection_t *connection,
  444.                                      uint8_t depth,
  445.                                      xcb_drawable_t drawable,
  446.                                      uint16_t width,
  447.                                      uint16_t height);
  448.  
  449. cairo_private void
  450. _cairo_xcb_connection_free_pixmap (cairo_xcb_connection_t *connection,
  451.                                    xcb_pixmap_t pixmap);
  452.  
  453. cairo_private xcb_gcontext_t
  454. _cairo_xcb_connection_create_gc (cairo_xcb_connection_t *connection,
  455.                                  xcb_drawable_t drawable,
  456.                                  uint32_t value_mask,
  457.                                  uint32_t *values);
  458.  
  459. cairo_private void
  460. _cairo_xcb_connection_free_gc (cairo_xcb_connection_t *connection,
  461.                                xcb_gcontext_t gc);
  462.  
  463. cairo_private void
  464. _cairo_xcb_connection_change_gc (cairo_xcb_connection_t *connection,
  465.                                  xcb_gcontext_t gc,
  466.                                  uint32_t value_mask,
  467.                                  uint32_t *values);
  468.  
  469. cairo_private void
  470. _cairo_xcb_connection_copy_area (cairo_xcb_connection_t *connection,
  471.                                  xcb_drawable_t src,
  472.                                  xcb_drawable_t dst,
  473.                                  xcb_gcontext_t gc,
  474.                                  int16_t src_x,
  475.                                  int16_t src_y,
  476.                                  int16_t dst_x,
  477.                                  int16_t dst_y,
  478.                                  uint16_t width,
  479.                                  uint16_t height);
  480.  
  481. cairo_private void
  482. _cairo_xcb_connection_put_image (cairo_xcb_connection_t *connection,
  483.                                  xcb_drawable_t dst,
  484.                                  xcb_gcontext_t gc,
  485.                                  uint16_t width,
  486.                                  uint16_t height,
  487.                                  int16_t dst_x,
  488.                                  int16_t dst_y,
  489.                                  uint8_t depth,
  490.                                  uint32_t length,
  491.                                  void *data);
  492.  
  493. cairo_private void
  494. _cairo_xcb_connection_put_subimage (cairo_xcb_connection_t *connection,
  495.                                     xcb_drawable_t dst,
  496.                                     xcb_gcontext_t gc,
  497.                                     int16_t src_x,
  498.                                     int16_t src_y,
  499.                                     uint16_t width,
  500.                                     uint16_t height,
  501.                                     uint16_t cpp,
  502.                                     int stride,
  503.                                     int16_t dst_x,
  504.                                     int16_t dst_y,
  505.                                     uint8_t depth,
  506.                                     void *data);
  507.  
  508. cairo_private cairo_status_t
  509. _cairo_xcb_connection_get_image (cairo_xcb_connection_t *connection,
  510.                                  xcb_drawable_t src,
  511.                                  int16_t src_x,
  512.                                  int16_t src_y,
  513.                                  uint16_t width,
  514.                                  uint16_t height,
  515.                                  xcb_get_image_reply_t **reply);
  516.  
  517. cairo_private void
  518. _cairo_xcb_connection_poly_fill_rectangle (cairo_xcb_connection_t *connection,
  519.                                            xcb_drawable_t dst,
  520.                                            xcb_gcontext_t gc,
  521.                                            uint32_t num_rectangles,
  522.                                            xcb_rectangle_t *rectangles);
  523.  
  524. cairo_private cairo_status_t
  525. _cairo_xcb_shm_image_create (cairo_xcb_connection_t *connection,
  526.                              pixman_format_code_t pixman_format,
  527.                              int width, int height,
  528.                              cairo_image_surface_t **image_out,
  529.                              cairo_xcb_shm_info_t **shm_info_out);
  530.  
  531. #if CAIRO_HAS_XCB_SHM_FUNCTIONS
  532. cairo_private uint32_t
  533. _cairo_xcb_connection_shm_attach (cairo_xcb_connection_t *connection,
  534.                                   uint32_t id,
  535.                                   cairo_bool_t readonly);
  536.  
  537. cairo_private void
  538. _cairo_xcb_connection_shm_put_image (cairo_xcb_connection_t *connection,
  539.                                      xcb_drawable_t dst,
  540.                                      xcb_gcontext_t gc,
  541.                                      uint16_t total_width,
  542.                                      uint16_t total_height,
  543.                                      int16_t src_x,
  544.                                      int16_t src_y,
  545.                                      uint16_t width,
  546.                                      uint16_t height,
  547.                                      int16_t dst_x,
  548.                                      int16_t dst_y,
  549.                                      uint8_t depth,
  550.                                      uint32_t shm,
  551.                                      uint32_t offset);
  552.  
  553. cairo_private cairo_status_t
  554. _cairo_xcb_connection_shm_get_image (cairo_xcb_connection_t *connection,
  555.                                      xcb_drawable_t src,
  556.                                      int16_t src_x,
  557.                                      int16_t src_y,
  558.                                      uint16_t width,
  559.                                      uint16_t height,
  560.                                      uint32_t shmseg,
  561.                                      uint32_t offset);
  562.  
  563. cairo_private void
  564. _cairo_xcb_connection_shm_detach (cairo_xcb_connection_t *connection,
  565.                                   uint32_t segment);
  566. #else
  567. static inline void
  568. _cairo_xcb_connection_shm_put_image (cairo_xcb_connection_t *connection,
  569.                                      xcb_drawable_t dst,
  570.                                      xcb_gcontext_t gc,
  571.                                      uint16_t total_width,
  572.                                      uint16_t total_height,
  573.                                      int16_t src_x,
  574.                                      int16_t src_y,
  575.                                      uint16_t width,
  576.                                      uint16_t height,
  577.                                      int16_t dst_x,
  578.                                      int16_t dst_y,
  579.                                      uint8_t depth,
  580.                                      uint32_t shm,
  581.                                      uint32_t offset)
  582. {
  583.     ASSERT_NOT_REACHED;
  584. }
  585. #endif
  586.  
  587. cairo_private void
  588. _cairo_xcb_connection_render_create_picture (cairo_xcb_connection_t  *connection,
  589.                                              xcb_render_picture_t     picture,
  590.                                              xcb_drawable_t           drawable,
  591.                                              xcb_render_pictformat_t  format,
  592.                                              uint32_t                 value_mask,
  593.                                              uint32_t                *value_list);
  594.  
  595. cairo_private void
  596. _cairo_xcb_connection_render_change_picture (cairo_xcb_connection_t     *connection,
  597.                                              xcb_render_picture_t  picture,
  598.                                              uint32_t              value_mask,
  599.                                              uint32_t             *value_list);
  600.  
  601. cairo_private void
  602. _cairo_xcb_connection_render_set_picture_clip_rectangles (cairo_xcb_connection_t      *connection,
  603.                                                           xcb_render_picture_t   picture,
  604.                                                           int16_t                clip_x_origin,
  605.                                                           int16_t                clip_y_origin,
  606.                                                           uint32_t               rectangles_len,
  607.                                                           xcb_rectangle_t       *rectangles);
  608.  
  609. cairo_private void
  610. _cairo_xcb_connection_render_free_picture (cairo_xcb_connection_t *connection,
  611.                                            xcb_render_picture_t  picture);
  612.  
  613. cairo_private void
  614. _cairo_xcb_connection_render_composite (cairo_xcb_connection_t     *connection,
  615.                                         uint8_t               op,
  616.                                         xcb_render_picture_t  src,
  617.                                         xcb_render_picture_t  mask,
  618.                                         xcb_render_picture_t  dst,
  619.                                         int16_t               src_x,
  620.                                         int16_t               src_y,
  621.                                         int16_t               mask_x,
  622.                                         int16_t               mask_y,
  623.                                         int16_t               dst_x,
  624.                                         int16_t               dst_y,
  625.                                         uint16_t              width,
  626.                                         uint16_t              height);
  627.  
  628. cairo_private void
  629. _cairo_xcb_connection_render_trapezoids (cairo_xcb_connection_t *connection,
  630.                                          uint8_t                       op,
  631.                                          xcb_render_picture_t          src,
  632.                                          xcb_render_picture_t          dst,
  633.                                          xcb_render_pictformat_t       mask_format,
  634.                                          int16_t                       src_x,
  635.                                          int16_t                       src_y,
  636.                                          uint32_t                      traps_len,
  637.                                          xcb_render_trapezoid_t       *traps);
  638.  
  639. cairo_private void
  640. _cairo_xcb_connection_render_create_glyph_set (cairo_xcb_connection_t   *connection,
  641.                                                xcb_render_glyphset_t     id,
  642.                                                xcb_render_pictformat_t  format);
  643.  
  644. cairo_private void
  645. _cairo_xcb_connection_render_free_glyph_set (cairo_xcb_connection_t      *connection,
  646.                                              xcb_render_glyphset_t  glyphset);
  647.  
  648. cairo_private void
  649. _cairo_xcb_connection_render_add_glyphs (cairo_xcb_connection_t             *connection,
  650.                                          xcb_render_glyphset_t         glyphset,
  651.                                          uint32_t                      num_glyphs,
  652.                                          uint32_t                     *glyphs_id,
  653.                                          xcb_render_glyphinfo_t       *glyphs,
  654.                                          uint32_t                      data_len,
  655.                                          uint8_t                      *data);
  656.  
  657. cairo_private void
  658. _cairo_xcb_connection_render_free_glyphs (cairo_xcb_connection_t         *connection,
  659.                                           xcb_render_glyphset_t     glyphset,
  660.                                           uint32_t                  num_glyphs,
  661.                                           xcb_render_glyph_t       *glyphs);
  662.  
  663. cairo_private void
  664. _cairo_xcb_connection_render_composite_glyphs_8 (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.                                                  xcb_render_glyphset_t    glyphset,
  670.                                                  int16_t                  src_x,
  671.                                                  int16_t                  src_y,
  672.                                                  uint32_t                 glyphcmds_len,
  673.                                                  uint8_t                 *glyphcmds);
  674.  
  675. cairo_private void
  676. _cairo_xcb_connection_render_composite_glyphs_16 (cairo_xcb_connection_t        *connection,
  677.                                                   uint8_t                  op,
  678.                                                   xcb_render_picture_t     src,
  679.                                                   xcb_render_picture_t     dst,
  680.                                                   xcb_render_pictformat_t  mask_format,
  681.                                                   xcb_render_glyphset_t    glyphset,
  682.                                                   int16_t                  src_x,
  683.                                                   int16_t                  src_y,
  684.                                                   uint32_t                 glyphcmds_len,
  685.                                                   uint8_t                 *glyphcmds);
  686.  
  687. cairo_private void
  688. _cairo_xcb_connection_render_composite_glyphs_32 (cairo_xcb_connection_t        *connection,
  689.                                                   uint8_t                  op,
  690.                                                   xcb_render_picture_t     src,
  691.                                                   xcb_render_picture_t     dst,
  692.                                                   xcb_render_pictformat_t  mask_format,
  693.                                                   xcb_render_glyphset_t    glyphset,
  694.                                                   int16_t                  src_x,
  695.                                                   int16_t                  src_y,
  696.                                                   uint32_t                 glyphcmds_len,
  697.                                                   uint8_t                 *glyphcmds);
  698.  
  699. cairo_private void
  700. _cairo_xcb_connection_render_fill_rectangles (cairo_xcb_connection_t      *connection,
  701.                                               uint8_t                op,
  702.                                               xcb_render_picture_t   dst,
  703.                                               xcb_render_color_t     color,
  704.                                               uint32_t               num_rects,
  705.                                               xcb_rectangle_t       *rects);
  706.  
  707. cairo_private void
  708. _cairo_xcb_connection_render_set_picture_transform (cairo_xcb_connection_t       *connection,
  709.                                                     xcb_render_picture_t    picture,
  710.                                                     xcb_render_transform_t  *transform);
  711.  
  712. cairo_private void
  713. _cairo_xcb_connection_render_set_picture_filter (cairo_xcb_connection_t         *connection,
  714.                                                  xcb_render_picture_t      picture,
  715.                                                  uint16_t                  filter_len,
  716.                                                  char                     *filter);
  717.  
  718. cairo_private void
  719. _cairo_xcb_connection_render_create_solid_fill (cairo_xcb_connection_t     *connection,
  720.                                                 xcb_render_picture_t  picture,
  721.                                                 xcb_render_color_t    color);
  722.  
  723. cairo_private void
  724. _cairo_xcb_connection_render_create_linear_gradient (cairo_xcb_connection_t         *connection,
  725.                                                      xcb_render_picture_t      picture,
  726.                                                      xcb_render_pointfix_t     p1,
  727.                                                      xcb_render_pointfix_t     p2,
  728.                                                      uint32_t                  num_stops,
  729.                                                      xcb_render_fixed_t *stops,
  730.                                                      xcb_render_color_t *colors);
  731.  
  732. cairo_private void
  733. _cairo_xcb_connection_render_create_radial_gradient (cairo_xcb_connection_t         *connection,
  734.                                                      xcb_render_picture_t      picture,
  735.                                                      xcb_render_pointfix_t     inner,
  736.                                                      xcb_render_pointfix_t     outer,
  737.                                                      xcb_render_fixed_t        inner_radius,
  738.                                                      xcb_render_fixed_t        outer_radius,
  739.                                                      uint32_t                  num_stops,
  740.                                                      xcb_render_fixed_t *stops,
  741.                                                      xcb_render_color_t *colors);
  742.  
  743. cairo_private void
  744. _cairo_xcb_connection_render_create_conical_gradient (cairo_xcb_connection_t         *c,
  745.                                                       xcb_render_picture_t      picture,
  746.                                                       xcb_render_pointfix_t     center,
  747.                                                       xcb_render_fixed_t        angle,
  748.                                                       uint32_t                  num_stops,
  749.                                                       xcb_render_fixed_t *stops,
  750.                                                       xcb_render_color_t *colors);
  751. #if CAIRO_HAS_XLIB_XCB_FUNCTIONS
  752. slim_hidden_proto (cairo_xcb_surface_create);
  753. slim_hidden_proto (cairo_xcb_surface_create_for_bitmap);
  754. slim_hidden_proto (cairo_xcb_surface_create_with_xrender_format);
  755. slim_hidden_proto (cairo_xcb_surface_set_size);
  756. slim_hidden_proto (cairo_xcb_surface_set_drawable);
  757. slim_hidden_proto (cairo_xcb_device_debug_get_precision);
  758. slim_hidden_proto_no_warn (cairo_xcb_device_debug_set_precision);
  759. slim_hidden_proto_no_warn (cairo_xcb_device_debug_cap_xrender_version);
  760. #endif
  761.  
  762. #endif /* CAIRO_XCB_PRIVATE_H */
  763.