summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface.c
Commit message (Collapse)AuthorAgeFilesLines
...
* pattern: Add observer hooksChris Wilson2011-07-151-0/+1
| | | | | | | | | In order for custom context to automatically track when a pattern is modify after being set on the context (and before it is used in an operator), we need for there to be a callback when the pattern is modified. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Implement cairo_backend_tChris Wilson2011-07-151-0/+3
| | | | | | | | | | 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>
* image: Only discard the outer boxesChris Wilson2011-07-141-4/+5
| | | | | | | This is necessary as the callers do not propagate the clip extents after finding the singular clip path. *sigh* Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: Don't crash on weird pixman formatsBenjamin Otte2011-06-081-7/+16
| | | | | | | | | | | | _pixel_to_solid() used to assert that it got a known cairo_format_t. However, this might not be the case when backends decide to use a pixman format that is not representable by a cairo format (X and DirectFB are examples for backends that do that). This patch makes _pixel_to_solid() return NULL in that case and fixes the callers to deal with it. https://bugs.freedesktop.org/show_bug.cgi?id=37916
* image: Fix pixman format to RGB30 conversionChris Wilson2011-05-041-2/+2
| | | | | | | | Søren Sandmann Pedersen spotted that we had reversed the channel order in the conversion back from the pixman format codes to CAIRO_FORMAT_RGB30. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Expose 30bpp/10bpc support: CAIRO_FORMAT_RGB30Jesse Barnes2011-05-011-2/+23
| | | | | | | | | | This is a common format used by framebuffers to drive 10bpc displays and is often hardware accelerated by XRender with underlying support from pixman's x2r10g10b10 format (which provides coercion paths for fallbacks). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: Don't use the fast path if it's wrongUli Schlachter2011-03-311-0/+5
| | | | | | | | | | | | Fixes the new "operator-source" test and the original report from: http://lists.cairographics.org/archives/cairo/2011-March/021827.html I tested this code path with all operators and "source" is the only one which causes issues with rendering outside of the boxes. Possibly fixes: https://bugs.freedesktop.org/show_bug.cgi?id=35407 Signed-off-by: Uli Schlachter <psychon@znc.in>
* image: Silence gcc warningAndrea Canciani2011-03-181-1/+1
| | | | | | | gcc does not know thta num_glyph is guaranteed to be strictly positive, so it complains that: cairo-image-surface.c:3787: warning: ‘status’ may be used uninitialized in this function
* image: Silence missing enum value warningAndrea Canciani2011-03-181-0/+1
| | | | cairo-image-surface.c:101: warning: enumeration value ‘PIXMAN_x14r6g6b6’ not handled in switch
* image: Fix surface acquisition if PIXMAN_HAS_ATOMIC_OPSAndrea Canciani2011-02-191-0/+4
| | | | | | | If PIXMAN_HAS_ATOMIC_OPS, ix and iy will be changed if the source surface is of subsurface type. They need to be reset to 0 before being passed to _cairo_matrix_to_pixman_matrix_offset() or the acquired surface will have an incorrect offset .
* image: Avoid reusing pixman images for threadsafety.M Joonas Pihlaja2011-02-191-24/+36
| | | | | | | | | | | | | | | | | | | | | The pixman_image_ref() and pixman_image_unref() functions aren't threadsafe in current pixman, so we can't share pixman images across contexts where they may end up moving between threads. The main use of these functions is in keeping a global cache of pixman_image_ts for solid colours and reusing the same pixman_image_t for patterns pointing to the same image data where possible. This patch removes those uses from cairo by wrapping them in a PIXMAN_HAS_ATOMIC_OPS conditional. There is no automatic test this, so we will have to manually turn this code back on when pixman does gain atomic ops. The only two remaining calls to pixman_image_ref() are done on locally created images so they are safe. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34177
* image: Limit span rendering to bounded extentsChris Wilson2011-02-061-0/+28
| | | | | | | | | | | | | | | We make the presumption that the incoming geometry is appropriately clipped to the bounded extents and can simply memset without being out of bounds. However, this was not always the case as we were removing the clip boxes in order to optimise the common case where the operation is naturally limited to the surface. (This is a candidate for 1.10) Bugzilla: https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/710072 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* doc: Add links to flush() and mark_dirty() in direct access functionsAndrea Canciani2011-01-161-0/+5
| | | | | | | | | | | cairo_image_get_data() and other direct access functions are often misused by applications because they don't call cairo_surface_flush() and/or cairo_surface_mark_dirty() around the code which accesses the surface data directly. Although this information is already available in the description of the cairo_surface_t type, adding a reminder about it in the direct access functions should make it easier to use them correctly.
* pattern: Factor out pattern rescalingAndrea Canciani2011-01-021-52/+12
| | | | | | | | | | | | | The same code was duplicated (incorrectly and with some minor differences) in pattern, image, xlib and xcb. _cairo_gradient_pattern_max_val() abstracts that code in a function that can be used whenever a gradients extremes need to be rescaled to fit within a given range. Fixes huge-linear, huge-radial. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* matrix: Cairo matrix to pixman transform/offset conversionAndrea Canciani2011-01-021-120/+44
| | | | | | | | | | | Xlib, XCB and image use the same code to convert a cairo_matrix_t to a backend-specific transform. The code did not handle correctly some matrices, thus a new function that performs the conversion in a more generic way was added and used in the backends instead of fixing the repeated code. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* Add mesh gradient rasterizerAndrea Canciani2011-01-011-0/+25
| | | | | Add an implementation of a fast and reasonably accurate non-antialiased mesh gradient rasterizer.
* polygon: Merge _cairo_polygon_init and _cairo_polygon_limitAndrea Canciani2010-12-101-4/+2
| | | | | | | _cairo_polygon_limit() had to be called immediately after _cairo_polygon_init() (or never at all). Merging the two calls is a simple way to enforce this rule.
* image: Fix _pixel_to_solidAndrea Canciani2010-11-281-1/+3
| | | | | | | An A1 image with full alpha should be opaque black, not opaque white. Use specialized solid black image instead of the generic constructor for an A8 image with full alpha (it is likely to be cached).
* image: Fix compositing of unaligned boxesAndrea Canciani2010-11-281-8/+14
| | | | | | | | | | | | | The input of _fill_unaligned_boxes is (supposed to be) composed only of disjoint rectangles, that can safely be passed to the rectilinear span converter, but this function artificially introduces intersecting rectangles when drawing non-aligned boxes. Using non-intersecting rectangles is easy and makes the code correct. Fixes rectilinear-grid. Reviewed-by: Uli Schlachter <psychon@znc.in>
* Fix fallback-resolution testAdrian Johnson2010-11-281-16/+41
| | | | | | | | | | | | | | The recording surface source image painted onto fallback images always had the resolution 72ppi instead of the fallback resolution of the target surface. Fix this by passing adding a new acquire_source_image_transformed backend function for the recording surface to use and passing the target device transform through to the recording surface when the image is acquired. Based on Carl Worth's experimental acquired_source_image_transformed branch. https://bugs.freedesktop.org/show_bug.cgi?id=24692
* image: Use correct size for allocationAndrea Canciani2010-11-011-2/+2
| | | | | | | In 06e9caf86199e8261a07db6d4774628fa147728d the type of the variables was changed, but the type used to compute the allocation size was not. Fixes a crash in user-font-mask (test-fallback backend).
* path: Do not access flags directlyAndrea Canciani2010-10-291-3/+3
| | | | | | | Use inline accessors to hide the flags in the code. This ensures that flags that need additional computations (example: is_rectilinear for the fill case) are always used correctly.
* raster backends: Set round_glpyh_positions to ONUli Schlachter2010-10-211-0/+1
| | | | | | | This fixes "text-rotate" in the test suite for the image backend and "overlapping-glyphs" for the xcb backend. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb,image: Fix a missing clip finiChris Wilson2010-10-151-1/+3
| | | | | | | Spotted by Uli Schlachter when I copied the image glyphs clipping to xcb. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: The a8 in-place span compositing is only valid for SOURCEChris Wilson2010-09-291-2/+7
| | | | | | | Fixes test/a8-clear. Reported-by: Jeremy Moles <jeremy@emperorlinux.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: Silence a compile warningChris Wilson2010-09-291-1/+1
| | | | | | | cairo-image-surface.c: In function ‘_cairo_image_reset_static_data’: cairo-image-surface.c:1006: warning: old-style function definition Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: add _cairo_image_reset_static_dataAndrea Canciani2010-09-091-8/+34
| | | | | | | | Image has static caches which needs to be reset to make cairo_debug_reset_static_data behave as expected. Silences a bunch of leak reports by check-valgrind. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
* subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE publicBenjamin Otte2010-08-261-1/+1
|
* image: Compensate mask origins for glyph clippingChris Wilson2010-07-231-1/+1
| | | | | Fixes the regression in bitmap-font and large-font pointed out by Andrea Canciani since ef067933.
* image: Manually clip against bounds when rendering directlyChris Wilson2010-07-121-4/+19
| | | | | | | | | | | | This is path is slightly peculiar in that it explicitly avoid the intermediate mask and the geometry is not pre-clipped. This in conjunction with the previous commit fixes: Clip doesn't work for text https://bugs.freedesktop.org/show_bug.cgi?id=29008 which is captured in test/partial-clip-text.
* Differentiate between reducing clip to composite extents and a rectangleChris Wilson2010-07-121-5/+5
| | | | | This is required for handling glyphs when rendering directly to the surface.
* doc: Move tmpl/ docs to inline docsBenjamin Otte2010-07-081-0/+21
| | | | | | I did this manually so I could review the docs at the same time. If anyone finds typos or other mistakes I did, please complain to me (or better: fix them).
* image: Make a local copy of the trap coordinates as the boxes alias.Chris Wilson2010-06-171-4/+11
| | | | | | | | As we transform the array of trapezoids into an array of boxes in-place, we must take local copies of the coordinates before writing into the boxes otherwise we may inadvertently modify the trapezoidal coordinates. Fixes test/a1-bug.
* image: Use consistent rounding modes for a1 rasterisation.Chris Wilson2010-06-171-23/+35
| | | | | | | | | | | When checking if the traps are equivalent to a set of rectangles, we need to use the same rounding mode as when converting the traps to a set of boxes and then filling them. Failure to do leads to a situation where (-127,-128) was thought to be equivalent to (0,0) but we attempted to fill from 0 to -1 instead. References: http://lists.cairographics.org/archives/cairo/2010-June/020115.html
* image: Apply component alpha to composite masks.Chris Wilson2010-06-111-16/+24
| | | | | | | | If we need to pattern requires component alpha, then we must take a copy of the image and enable component alpha for pixman. Fixes test/text-antialias-subpixel on xlib-fallback -- i.e. we will finally render subpixel antialiased text on ancient XServers.
* image: Fix wholly unbounded fixupBenjamin Otte2010-05-131-1/+1
| | | | Tested by zero-mask test.
* drm: code dump, sorry.Chris Wilson2010-05-121-1/+1
| | | | Lots upon lots of tiny fixes mixed in with experimental code. :(
* image: Propagate error instead of asserting.Chris Wilson2010-05-061-1/+2
| | | | | Apparently we can get to this point without evaluating the clip surface, so return the error status rather than assert.
* image: Propagate failure from pixman_image_set_clip_region()Chris Wilson2010-05-051-1/+8
|
* image: Propagate failure from pixman_image_fill_boxes().Chris Wilson2010-05-041-25/+30
|
* image: Check for pixman image allocation failure during glyphsChris Wilson2010-05-041-5/+3
|
* image: Replace assert with error returnChris Wilson2010-05-041-1/+2
| | | | | It is possible to encounter an allocation failure here since we may have tweaked the clip since the last evaluation of the clip region.
* image: A few missing tests for malloc failureChris Wilson2010-05-031-1/+11
|
* fallback: get src_x/y variables right when compositing trapsBenjamin Otte2010-05-031-1/+3
|
* image: remove useless optimizationBenjamin Otte2010-04-301-8/+3
| | | | | The optimization is done way smarter inside _cairo_matrix_transform_bounding_box()
* fallback: Create pixman image for correct rectangleBenjamin Otte2010-04-301-4/+4
| | | | | This was most prominently shown by the a1-image-sample test, but multiple tests exposed the problem with the xlib-fallback code.
* image: Simplify translation of pattern matrix for composite_trapezoids()Chris Wilson2010-04-301-3/+1
|
* image: Round down when rendering antialiased boxesBenjamin Otte2010-04-291-4/+5
| | | | Matches Pixman's output when going via pixman_rasterize_trapezoid()
* Remove excessive semicolonsBenjamin Otte2010-04-291-1/+1
| | | | s/;;/;/ basically
* image: translate source pattern in composite_trapezoids()Benjamin Otte2010-04-291-1/+7
| | | | Fixes xlib fallback paths as exposed by the clip-push-group test.