Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Cairo - a vector graphics library with display and print output
  2.  *
  3.  * Copyright © 2005 Red Hat, Inc.
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it either under the terms of the GNU Lesser General Public
  7.  * License version 2.1 as published by the Free Software Foundation
  8.  * (the "LGPL") or, at your option, under the terms of the Mozilla
  9.  * Public License Version 1.1 (the "MPL"). If you do not alter this
  10.  * notice, a recipient may use your version of this file under either
  11.  * the MPL or the LGPL.
  12.  *
  13.  * You should have received a copy of the LGPL along with this library
  14.  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
  15.  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
  16.  * You should have received a copy of the MPL along with this library
  17.  * in the file COPYING-MPL-1.1
  18.  *
  19.  * The contents of this file are subject to the Mozilla Public License
  20.  * Version 1.1 (the "License"); you may not use this file except in
  21.  * compliance with the License. You may obtain a copy of the License at
  22.  * http://www.mozilla.org/MPL/
  23.  *
  24.  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
  25.  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
  26.  * the specific language governing rights and limitations.
  27.  *
  28.  * The Original Code is the cairo graphics library.
  29.  *
  30.  * The Initial Developer of the Original Code is Red Hat, Inc.
  31.  */
  32.  
  33. #ifndef CAIRO_XLIB_SURFACE_PRIVATE_H
  34. #define CAIRO_XLIB_SURFACE_PRIVATE_H
  35.  
  36. #include "cairo-xlib.h"
  37. #include "cairo-xlib-private.h"
  38. #include "cairo-xlib-xrender-private.h"
  39.  
  40. #include "cairo-surface-private.h"
  41.  
  42. typedef struct _cairo_xlib_surface cairo_xlib_surface_t;
  43.  
  44. struct _cairo_xlib_surface {
  45.     cairo_surface_t base;
  46.  
  47.     cairo_xlib_screen_t *screen;
  48.     cairo_xlib_hook_t close_display_hook;
  49.  
  50.     Drawable drawable;
  51.     cairo_bool_t owns_pixmap;
  52.     Visual *visual;
  53.  
  54.     int use_pixmap;
  55.  
  56.     int render_major;
  57.     int render_minor;
  58.  
  59.     /* TRUE if the server has a bug with repeating pictures
  60.      *
  61.      *  https://bugs.freedesktop.org/show_bug.cgi?id=3566
  62.      *
  63.      * We can't test for this because it depends on whether the
  64.      * picture is in video memory or not.
  65.      *
  66.      * We also use this variable as a guard against a second
  67.      * independent bug with transformed repeating pictures:
  68.      *
  69.      * http://lists.freedesktop.org/archives/cairo/2004-September/001839.html
  70.      *
  71.      * Both are fixed in xorg >= 6.9 and hopefully in > 6.8.2, so
  72.      * we can reuse the test for now.
  73.      */
  74.     unsigned int buggy_gradients : 1;
  75.     unsigned int buggy_pad_reflect : 1;
  76.     unsigned int buggy_repeat : 1;
  77. #define CAIRO_XLIB_SURFACE_HAS_BUGGY_GRADIENTS 1
  78. #define CAIRO_XLIB_SURFACE_HAS_BUGGY_PAD_REFLECT 1
  79. #define CAIRO_XLIB_SURFACE_HAS_BUGGY_REPEAT 1
  80.  
  81.     int width;
  82.     int height;
  83.     int depth;
  84.  
  85.     Picture dst_picture, src_picture;
  86.  
  87.     unsigned int clip_dirty;
  88.     XRectangle embedded_clip_rects[8];
  89.     XRectangle *clip_rects;
  90.     int num_clip_rects;
  91.     cairo_region_t *clip_region;
  92.  
  93.     XRenderPictFormat *xrender_format;
  94.     cairo_filter_t filter;
  95.     cairo_extend_t extend;
  96.     cairo_bool_t has_component_alpha;
  97.     int precision;
  98.     XTransform xtransform;
  99.  
  100.     uint32_t a_mask;
  101.     uint32_t r_mask;
  102.     uint32_t g_mask;
  103.     uint32_t b_mask;
  104. };
  105.  
  106. enum {
  107.     CAIRO_XLIB_SURFACE_CLIP_DIRTY_GC      = 0x01,
  108.     CAIRO_XLIB_SURFACE_CLIP_DIRTY_PICTURE = 0x02,
  109.     CAIRO_XLIB_SURFACE_CLIP_DIRTY_ALL     = 0x03
  110. };
  111.  
  112. #endif /* CAIRO_XLIB_SURFACE_PRIVATE_H */
  113.