summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2009-10-30path: Skip any secondary degenerate line-to segments.Chris Wilson1-3/+10
Only the very first line-to following a move-to can have any significance if degenerate whilst stroking, so skip all others. In other words, 0 0 m 0 0 l stroke produces a capped degenerate path (i.e a dot), 0 0 m 0 0 l 0 0 l stroke produces the same degenerate stroke, and 0 0 m 0 0 l 1 0 l stroke produce a horizontal line.
2009-10-30path: Misclassification of rectilinear after degenerate line-toChris Wilson1-49/+52
Malte Nuhn reported hitting an assertion: cairo-path-stroke.c:1816: _cairo_rectilinear_stroker_line_to: Assertion `a->x == b->x || a->y == b->y' failed. http://bugs.freedesktop.org/show_bug.cgi?id=24797 when stroking an apparently simple path: 0 8.626485 m 0 8.626485 l 5.208333 2.5 l 10.416667 2.5 l 15.625 2.5 l 20.833333 2.5 l 26.041667 2.5 l 31.25 2.5 l 36.458333 2.5 l 41.666667 2.5 l 46.875 2.5 l 52.083333 2.5 l 57.291667 2.5 l 62.5 2.5 l 67.708333 2.5 l 72.916667 2.5 l 78.125 2.5 l 83.333333 2.5 l 88.541667 2.5 l 93.75 2.5 l 98.958333 2.5 l 104.166667 2.5 l 109.375 2.5 l 114.583333 2.5 l 119.791667 2.5 l 125 2.5 l stroke which upon reduction becomes: 0.000000 8.625000 m 5.207031 2.500000 l 125.000000 2.500000 l stroke The bug is that after spotting a repeated line-to we move the previous end-point without reclassifying the path, hence we miss the non-rectilinear step.
2009-10-29Provide a builtin implementation of isspace() and isdigit()Adrian Johnson4-17/+28
The glibc versions are slow in utf8 locales.
2009-10-27xlib: Set has_component_alpha = FALSE for gradient PicturesChris Wilson1-0/+1
Whilst creating the xlib surface wrapper for gradient Pictures, the corresponding attributes require ComponentAlpha disabled.
2009-10-26scaled-font: Fix documentation examples with incorrect derefsChris Wilson1-10/+10
Bug 24730 -- New: misleading use cases in cairo_scaled_font_text_to_glyphs's docs http://bugs.freedesktop.org/show_bug.cgi?id=24730 An apparent copy'n'paste error from the code which has to deal with indirect pointers crept into the documentation for the same functions.
2009-10-25wideint: Protect 64_32_div for non-HAVE_UINT16_T systemsChris Wilson1-0/+5
Peter Clifton spotted that we failed to properly wrap _cairo_int64_32_div() for systems without a native 64 bit type.
2009-10-23[pattern] Compute zero extents for empty patternsChris Wilson1-3/+24
If the pattern is for example a repeating 0x0 image, then treat it as having zero extents. This should workaround the bug presented here: https://bugs.freedesktop.org/show_bug.cgi?id=24693 Attached PDF crashes evince with a Floating point exception
2009-10-22[meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja27-582/+582
The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-10-21Support component-alpha.Chris Wilson14-134/+234
Within our code base we carried a few hacks to utilize the component alpha capabilities of pixman, whilst not supporting the concept for our own masks. Thus we were setting it upon the pixman_image_t that we passed around through code that was blissfully unaware and indeed the component-alpha property was forgotten (e.g. upgrading glyph masks). The real issue is that without explicit support that a pattern carries subpixel masking information, that information is lost when using that pattern with composite. Again we can look at the example of compositing a sub-pixel glyph mask onto a remote xlib surface for further failure.
2009-10-21[gl] Do not clear internal surfaces.Chris Wilson1-15/+31
Create a scratch surface that will be initialised as required for internal use. External surfaces, i.e. those returned to the user, are cleared as normal.
2009-10-21Make the surface->is_clear logic commonChris Wilson5-54/+68
A nasty surprise whilst profiling is that performing redundant clear operations is extremely painful. We can mitigate this somewhat by tracking the cleared state of surfaces and skipping repeated attempts to clear a surface.
2009-10-21[doc] Add comments on when surfaces are cleared on construction.Chris Wilson1-0/+9
Or perhaps, more importantly, when the contents are left unmodified.
2009-10-19atomic: correct libatomic_ops version of _cairo_atomic_int_cmpxchgLuo Jinghua1-1/+1
AO_compare_and_swap_full() doesn't have the same semantic as _cairo_atomic_int_cmpxchg(). The former returns a TRUE on success FALSE otherwise while the later returns the atomic value.
2009-10-18[gstate] Apply target device offsets to patterns immediatelyBenjamin Otte3-94/+10
Previously target device offsets were applied in cairo-surface.c which could cause bugs when paths were taken as fallbacks, as for example pointed out by ade55037ffa596b690c6a1051394589f76eb1f48 and quick-fixed by 79190d89853958ee8252440d35a662fabf122afd. The quick-fix is now unnecessary and was removed.
2009-10-18[clip] Remove non-existing functions from headerBenjamin Otte1-9/+0
2009-10-18[path] Fix compiler warningsBenjamin Otte1-4/+3
2009-10-18[xlib] Fix compiler warningsBenjamin Otte1-4/+4
2009-10-16[surface] Don't AND in the desired content.Chris Wilson13-62/+10
Gah, that was a horrible mistake. It was a flawed hack to create Pixmaps of the correct depth when cloning patterns for blitting to the xlib backend. However, it had the nasty side-effect of discarding alpha when targeting Window surfaces. The correct solution is to simply correct the Pixmap of the desired depth and render a matching pattern onto the surface - i.e. a reversal the current acquire -> clone. See the forthcoming revised xcb backend on how I should have done it originally.
2009-10-16[image] Clone the format for a similar surface with identical contentChris Wilson1-2/+9
Honour the incoming surface format when we are asked to create a similar surface with identical content. The goal of cairo_surface_create_similar() is to create an intermediate with similar characteristics to the original that can be used in place of the original and be quick to copy to the original. Matching the format for the same content, ensures that the blits between the two need only be a memcpy.
2009-10-16[fallback] Create intermediate surface with same content.Chris Wilson1-5/+7
The goal is to create a similar surface with an identical format to maximise performance in the subsequent blit, e.g. the xlib backend could make the similar surface with an identical depth and so use the core protocol, or the image surface could indeed make an identical copy so that pixman only has to do a fast memcpy. As there is no direct method to specify such a clone, we ask the backend for a similar surface of identical content, and trust that the semantics are clear enough for the intent to obvious.
2009-10-15[surface] Avoid double application of device offset when calling fill()Chris Wilson1-6/+35
_cairo_surface_fallback_paint() attempts to avoid a clipped operation if we can convert the paint into a fill of the clipmask. However by calling _cairo_surface_fill() we incur a double application of device offset to the source, triggering various failures. Company spotted this and managed to extract an excellent minimal test case, test/clip-device-offset. This commit fixes that failure.
2009-10-15[build] Link against pthread-stubsChris Wilson1-1/+1
Avoid pulling in the real pthread library if the application is single threaded and not using pthreads, by linking against pthread-stubs instead.
2009-10-15[atomic] Fallback to libatomic-ops-devChris Wilson5-20/+53
Use libatomic-ops-dev in preference to mutex-based atomics, if we do not have the builtin atomic intrinsics available.
2009-10-15[pattern] Compute extents for gradientsChris Wilson1-58/+126
As noted in the comments we could also compute the pattern extents for gradients with CAIRO_EXTEND_NONE under certain circumstances, i.e. radial gradients and device axis aligned linear gradients.
2009-10-02PDF: Fix regression caused by 1ae5a419Adrian Johnson1-4/+8
Bug 24240 acroread prints error message when printing
2009-10-02PDF: Fix regression caused by 1ae5a419Adrian Johnson1-1/+1
Bug 24240 first char missing when printing a PDF.
2009-09-30[xcb] Deferred error checking.Chris Wilson3-246/+504
XCB avoids the dreaded abort on XError mechanism by forcing the client to perform deferred error checking. So do so. This allows us to combine the fire-and-forget rendering model with accurate error checking, without killing the client or mixing our errors with theirs. XCB for the win!
2009-09-30[xlib] Suppress warning that should never have been.Chris Wilson1-1/+1
2009-09-30Fix truetype subset crashAdrian Johnson1-0/+1
Bug 24213
2009-09-30[API] Make _cairo_meta_surface_replay() private againBenjamin Otte11-40/+34
Replaying a meta surface can be achieved by using it as a source for a cairo_paint() so exporting a separate API is unnecesary and confusing. So after consulting Chris and Carl, we decided to remove the function again.
2009-09-29[xlib] XRequest bread crumbingChris Wilson1-0/+57
Add bread crumbs in the form of NoOperations that can be parsed by xtrace and very useful when debugging protocol/server errors.
2009-09-29[tessellator] Invalid conversion of list head to edge.Chris Wilson1-0/+2
When scanning for collinear right edges, we need to check that we do not go beyond the end of the array.
2009-09-29[xlib] Set proper bpp when computing format from masksBenjamin Otte1-0/+1
Fixing omission in caa9eed4646e78a62ffb49d9c4f48c0b351c7a7f
2009-09-29[xlib] Handle 24bpp formats during ditheringBenjamin Otte1-0/+10
2009-09-29[image] Fix masks computation for BGRx formatBenjamin Otte1-3/+3
Patch originally by Mark Kettenis
2009-09-28PS: Use standard page size names for some common sizesAdrian Johnson1-4/+62
Some PS viewers like gv use the label in the %PageMedia DSC comment as the displayed page size. The page names and sizes were obtained from the list at: http://www.gnu.org/software/gv/manual/html_node/Paper-Keywords-and-paper-size-in-points.html
2009-09-25PS: Add DocumentMedia/PageMedia DSC commentsAdrian Johnson2-0/+89
Provide default DocumentMedia and PageMedia DSC comments if the user does not specify them using cairo_ps_surface_dsc_comment(). This is required so that PostScript viewers such as gv use the correct page size.
2009-09-25[xlib] Handle case in draw_image() where pixman format is not RGBBenjamin Otte1-6/+44
When an image cannot be expressed as masks, its data cannot be used in an XImage. In that case, we use pixman to copy the image to the desired format.
2009-09-25[image] Return cairo_bool_t from _pixman_format_to_masksBenjamin Otte2-12/+11
Return FALSE when the pixman format does not support ARGB masks. In particular, return FALSE for YUV formats.
2009-09-23[image] Do not trust user supplied data to be clearChris Wilson1-1/+1
Gah, more important than the whitespace was the reversal of is_clear...
2009-09-23[image] Tweak coding styleChris Wilson1-4/+5
Whitespace spam.
2009-09-23[image] Move setting of is_clear to _create_with_pixman_format()Benjamin Otte1-12/+6
Simplifies code and ensures other users of that function don't run into the same bug.
2009-09-23[image] Do assumption initial user data is cleared.Chris Wilson1-4/+22
Benjamin Otte pointed out the error of my ways that a clear on a cairo_image_surface_create_for_data() was not working. This is because I modified the image surface to skip clears when it knows the target data has been cleared. This flag must be reset when the user interacts with the surface, such as providing the initial surface data.
2009-09-22[gl] Handle an absent visual.Chris Wilson2-3/+12
If we cannot find the correct visual for the fbconfig, return an error instead of crashing. The difference is subtle, granted.
2009-09-22win32-printing: correct the use of the CAIRO_HAS_WIN32_FONT #ifdefAdrian Johnson1-1/+1
it was wrapping code required for non windows fonts.
2009-09-22win32-printing: fix meta surface pattern regression caused by bed2701eAdrian Johnson1-0/+2
2009-09-22win32-printing: Allow GDI CTM with scale < 1 to be setAdrian Johnson2-19/+73
To better support creating EMF files with the win32-printing surface, allow a GDI CTM with scale < 1 to be used. http://lists.cairographics.org/archives/cairo/2009-September/018110.html
2009-09-22Make win32 fonts work in EMF files created by win32-printingAdrian Johnson1-0/+37
2009-09-22Fix compiler warnings in win32-surfaceAdrian Johnson1-3/+9
2009-09-22Fix compiler error on cygwinAdrian Johnson1-0/+1