summaryrefslogtreecommitdiff
path: root/src/cairo-surface.c
AgeCommit message (Collapse)AuthorFilesLines
2005-05-06Remove cairo_set_target_surface and all other backend-specific ↵Carl Worth1-1/+1
cairo_set_target functions. Require a cairo_surface_t* to call cairo_create. Port to use new cairo_create interface. Rewrite all tests that were using cairo_set_target_surface to instead create a temporary cairo_t, (eventually to be replaced with cairo_begin_group).
2005-05-03Fills as paths patch originally by Owen Taylor.Kristian Høgsberg1-0/+13
Make sure we have a current point for the relative path operators. Add fill_path backend method. Implement fill_path in the PDF backend.
2005-05-02src/cairo-surface.c src/cairoint.h: Add _cairo_surface_begin/end to save and ↵Owen Taylor1-23/+158
restore the clip state of a surface. Copy and store clip regions set on a surface so that we can save and restore them. Add a CAIRO_STATUS_BAD_NESTING error for interleaved use of two cairo_t's on the same surface. Also, add a skeleton doc comment for cairo_status_t. src/cairo.c src/cairo-gstate.c src/cairoint.h: Use _cairo_surface_begin/end to replace _cairo_gstate_restore_external_state. Use _cairo_surface_begin/end to save the state of a surface when we start drawing at it and restore it at the end. Check that the save level of the surface is what we expect on drawing operations and fail with CAIRO_STATUS_BAD_NESTING otherwise. src/cairo-pattern.c src/cairoint.h (_cairo_pattern_acquire_surface_for_surface) (_cairo_pattern_release_surface): Surround use of pattern->surface with _cairo_surface->begin/end so we don't clip surfaces used as sources. test/clip-nesting.c test/Makefile.am: Test of destinatin clipping with the nested creation of cairo_t's for the same context. test/source-clip.c test/Makefile.am: Test that clipping on a source as a destination doesn't affect use of it as a source. XFAIL test for copying from a surface as a source to itself as a destination with a clip.
2005-04-21Handle backends that don't have a set_clip_region implementation (PDF).Kristian Høgsberg1-0/+3
2005-04-19Add new cairo_paint function.Carl Worth1-1/+38
Add new get_extents function to the surface backend interface. Add function to query current clip_extents. Implement the new get_extents function for each backend. Save the clip extents from set_clip_region and implement _cairo_surface_get_clip_extents. Abstract away the evil XGetGeometry roundtrip in _cairo_xlib_surface_get_size. Rewrite a couple of tests to call cairo_paint.
2005-04-14and delete:Carl Worth1-19/+16
cairo_set_pattern -> cairo_set_source cairo_get_pattern -> cairo_get_source cairo_set_rgb_color -> cairo_set_source_rgb -> cairo_set_source_rgba cairo_set_alpha -> cairo_get_alpha -> Note that we'll likely want to add cairo_set_source_surface. Add _cairo_stock_color helper function. Improve some interfaces: _cairo_color_init _cairo_color_init_rgb _cairo_color_set_rgb -> _cairo_color_init_rgba _cairo_color_set_alpha _cairo_color_multiply_alpha _cairo_color_get_rgb -> _cairo_color_get_rbga _cairo_color_get_rgba_premultiplied Add cairo_stock_t and some helper macros: CAIRO_COLOR_WHITE CAIRO_COLOR_BLACK CAIRO_COLOR_TRANSPARENT Fix cairo_pattern_t by eliminating pattern->alpha. Fix cairo_solid_pattern_t to use cairo_color_t rather than three doubles. Track removal of pattern->alpha, simplifying the code considerably Track _cairo_color interface changes. Remove gstate->alpha. Propagate down set_source renamings. cairo_pattern_add_color_stop -> cairo_pattern_add_color_stop_rgba and add: cairo_pattern_add_color_stop_rgb Remove pattern->alpha, simplifying the code considerably. Track pattern and color interface changes. Add const where appropriate on cairo_color_t*. Add private type inspection predicate. (cairo_xlib_surface_set_size): Add check for surface type mismatch, (no useful error reporting yet, though). Note coverage as en expected failure. Improve line wrap on expected failure messages. Port all tests to new cairo_set_source interfaces.
2005-04-13Set freed pointer to NULL.Carl Worth1-2/+9
Fix to actually set surface->finished when done. Closes bug #2950 as documented in test/surface-finish-twice.c. Note that this bug is fixed.
2005-04-12Default to CAIRO_FILTER_GOOD rather than CAIRO_FILTER_BEST.Carl Worth1-1/+1
Optimize to use CAIRO_FILTER_NEAREST when the pattern matrix is an integer translation.
2005-04-12Use CAIRO_FILTER_BEST by default rather than CAIRO_FILTER_NEAREST.Carl Worth1-1/+1
2005-04-08src/cairo.h src/cairo-font.c src/cairoint.h doc/public/cairo-sections.txt: ↵Owen Taylor1-65/+6
Add cairo_font_face_set/get_user_data(). src/cairo-array.c src/cairoint.h src/cairo-surface.c: Refactor user data code from cairo-surface.c into cairo_user_data_array_t. Switch these types to be like cairo_surface_t where the generic code frees the wrapper object. src/cairo-atsui-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Fix up for the above changes. Implement a complicated mutual-referencing scheme to make sure that a face from cairo_ft_font_face_create_for_ft_face() is freed only when the FT_Face is no longer needed. Update the docs to describe how to figure out when the FT_Face can be freed. Fix refcount leaks when creating fonts. Remove excess call to _cairo_unscaled_font_reference(). Remove stray initialization of font matrix to the identity. test/user-data.c: Fix a bug when setting/unsetting a key with a free key slot before it, add that to the test case. Don't append an element when user_data is NULL.
2005-04-07Change to allow NULL backend function pointers to indicate unsupported ↵Carl Worth1-43/+43
functions. Eliminate stub functions and replace with NULL in surface backend table.
2005-04-07src/cairo.h src/cairo-gstate.c src/cairo-font.c: Add a cairo_font_face_t ↵Owen Taylor1-2/+2
type to hold a description of a font face. Replace cairo_set_font() with cairo_set_font_face(). src/cairoint.h src/cairo-font.c src/cairo-gstate.c: Add "cairo_simple_font_face" for family/weight/slant and use it to implement font naming for the toy API. src/cairo-ft.h src/cairo-ft-font.c cairo-win32.h cairo-win32-font.c: Switch the FreeType and Win32 backends over to using cairo_font_face_t. src/cairo.h src/cairo-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Pass in font matrix and CTM separately rather than as a composite scale when creating fonts; allows removing font_matrix argument to metrics functions. src/cairoint.h src/cairo-font.c src/cairo-ft-font.c src/cairo-win32-font.c: Remove cairo_font_scale_t type, just use cairo_matrix_t and ignore translations. src/cairo-ft.h src/cairo-ft-font.c: Remove cairo_ft_font_get_pattern() -- it can't work for all FreeType backend fonts and doesn't seem particularly useful. Rename cairo_font_get_extents() to cairo_font_extents() split font functions into a separate section. Fix locking order problem. Add caches for simple font faces and from cairo_font_face_t to cairo_scaled_font_t. src/cairo.h src/cairoint.h src/cairo-font.c src/cairo-win32-font.c src/cairo-ft-font.c src/cairo-gstate.c src/cairo-gstate-private.h: Rename cairo_font_t to cairo_scaled_font_t.
2005-04-07Rework the cairo_matrix_t interface in several ways. Expose a struct for ↵Carl Worth1-3/+7
cairo_matrix_t. Add new function to return current matrix: cairo_get_matrix Deprecate the following functions (in documentation): cairo_matrix_create cairo_matrix_destroy cairo_matrix_get_affine Rename: cairo_matrix_set_affine -> cairo_matrix_init cairo_matrix_set_identity -> cairo_matrix_init_identity Add other new matrix initialization functions: cairo_matrix_init_translate cairo_matrix_init_scale cairo_matrix_init_rotate Change return type of almost all cairo_matrix functions from cairo_status_t to void. Track changes to cairo_matrix_t interface. Add a test case showing the same path drawn under various transforms, (including skews set directly by initializing a cairo_matrix_t).
2005-04-04Drop cairo_default_matrix since it is now always identical to ↵Carl Worth1-6/+0
cairo_identity_matrix. Remove gstate->pixels_per inch. Change default matrix to always be the identity matrix. Drop pixels_per_inch function from surface backend interface as it is no longer needed.
2005-04-01Update API shakeup chart.Carl Worth1-11/+0
Add a standin for the function that should be cairo_set_target_image which should then have some other name. We can straighten that mess out when we eliminate the set_target functions. Add deprecation alias for cairo_current_pattern. Deprecate cairo_surface_create_for_image in favor of cairo_image_surface_create_for_data.
2005-03-17src/cairo.h src/cairo_surface.c src/cairo-xlib.h src/cairo_xlib_surface.c: ↵Owen Taylor1-0/+30
Move cairo_xlib_surface_set_device_offset() to a generic cairo_surface_set_device_offset(). Take the surface's device offset into account. Update.
2005-03-16Dont call user data destroy function if it's NULL.Kristian Høgsberg1-2/+2
Add test case for user data with NULL destroy function.
2005-03-16Add cairo_output_stream.cKristian Høgsberg1-2/+114
Add new errors, CAIRO_STATUS_WRITE_ERROR and CAIRO_STATUS_SURFACE_FINISHED, add cairo_surface_finish() prototype, add cairo_write_func_t. Add strings for new errors, documentation fix. Rename surface destroy functions to finish and change them to not free the surface. Change PDF surface constructors to take a write function in the general case and add stdio convenience constructors. Change destroy function to finish for cairo_pdf_surface. Change implementation to use cairo_output_stream_t functions for output. Use _cairo_surface_show_glyphs instead of calling function pointer directly. Add prototypes for cairo output stream functions, rename destroy to finish in cairo_surface_backend_t and add finished flag to cairo_surface_t. Add cairo_surface_finish() and call it from cairo_surface_destroy(). Check the finished flag in cairo_surface_t in functions that change the surface.
2005-03-10*** empty log message ***Kristian Høgsberg1-0/+18
2005-03-10Originally: 2005-02-24 Carl Worth <cworth@cworth.org>Carl Worth1-0/+90
Add const qualifier to cairo_user_data_key_t arguments. Originally: 2005-02-15 Kristian Høgsberg <krh@redhat.com> Add these two functions to set and get user data on an surface. Function prototypes for new functions. Test case for user data functions.
2005-03-03Pass mask to composite operation as patternDavid Reveman1-7/+7
2005-03-03Removed surface backend functions set_matrix, set_filter and set_repeatDavid Reveman1-5/+3
2005-02-22Switch from broken cworth@isi.edu address to canonical cworth@cworth.org ↵Carl Worth1-1/+1
address.
2005-02-21Fix y offset to use dst_y instead of dst_x, (caught by David Reveman).Carl Worth1-1/+1
2005-01-31configure.in src/cairo-features.h.in: Add a check for the Windows platform ↵Owen Taylor1-1/+1
and --enable-win32. Also add some (currently always off) stubs for native Win32 fonts. Make building the PDF backend conditional on having FreeType. src/Makefile.am src/cairo_win32_surface.c src/cairo_win32_font.c src/cairo-win32.h: Add a Win32 backend using GDI and software fallbacks Font code is not yet there yet, but it works with the fontconfig backend. src/cairo_gdip_font.cpp src/cairo_gdip_surface.cpp: Remove remnants of a GDI+ based backend. Prefer platform-specific font backends to the fontconfig backend.
2005-01-31src/cairoint.h src/cairo_image_surface.c src/cairo_pdf_surface.c ↵Owen Taylor1-50/+352
src/cairo_png_surface.c src/cairo_surface.c src/cairo_xlib_surface.c: Replace the get_image()/set_image() backend operations with a more specific {acquire,release}_{source,dest}_image() and clone_similar(). src/cairoint.h src/cairo_pattern.c: Replace _cairo_pattern_get_surface() with a _cairo_pattern_begin_draw()/_cairo_pattern_end_draw() pair. Save the format for which an image is created so we can access it later. (Needed for the _cairo_xlib_surface_clone_similar()) src/cairoint.h src/cairo_image_surface.c: Add _cairo_surface_is_image(). Add CAIRO_OK(status) to check for CAIRO_STATUS_SUCCESS. In the absence of of RENDER, make cairo_xlib_surface_create_similar() return an image surface. Don't try to use RENDER to composite glyphs in the absence of the RENDER extension.
2005-01-27The overall idea of this rewrite is that we want to pass the source pattern ↵Kristian Høgsberg1-122/+20
all the way down into the backends. The motivation for this is that not all backends want a surface for the source operand, and by passing the pattern down, backends can choose to convert it to a surface if they need that. The patch removes the create_surface function pointer from the surface vtable and moves much of that code into a couple of helper functions. The composite, compsite_trapezoids, and show_glyphs backend functions are updated to take a cairo_pattern_t instead of a surface as the source. Change these functions to not create a surface for the pattern and just pass the pattern down to the backend functions. New function to translate a set of trapezoids. Break out the code to adjust and restore surface transformation and repeat settings into _cairo_pattern_prepare_surface and _cairo_pattern_restore_surface. Split cairo_pattern_create_for_surface into an init function and a create function. Utility functions to create a surface from a pattern. Update these backends to work with the new pattern API. Glitz work by David Reveman. Update these to pass through the new set of args. Update this reference image as we now render it correctly.
2004-10-21Convert all files to utf-8. Add copyright information to cairo_png_surface.c.Carl Worth1-1/+1
2004-09-04Add the MPL as a new license option, in addition to the LGPL.Carl Worth1-10/+27
2004-08-02Fix to explicitly refer to GNU Lesser Public License 2.1 rather than the ↵Carl Worth1-7/+5
Library Public License version 2 or 'any later version'
2004-08-02Change from MIT license to LGPL.Carl Worth1-20/+14
2004-05-28These two fixes are from David Reveman <c99drn@cs.umu.se>:Carl Worth1-8/+6
Move NULL test from create_similar_scratch to create_similar_solid. Fix for when surface->backend != image->backend, but the backend does use images for similar surfaces.
2004-05-28Add WARN_CFLAGS, autodetection for 64/128 bit ints and cairo_wideint.[ch]Keith Packard1-1/+1
Check status return from _cairo_gstate_glyph_extents Quiet compiler warnings about uninitialized variables Switch to alternate exact line intersection code. Add 64/128-bit wide integer arithmetic. Switch to stdint.h types (and new wide types).
2004-05-24Added glyph cachingDavid Reveman1-5/+23
2004-05-11Removed pattern_offsetDavid Reveman1-5/+3
2004-04-25Converted shading routines to use fixed point values.David Reveman1-4/+4
2004-04-23Fixed several function prototype mismatches between internal header file and ↵Carl Worth1-1/+1
implementation (thanks to Carlos Romero and gcc-3.4).
2004-04-22Fixed pattern source offsetDavid Reveman1-7/+7
2004-04-09Added OpenGL surface backendDavid Reveman1-6/+6
2004-04-06Added new pattern APIDavid Reveman1-0/+108
2004-03-19Add.Graydon Hoare1-0/+5
finalize and copy clip.region. Detect rectangular clips and push down to backend. Add set_clip_region slot. (cairo_clip_rec_t): Add region slot. (_cairo_gstate_init_clip) (_cairo_surface_set_clip_region): Prototype. Add. Add. Add. not implemented.
2004-03-17Fixed for latest XCB API. XCB headers can co-exist with Xlib headers now, so ↵Jamey Sharp1-0/+1
Cairo may be compiled with both backends in the same library. http://freedesktop.org/Software/XCBCompletedTasks#17_Mar_2004
2004-01-30New "filter" field.Graydon Hoare1-0/+7
New function. (cairo_surface_set_filter): Store filter in surface. Declare. Copy filter setting. (_cairo_xlib_surface_set_filter): Use constants from Xrender.h
2003-11-03Add support for cairo_copy_page. Fixes so PS output can be more than one ↵Carl Worth1-0/+15
page. Bump version to 0.1.11 for new cairo_copy_page.
2003-10-31Implemented preliminary PostScript output support. Added cairo_show_page. ↵Carl Worth1-0/+15
Bumped version number to 0.1.10
2003-10-31Moved all libic-related drawing into cairo_image_surface.cCarl Worth1-236/+112
2003-10-28Rename gstate->ppm to gstate->pixels_per_inch. Add new pixels_per_inch to ↵Carl Worth1-3/+9
the surface backend.
2003-10-28Drop cairo_surface_create_similar_solidCarl Worth1-20/+14
2003-10-28Fix bug from previous commit. Must check for NULL backend function pointers ↵Carl Worth1-20/+26
before calling them.
2003-10-27Cleanup of surface->backend interface. Better type-safety and more ↵Carl Worth1-6/+22
consistent return-value handling.