| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
The cairo_tag_begin/cairo_tag_end API is for supporting hyperlinks and
creating tagged PDF files.
The source, ctm, and stroke style are passed to the backend to allow
these parameters to be used to specify hyperlink border attributes.
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
When transforming the incoming paths, the goal is to transform them from
user space onto the target coordinate system. Currently for relative
paths we used user_to_device_distance as we presumed that there was no
backend scale factor. However, Alex Larsson noticed that these then
broke when playing around with such a device transform...
Reported-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
| |
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
| |
Allow a backend to completely reimplement the Cairo API as it wants. The
goal is to pass operations to the native backends such as Quartz,
Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete
logging contexts, and whatever else the imagination holds. Perhaps to
experiment with double-paths?
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
These functions have no implementation and are never called.
|
|
|
|
|
|
|
|
| |
cairo_set_font_size() should be equivalent to setting the font matrix
to an appropriate scale matrix.
Implementing it this way saves some code and makes sure that the same
code path is used whenever the font matrix is changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_cairo_gstate_redirect_target asserts that this surface is NULL
immediately before destroying it. If the code is compiled with
assertions disabled and the assert would be false, it is now safer
because instead of an invalid access it will only memleak.
_cairo_gstate_get_parent_target () is not used anymore in
cairo_pop_group () and the related code can be removed.
_cairo_gstate_is_redirected () has never been used.
The comment about the clipping is misleading, because the clip is
translated as expected since fb7f7c2f27f0823d7702f960204d6e638d697624.
|
|
|
|
|
|
|
| |
cairo_push_group (cr) followed by cairo_restore (cr) should put cr in
an error status of CAIRO_STATUS_INVALID_RESTORE.
Fixes group-state.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 8d67186cb291cb877e52b987e2ac18c2a1175a57 caches whether the device
transform is identity on context creation. However, the api is quite lax
and allows the user to modify the device transform *after* he has
started to use the surface in a context, as apparently WebKit does.
Since this is not the only instance where we may need to invalidate
caches if the user modifies state, introduce a simple mechanism for
hooking into notifications of property changes.
Fixes test/clip-device-offset.
|
|
|
|
|
|
| |
In the fairly common condition that both the ctm and the device
transforms are identity, the function overhead of calling the matrix
multiplication on the point overwhelmingly dominates.
|
|
|
|
|
|
|
|
|
|
|
| |
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When observing applications two patterns emerge. The first is due to
Pango, which wraps each glyph run within a context save/restore. This
causes the scaled font to be evicted after every run and reloaded on the
next. This is caught by the MRU slot on the cairo_scaled_font_map and
prevents a relatively costly traversal of the hash table and holdovers.
The second pattern is by applications that directly manage the rendering
of their own glyphs. The prime example of this is gnome-terminal/vte. Here
the application frequently alternates between a few scaled fonts - which
requires a hash table retrieval every time.
By introducing a MRU slot on the gstate we are able to directly recover
the scaled font around 90% of the time.
Of 110,000 set-scaled-fonts:
4,000 were setting the current font
96,000 were setting to the previous font
2,500 were recovered from the MRU on the cairo_scaled_font_map
7,500 needed a hash retrieval
which compares to ~106,000 hash lookups without the additional MRU slot on
the gstate.
This translates to an elapsed time saving of ~5% when replaying a
gnome-terminal trace using the drm backend.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were recently added, (as part of sparse integration?), but they
break boilerplate which reaches into at least cairo-types-private.h
and cairo-scaled-font-private.h. But boilerplate cannot see cairoint.h
or else it gets the internal sybol renaming, (with the INT_ prefix),
and then all the test suite tests refuse to link.
If this change reverts some recently-added functionality, (or
cleanliness), then we'll just need to find some other way to add that
back again without the breakage.
|
|
|
|
| |
There are still some bits not quite working.
|
|
|
|
|
|
|
|
| |
This patch was produced with the following (GNU) sed script:
sed -i -r -e 's/^[ \t]+$//'
run on all *.[ch] files within cairo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the following API calls:
cairo_push_group
cairo_push_group_with_content
cairo_pop_group
cairo_pop_group_to_source
cairo_get_group_target
These methods support implementing layers on top of a cairo context,
allowing for drawing with transparency and temporary buffering.
cairo_get_group_target allows an app to get access to the actual surface
created by the last push_group call, in case itneeds to perform native
drawing to it.
|
|
|
|
| |
reviewed by: cworth
|
|
|
|
|
|
|
|
|
| |
(paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
|
|
|
|
|
|
|
| |
Remove pen_regular field from the gstate.
Move stroke fallback from gstate to surface where it belongs.
Eliminate dependence on cairo_gstate_t object.
Fix to include just cairo-clip-private.h rather than cairo-gstate.private.h.
|
|
|
|
|
|
|
|
| |
system seen by the backend can differ from the nominal device coordinate space used by the application.
Useful for printer backends where the device coordinate space should be in pixels while the user visible device space is in points.
There is no API to set these values; the backends using this functionality should do that themselves before the first cairo_t is created.
reviewed by: cworth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hint and is not supported by all backends.
Store the antialiasing mode in the gstate and pass it to the backend for trapezoid rendering and for clipping.
Pass the antialiasing parameter down to the backend where appropriate.
Pass the antialiasing parameter down to the backend where appropriate.
Add support for A1 format trapezoid rendering, and remove the _create_mask_image function, creating a temporary image from memory we allocate and clear.
Support A1 masks to disable antialiasing using the RENDER extension when requested.
Support A1 masks to disable antialiasing using the RENDER extension when requested.
Blindly pass through the antialising parameter.
Add the antialiasing parameter but don't support it.
Add a test case and a reference image from the latest libpixman.
Add the new antialiasing disabling API to the docs.
Update progress on a parameter to disable antialiasing.
reviewed by: cworth, otaylor
|
|
|
|
|
|
|
|
|
|
|
| |
functions and put them in cairo-clip.c.
Rewrite to use new cairo_clip_t functions for manipulating the clip state, change the clip_and_composite_trapezoids call tree to use cairo_clip_t instead of cairo_gstate_t.
Use new cairo_clip_t function to maintain clip state while replaying.
Pass fill rule and tolerance directly, to break gstate dependency.
New function. Set the clip for a surface as specified by the cairo_clip_t.
Move translate_traps() from cairo-gstate.c to here and rename it.
Reviewed by: otaylor
|
|
|
|
|
|
|
|
|
|
| |
time of cairo_gstate_set_source() to "lock" the user space matrix.
Move the source pattern transformation to the outside of _cairo_gstate_clip_and_composite_trapezoids() instead of doing it at the leaves.
Change size of output surface for aesthetics.
Updated to correspond to the current definition.
Remove source-surface-scale-paint.
reviewed by: cworth
|
|
|
|
|
|
|
|
| |
Add cairo_{get,set}_font_options().
Add cairo-xlib-private.h
Update
reviewed by: cworth
|
|
|
|
|
|
|
| |
different functions corresponding to the three different clipping modes.
Add NULL pointers for intersect_clip_path.
New test case to exercise PDF clipping code.
|
|
|
|
| |
wrapped.
|
| |
|
|
|
|
| |
font_weight). Reorder fields to match between declaration and initialization and to put the most problematic fields (surface and source) at the end. No intended changes in functionality.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tracked clipping sets that are loaded into the surface on demand just before each rendering operation. This permits multiple cairo_t contexts to reference a surface without regard to ordering of operations among the contexts.
Also in this patch is a change to the xlib surface that creates two separate Pictures, one for source and one for destination operands which separates the source clipping from destination clipping. Cairo now specifies that sources are never clipped by any clipping applied to them as destinations.
Move cairo_clip_t (renamed from cairo_clip_rec_t) from cairoint.h to cairo-gstate-private.h. Eliminate stack of clip state from surfaces. Add new surface clipping API.
Manage clip objects entirely within the gstate, loading the whole thing into the surface just before drawing.
Source surfaces need not have clipping modified as the surface interface now specifies that source surfaces are always unclipped.
Eliminate nested clipping contexts, leaving clip management entirely to the gstate. Create new clip API for the gstate which uses per-surface serial numbers to match gstate clipping against current surface clipping values.
Surfaces no longer track clipping regions at all, so the old _cairo_surface_get_clip_extents has been replaced with _cairo_surface_get_extents. For PDF/PS surfaces, this function is expected to return a rectangle covering the entire fixed point coordinate space to leave rendering unclipped by the surface.
Region clipping capability is now signalled by a non-NULL function pointer in set_clip_region.
Each surface now contains two Pictures, one for source and one for destination operands so that source operands are never clipped by destination clipping.
CAIRO_STATUS_BAD_NESTING removed
self-copy now passes (Xlib only, until libpixman changes land)
reviewed by: krh, otaylor, cworth
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add cairo_stroke_preserve, cairo_fill_preserve, and cairo_clip_preserve.
Rip the path out of cairo_gstate_t.
Add path to cairo_t.
Bring in most of the path code that used to live in cairo-gstate.c
Move arc generation code into its own file.
Accept path+ctm_inverse+tolerance instead of gstate. Absorb flattening and device space->user space conversion that used to be in _cairo_gstate_intepret_path.
Prefer cairo_fixed_t parameters over ciaro_point_t for cross-file interfaces.
Track changes in _cairo_path_fixed interfaces.
Port to use cairo_fill_preserve rather than cairo_save/cairo_restore which no longer work for saving the path.
Remove get and set of current point since it is no longer affected by cairo_save and cairo_restore. Add get and set testing for cairo_matrix_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
functions to be named as _cairo_path_fixed functions.
Track name change of cairo_path_real_t and _cairo_path_fixed functions.
|
|
cairo_t, cairo_gstate_t, and cairo_path_real_t into their own header files.
Track changes to header files, reaching into the new private headers where necessary.
|