~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to src/cairo-pattern.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
    return CAIRO_STATUS_SUCCESS;
193
193
}
194
194
 
 
195
cairo_status_t
 
196
_cairo_pattern_init_snapshot (cairo_pattern_t       *pattern,
 
197
                              const cairo_pattern_t *other)
 
198
{
 
199
    cairo_status_t status;
 
200
 
 
201
    /* We don't bother doing any fancy copy-on-write implementation
 
202
     * for the pattern's data. It's generally quite tiny. */
 
203
    status = _cairo_pattern_init_copy (pattern, other);
 
204
    if (status)
 
205
        return status;
 
206
 
 
207
    /* But we do let the surface snapshot stuff be as fancy as it
 
208
     * would like to be. */
 
209
    if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
 
210
        cairo_surface_pattern_t *surface_pattern =
 
211
            (cairo_surface_pattern_t *) pattern;
 
212
        cairo_surface_t *surface = surface_pattern->surface;
 
213
 
 
214
        surface_pattern->surface = _cairo_surface_snapshot (surface);
 
215
 
 
216
        cairo_surface_destroy (surface);
 
217
 
 
218
        if (surface_pattern->surface->status)
 
219
            return surface_pattern->surface->status;
 
220
    }
 
221
 
 
222
    return CAIRO_STATUS_SUCCESS;
 
223
}
 
224
 
195
225
void
196
226
_cairo_pattern_fini (cairo_pattern_t *pattern)
197
227
{
2093
2123
     * horizontal/vertical linear gradients).
2094
2124
     */
2095
2125
 
 
2126
    /* unbounded patterns -> 'infinite' extents */
2096
2127
    extents->x = CAIRO_RECT_INT_MIN;
2097
2128
    extents->y = CAIRO_RECT_INT_MIN;
2098
 
    extents->width = CAIRO_RECT_INT_MIN + CAIRO_RECT_INT_MAX;
2099
 
    extents->height = CAIRO_RECT_INT_MIN + CAIRO_RECT_INT_MAX;
 
2129
    extents->width = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN;
 
2130
    extents->height = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN;
2100
2131
 
2101
2132
    return CAIRO_STATUS_SUCCESS;
2102
2133
}