summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2010-06-24gl: Add rectilinear boxes optimization from image backendHEADmasterBenjamin Otte1-0/+110
2010-06-22gl: Return a surface from _cairo_surface_create_in_error()Benjamin Otte1-1/+2
On error, surface creation functions should always return a surface created with _cairo_surface_create_in_error() instead of a new surface in an error state. This simplifies internal code as no refcounting has to be done.
2010-06-22gl: Propagate surface creation error instead of crashingBenjamin Otte1-6/+16
2010-06-22egl: Copy glx code to detect the proper surface in acquireBenjamin Otte1-0/+9
2010-06-22egl: Remove unused prev_foo usageBenjamin Otte1-7/+0
2010-06-19script: Pass the buffer length back to freetype.Chris Wilson1-1/+1
After querying the required size, inform the backend of the allocated size of the buffer.
2010-06-19xcb: Return the status upon flushing the device.Chris Wilson1-2/+3
The vfunc was updated to expect the status return, so supply it.
2010-06-19xlib: Precise and Imprecise were reversed.Chris Wilson1-4/+4
The intention was to switch to imprecise mode by default, using the exact rendering mode only upon request.
2010-06-19xlib: Perform image uploads inplace.Chris Wilson1-0/+112
Under the restrictive conditions where we are doing an untransformed contained upload of an image into a matching surface, perform it in place. The drivers will attempt to stream such uploads efficiently, far more so than our code.
2010-06-18glx: Remove useless optimization trying to avoid glXMakeCurrent()Benjamin Otte1-17/+2
The optimization is not performance-relevant. And having less code is always a good idea.
2010-06-18gl: Refactor status handling in _cairo_gl_context_release()Benjamin Otte6-43/+43
Previously, the code returned a status and required the caller to mangle this status with his own status. Now, the function takes the previous status ass an argument and does the mangling itself. Also contains fixes for all the callers to actually check the return value - which is now rather trivial as it just requires passing through the status variable.
2010-06-18gl: Inline the check_error() functionBenjamin Otte1-16/+7
2010-06-18gl: Don't assert if there used to be a GL errorBenjamin Otte1-1/+2
When acquiring the GL context, do not assert that the GL context is not in an error state. Do not even call _cairo_error(). Handling GL errors in other code is not Cairo's responsibility. Instead just clear all previous errors so we don't accidentally set surfaces into error states to unrelated errors.
2010-06-18gl: Add a custom glGetError() functionBenjamin Otte1-3/+16
This function clears all errors and returns the first one that happened.
2010-06-18gl: Remove custom fprintf fudging on GL errorsBenjamin Otte2-26/+1
Now that we probably call _cairo_error() on every GL error, there is no need to use custom methods to catch those errors. The usual breakpoint is enough.
2010-06-18gl: cairo_warn about return value from cairo_gl_context_release()Benjamin Otte1-1/+1
2010-06-18egl: Implement acquire and release for EGL backendKristian Høgsberg1-9/+37
2010-06-17image: Make a local copy of the trap coordinates as the boxes alias.Chris Wilson1-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.
2010-06-17wgl: Only reset GL context on the dummy window.Zoxc1-4/+2
This changes the WGL context destruction code to only reset the GL context for the dummy window, since doing it on <nothing> is an invalid operation.
2010-06-17gl: Added wgl boilerplate and moved the glx and egl boilerplates into their ↵Zoxc1-0/+8
own files.
2010-06-17wgl: Renamed hwnd field to wnd.Zoxc1-6/+6
2010-06-17ft,fc,xlib: LCD filtering patch.Nicolaus L Helper6-190/+597
This adds internal API to retrieve the LCD filtering parameters from fontconfig, or as set on the Screen, and feed them to FreeType when rendering the glyph. References: Bug 10301 - LCD filtering patch https://bugs.freedesktop.org/show_bug.cgi?id=10301 Tested-by: Brandon Wright <bearoso@gmail.com> Forward-ported-by: Robert Hooker <sarvatt@gmail.cm> ickle: The API is clearly not ready for public consumption, the enum are poorly named, however this stands by itself as enabling system wide properties.
2010-06-17image: Use consistent rounding modes for a1 rasterisation.Chris Wilson1-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
2010-06-17fixed: Refactor code to use more inlines and less duplication of logic.Chris Wilson1-3/+15
This also has the side-effect of fixing the types in the problematic functions which hid Andrea's true fix for the unsigned FRAC_MASK.
2010-06-16correct rounding computationAndrea Canciani1-1/+1
cairo_fixed_integer_round[_down] were adding an unsigned mask value before shifting its result, causing the shift to be computed as logical (unsigned) right shift, thus producing incorrect values for negative inputs. Making the mask value signed fixes this issue. Bug report by cu: http://lists.cairographics.org/archives/cairo/2010-June/020115.html
2010-06-15glew: Define NULLChris Wilson1-0/+4
2010-06-14build: Add wgl to Makefile.sources and regenerate features.Chris Wilson2-2/+18
2010-06-14scaled-font: fine-tune cachingDmitri Vorobiev1-16/+45
This patch implements the ideas outlined by Behdad Esfahbod in the following mailing list message: http://lists.cairographics.org/archives/cairo/2010-June/020065.html Specifically, two things have been adjusted. First, the size of the look-up table was reduced to 64. Second, cache codepath is now bypassed for strings that are shorter than 16, not only for one-character strings. This allowed us to reduce the LUT initialization overhead while still retaining the advantage of caching for common-case string sizes. We have experimented with different LUT sizes, and it came out that the size of 64 is the best one in view of speed, at least for our language-neutral benchmark, which generated random strings of printable ASCII characters. Below is a table presenting benchmark results for different values of LUT size: =============================================================================== Benchmark | [1] | [2] | [3] | [4] | [5] | [6] | [7] =============================================================================== 8px text, 1 chars | 0.41 | 0.41 | 0 | 0.41 | 0 | 0.41 | 0 8px text, 10 chars | 2.13 | 2.21 | 3.76 | 2.19 | 2.82 | 2.09 | -1.88 8px text, 20 chars | 2.97 | 3.04 | 2.36 | 3.01 | 1.35 | 2.98 | 0.34 12px text, 1 chars | 0.94 | 0.94 | 0 | 0.95 | 1.06 | 0.94 | 0 12px text, 10 chars | 4.73 | 4.89 | 3.38 | 4.9 | 3.59 | 4.82 | 1.9 12px text, 20 chars | 6.32 | 6.42 | 1.58 | 6.46 | 2.22 | 6.32 | 0 16px text, 1 chars | 1.75 | 1.76 | 0.57 | 1.77 | 1.14 | 1.76 | 0.57 16px text, 10 chars | 8.13 | 8.45 | 3.94 | 8.43 | 3.69 | 8.44 | 3.81 16px text, 20 chars | 10.41 | 10.69 | 2.69 | 10.64 | 2.21 | 10.65 | 2.31 24px text, 1 chars | 3.3 | 3.3 | 0 | 3.32 | 0.61 | 3.3 | 0 24px text, 10 chars | 14.68 | 14.97 | 1.98 | 14.97 | 1.98 | 14.87 | 1.29 24px text, 20 chars | 17.93 | 18.01 | 0.45 | 18.06 | 0.73 | 17.81 | -0.67 96px text, 1 chars | 23.65 | 23.38 | -1.14 | 23.74 | 0.38 | 23.65 | 0 96px text, 5 chars | 50.52 | 51.34 | 1.62 | 51.48 | 1.9 | 51.41 | 1.76 96px text, 10 chars | 57.5 | 58.11 | 1.06 | 58.27 | 1.34 | 58.04 | 0.94 =============================================================================== [1]: Git head, Mpix/s [2]: {GLYPH_LUT_SIZE = 32, CACHING_THRESHOLD = 16} [3]: Gain of {32, 16} w.r.t. Git head [4]: {GLYPH_LUT_SIZE = 64, CACHING_THRESHOLD = 16} [5]: Gain of {64, 16} w.r.t. Git head [6]: {GLYPH_LUT_SIZE = 128, CACHING_THRESHOLD = 16} [7]: Gain of {128, 16} w.r.t. Git head The benchmark itself can be found from this mailing list message: http://lists.cairographics.org/archives/cairo/2010-June/020064.html
2010-06-14gl: Added WGL context and surface.Zoxc2-0/+269
2010-06-14win32: Fixed compile errors in Windows backend.Zoxc2-7/+6
2010-06-12gl: start returning the failure status aftern an invalid GL op.Chris Wilson5-36/+86
2010-06-12cairo: Create error objects for cairo_tChris Wilson4-11/+71
Perform an early check for error status and prevent creation of a full object. This means that we do not pass down error objects to the initialisation routines and so can survive without paranoia inside the library. It also has brings consistency that like the other constructors, no object is created in error and we can skip the cairo_destroy() if we choose (and we don't waste one of the precious zero-alloc context slots. Fixes crash in test/a8-mask introduced by 1a544361e845.
2010-06-11image: Apply component alpha to composite masks.Chris Wilson1-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.
2010-06-11pattern: Remove incorrect optimisations from _cairo_pattern_aquire_surface()Chris Wilson1-93/+17
Safe reduction of patterns is performed in gstate, so not only are the extra checks in _cairo_pattern_acquire_surface redundant there are also unsafe. Simply remove them. Fixes test/radial-gradient-extend [xlib-fallback]
2010-06-11pattern: Remove extraordinary _cairo_pattern_fini_snapshot().Chris Wilson3-32/+12
Miraculously the circular references from self-copy have disappeared and the forced finish within _cairo_pattern_fini_snapshot() now quite explosive. By replacing them with an ordinary _cairo_pattern_fini() the crash from test/smask-image-mask disappear along and valgrind remains happy. Fixes test/smask-image-mask and similar.
2010-06-11gstate: Update cached matrix state after device transform changes on the targetChris Wilson8-4/+96
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.
2010-06-11gl: make check insists "cairoint.h" is first.Chris Wilson1-3/+2
2010-06-11color: Mark _cairo_color_get_content() as private.Chris Wilson1-1/+1
2010-06-11xlib: Adjust trapezoid precision based on antialias.Chris Wilson2-0/+32
Render supports two modes of precision when rendering trapezoids. Precise specifies points sampling on a 15x17 grid, ala pixman. Imprecise allows the driver more freedom in the methods used, which may be more amenable to acceleration. Choose to use the imprecise mode by default, but still allow users to force the more rigidly specified precision by changing the antialias mode.
2010-06-11polygon: Reorder conditionals based on likelihood.Chris Wilson1-15/+15
The vast majority of edges will be unclipped, so process those first.
2010-06-11xlib: Find matching Visual for XRenderFormatKarl Tomlinson1-9/+65
Not only is this useful for users to know which Visual matches any particular Cairo surface, it should also close a few obscure bugs of not converting images correctly on upload. Fixes: Bug 28492 - cairo_xlib_surface_create_with_xrender_format does not create visual for resulting surface https://bugs.freedesktop.org/show_bug.cgi?id=28492 Mozilla Bug 567065 - Try to create offscreen Xlib surface from existing visual if possible https://bugzilla.mozilla.org/show_bug.cgi?id=567065 Mozilla Bug 445250 - cairo_draw_with_xlib should provide a non-NULL visual to callback https://bugzilla.mozilla.org/show_bug.cgi?id=445250 Reported-by: Oleg Romashin <romaxa@gmail.com>
2010-06-11path: Exponentially grow buffer based on populated points and ops.Chris Wilson2-21/+21
Instead of simply doubling the buffer size every time we overflow a point or an op, enlarge the buffer to fit twice the number of used points and ops. We expect paths to be fairly consistent in the mix of operations, and this allows the buffer size to tune itself to actual usage and reduce wastage.
2010-06-10gl: support single stop gradientsAndrea Canciani2-3/+2
2010-06-10ps: support single stop gradientsAndrea Canciani1-5/+4
2010-06-10pdf: support single stop gradientsAndrea Canciani1-3/+3
2010-06-10pattern: improve single stop gradients handlingAndrea Canciani1-1/+8
None-extended single stop gradients are now explicitly made clear.
2010-06-10pattern: improve degenerate gradients handlingAndrea Canciani1-10/+25
Degenerate radial gradients are now considered clear.
2010-06-10gstate: correct optimizationsAndrea Canciani1-68/+17
Gradient were previously hand-optimized (without properly checking for extend modes). By properly using _cairo_pattern functions we avoid code duplication and bugs. Fixes linear-gradient-extend, radial-gradient-extend.
2010-06-10pattern: add gradient_is_solid functionAndrea Canciani2-0/+58
It contains in a single place the logic needed to check if a gradient pattern is solid (within a specified region).
2010-06-10pattern: improve clear/opaque check functionsAndrea Canciani2-8/+108
_cairo_pattern_is_opaque was missing some checks about the extend type. Conversely _cairo_pattern_is_clear was being too strict about gradients.