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 © 2009 Intel Corporation
  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 University of Southern
  31.  * California.
  32.  *
  33.  * Contributor(s):
  34.  *      Chris Wilson <chris@chris-wilson.co.u>
  35.  */
  36.  
  37. #ifndef CAIRO_COMPOSITE_RECTANGLES_PRIVATE_H
  38. #define CAIRO_COMPOSITE_RECTANGLES_PRIVATE_H
  39.  
  40. #include "cairo-types-private.h"
  41. #include "cairo-error-private.h"
  42. #include "cairo-pattern-private.h"
  43.  
  44. CAIRO_BEGIN_DECLS
  45.  
  46. /* Rectangles that take part in a composite operation.
  47.  *
  48.  * The source and mask track the extents of the respective patterns in device
  49.  * space. The unbounded rectangle is essentially the clip rectangle. And the
  50.  * intersection of all is the bounded rectangle, which is the minimum extents
  51.  * the operation may require. Whether or not the operation is actually bounded
  52.  * is tracked in the is_bounded boolean.
  53.  *
  54.  */
  55. struct _cairo_composite_rectangles {
  56.     cairo_surface_t *surface;
  57.     cairo_operator_t op;
  58.  
  59.     cairo_rectangle_int_t source;
  60.     cairo_rectangle_int_t mask;
  61.     cairo_rectangle_int_t destination;
  62.  
  63.     cairo_rectangle_int_t bounded; /* source? IN mask? IN unbounded */
  64.     cairo_rectangle_int_t unbounded; /* destination IN clip */
  65.     uint32_t is_bounded;
  66.  
  67.     cairo_rectangle_int_t source_sample_area;
  68.     cairo_rectangle_int_t mask_sample_area;
  69.  
  70.     cairo_pattern_union_t source_pattern;
  71.     cairo_pattern_union_t mask_pattern;
  72.     const cairo_pattern_t *original_source_pattern;
  73.     const cairo_pattern_t *original_mask_pattern;
  74.  
  75.     cairo_clip_t *clip; /* clip will be reduced to the minimal container */
  76. };
  77.  
  78. cairo_private cairo_int_status_t
  79. _cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extents,
  80.                                             cairo_surface_t *surface,
  81.                                             cairo_operator_t     op,
  82.                                             const cairo_pattern_t       *source,
  83.                                             const cairo_clip_t          *clip);
  84.  
  85. cairo_private cairo_int_status_t
  86. _cairo_composite_rectangles_init_for_mask (cairo_composite_rectangles_t *extents,
  87.                                            cairo_surface_t *surface,
  88.                                            cairo_operator_t      op,
  89.                                            const cairo_pattern_t        *source,
  90.                                            const cairo_pattern_t        *mask,
  91.                                            const cairo_clip_t           *clip);
  92.  
  93. cairo_private cairo_int_status_t
  94. _cairo_composite_rectangles_init_for_stroke (cairo_composite_rectangles_t *extents,
  95.                                              cairo_surface_t *surface,
  96.                                              cairo_operator_t    op,
  97.                                              const cairo_pattern_t      *source,
  98.                                              const cairo_path_fixed_t   *path,
  99.                                              const cairo_stroke_style_t *style,
  100.                                              const cairo_matrix_t       *ctm,
  101.                                              const cairo_clip_t         *clip);
  102.  
  103. cairo_private cairo_int_status_t
  104. _cairo_composite_rectangles_init_for_fill (cairo_composite_rectangles_t *extents,
  105.                                            cairo_surface_t *surface,
  106.                                            cairo_operator_t      op,
  107.                                            const cairo_pattern_t        *source,
  108.                                            const cairo_path_fixed_t     *path,
  109.                                            const cairo_clip_t           *clip);
  110.  
  111. cairo_private cairo_int_status_t
  112. _cairo_composite_rectangles_init_for_boxes (cairo_composite_rectangles_t *extents,
  113.                                               cairo_surface_t           *surface,
  114.                                               cairo_operator_t           op,
  115.                                               const cairo_pattern_t     *source,
  116.                                               const cairo_boxes_t       *boxes,
  117.                                               const cairo_clip_t                *clip);
  118.  
  119. cairo_private cairo_int_status_t
  120. _cairo_composite_rectangles_init_for_polygon (cairo_composite_rectangles_t *extents,
  121.                                               cairo_surface_t           *surface,
  122.                                               cairo_operator_t           op,
  123.                                               const cairo_pattern_t     *source,
  124.                                               const cairo_polygon_t     *polygon,
  125.                                               const cairo_clip_t                *clip);
  126.  
  127. cairo_private cairo_int_status_t
  128. _cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *extents,
  129.                                              cairo_surface_t *surface,
  130.                                              cairo_operator_t            op,
  131.                                              const cairo_pattern_t      *source,
  132.                                              cairo_scaled_font_t        *scaled_font,
  133.                                              cairo_glyph_t              *glyphs,
  134.                                              int                         num_glyphs,
  135.                                              const cairo_clip_t         *clip,
  136.                                              cairo_bool_t               *overlap);
  137.  
  138. cairo_private cairo_int_status_t
  139. _cairo_composite_rectangles_intersect_source_extents (cairo_composite_rectangles_t *extents,
  140.                                                       const cairo_box_t *box);
  141.  
  142. cairo_private cairo_int_status_t
  143. _cairo_composite_rectangles_intersect_mask_extents (cairo_composite_rectangles_t *extents,
  144.                                                     const cairo_box_t *box);
  145.  
  146. cairo_private cairo_bool_t
  147. _cairo_composite_rectangles_can_reduce_clip (cairo_composite_rectangles_t *composite,
  148.                                              cairo_clip_t *clip);
  149.  
  150. cairo_private cairo_int_status_t
  151. _cairo_composite_rectangles_add_to_damage (cairo_composite_rectangles_t *composite,
  152.                                            cairo_boxes_t *damage);
  153.  
  154. cairo_private void
  155. _cairo_composite_rectangles_fini (cairo_composite_rectangles_t *extents);
  156.  
  157. CAIRO_END_DECLS
  158.  
  159. #endif /* CAIRO_COMPOSITE_RECTANGLES_PRIVATE_H */
  160.