Commit graph

8614 commits

Author SHA1 Message Date
M Joonas Pihlaja
616e35d1fa boilerplate: Remove the xlib-window target from Renderless builds.
I don't know why _cairo_boilerplate_xlib_window_create_surface()
is in the Render-only section of the code, but since it is, this
patch makes the boilerplate at least compile if we don't have
Render support built in.
2010-06-24 15:02:53 +03:00
Søren Sandmann Pedersen
aed744008d test: Fix typo in copyright statement 2010-06-24 05:39:00 -04:00
Soeren Sandmann
5c7e1dd690 test: Add an example of seams.
A pair of perfectly conjoint quads should not produce a seam when
accumulating into a temporary mask. Yet here is an example of where they
do!
2010-06-24 10:13:22 +01:00
Benjamin Otte
413ec4b708 gl: Return a surface from _cairo_surface_create_in_error()
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-22 23:19:32 +02:00
Benjamin Otte
a4e292507c gl: Propagate surface creation error instead of crashing 2010-06-22 22:01:25 +02:00
Benjamin Otte
faa4e6761c egl: Copy glx code to detect the proper surface in acquire 2010-06-22 20:21:15 +02:00
Benjamin Otte
76a721f7e9 egl: Remove unused prev_foo usage 2010-06-22 20:21:15 +02:00
Chris Wilson
b8051ee985 script: Pass the buffer length back to freetype.
After querying the required size, inform the backend of the allocated
size of the buffer.
2010-06-19 18:09:27 +01:00
Chris Wilson
8ac9a9df24 xcb: Return the status upon flushing the device.
The vfunc was updated to expect the status return, so supply it.
2010-06-19 13:23:50 +01:00
Chris Wilson
9fffc0e120 xlib: Precise and Imprecise were reversed.
The intention was to switch to imprecise mode by default, using the
exact rendering mode only upon request.
2010-06-19 11:15:13 +01:00
Chris Wilson
b322b2e619 xlib: Perform image uploads inplace.
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-19 10:52:52 +01:00
Benjamin Otte
c3eb95bf66 egl: Fail properly if no configs are available instead of crashing 2010-06-18 19:26:07 +02:00
Benjamin Otte
3908d80f57 glx: Remove useless optimization trying to avoid glXMakeCurrent()
The optimization is not performance-relevant. And having less code is
always a good idea.
2010-06-18 16:31:52 +02:00
Benjamin Otte
64f90322f7 gl: Refactor status handling in _cairo_gl_context_release()
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-18 16:31:52 +02:00
Benjamin Otte
fc3d521c12 gl: Inline the check_error() function 2010-06-18 16:31:52 +02:00
Benjamin Otte
9d7fa28913 gl: Don't assert if there used to be a GL error
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-18 16:31:52 +02:00
Benjamin Otte
0f9a8cd18f gl: Add a custom glGetError() function
This function clears all errors and returns the first one that happened.
2010-06-18 16:31:52 +02:00
Benjamin Otte
8048d3aa0a gl: Remove custom fprintf fudging on GL errors
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-18 16:31:52 +02:00
Benjamin Otte
f4da5048bf gl: cairo_warn about return value from cairo_gl_context_release() 2010-06-18 16:31:51 +02:00
Benjamin Otte
d9179f480a boilerplate: Reinstate glFinish() for wgl
It was accidentally disabled.
2010-06-18 16:31:51 +02:00
Kristian Høgsberg
67e84d6123 egl: Implement acquire and release for EGL backend 2010-06-18 10:12:06 -04:00
Chris Wilson
7ab9ce1b91 image: Make a local copy of the trap coordinates as the boxes alias.
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-17 15:47:04 +01:00
Chris Wilson
f2645fa361 test: Add a1-bug
Capture a bug report from "cairouser" where a1 rasterisation is now
broken.
2010-06-17 15:46:50 +01:00
M Joonas Pihlaja
800e977c2e perf: Allow comparing perf reports with only one difference.
The cairo-perf-diff-files tool would ignore perf reports with
just one test for no apparent reason.  The traces take so long
that it's useful to be able to compare runs with just one trace.
2010-06-17 14:27:13 +03:00
Chris Wilson
29b8cfd2b6 test/halo: Remove copied code.
How did that get there? I obviously ran the test to generate the output,
so where did it spring as it is the old version of the function?

From 16364768d7.

Mysteries will never cease.
2010-06-17 10:13:18 +01:00
Zoxc
a9a22649e2 wgl: Only reset GL context on the dummy window.
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-17 09:21:07 +01:00
Zoxc
ca35e09ece gl: Added wgl boilerplate and moved the glx and egl boilerplates into their own files. 2010-06-17 09:21:07 +01:00
Zoxc
2af3262895 wgl: Renamed hwnd field to wnd. 2010-06-17 09:09:21 +01:00
Nicolaus L Helper
7a023a62f7 ft,fc,xlib: LCD filtering patch.
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-17 09:06:13 +01:00
Chris Wilson
36b4b0631c image: Use consistent rounding modes for a1 rasterisation.
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-17 08:55:19 +01:00
Chris Wilson
3306bcb1d9 fixed: Refactor code to use more inlines and less duplication of logic.
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-17 08:55:19 +01:00
Chris Wilson
c0dee7964c test: Add a1-rasterisation
Check the rounding criteria when rasterising.
2010-06-17 08:55:19 +01:00
Chris Wilson
16364768d7 test/halo: Transformation seems key to the bug... 2010-06-17 08:55:19 +01:00
Andrea Canciani
cb28e0bfeb test: correct options in getopt call
'k' was missing and 't' was present but unhandled. Options have been
reordered according to the "USAGE" ordering.
2010-06-17 08:42:39 +02:00
Andrea Canciani
3cd0755932 correct rounding computation
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-16 22:59:46 +02:00
Chris Wilson
8689d75caa test/halo: Transformation seems key to the bug...
Only it is actually transformation of the result that is required in
order to magnify the effect to a detectable level.
2010-06-16 15:40:42 +01:00
Chris Wilson
71936a1f41 test/aliasing: Add a few more colour combinations.
In particular, compare red against its inverse, cyan. Etc.
2010-06-15 21:36:15 +01:00
Chris Wilson
e2220a1f3a configure: Try an alternate name for system glew. 2010-06-15 11:45:54 +01:00
Chris Wilson
25ec0c1e9b build: Enable system GLEW on non-UNIX platforms 2010-06-15 10:59:01 +01:00
Chris Wilson
5262444663 glew: Define NULL 2010-06-15 10:40:36 +01:00
Chris Wilson
56d06b088b test: Add an aliasing test case.
Just a simple test in drawing neighbouring edges and looking for the
effects of aliasing.
2010-06-14 22:58:38 +01:00
Chris Wilson
4b39f02bf7 test: Add halo
halo uses text_path + stroke + (fill | show_text)  to generate a "halo"
around the string. This is to try to replicate a bug described by Ian
Britten in the PDF backend where the rendering of the show_text looked
distorted compared to the stroke.
2010-06-14 20:40:56 +01:00
Chris Wilson
072a200ec5 build: Add wgl to Makefile.sources and regenerate features. 2010-06-14 16:05:14 +01:00
Dmitri Vorobiev
4a0bd91ff7 scaled-font: fine-tune caching
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-14 15:33:51 +01:00
Zoxc
505a0456d2 gl: Added WGL context and surface. 2010-06-14 12:46:26 +01:00
Zoxc
fd6c38b9e0 win32: Fixed compile errors in Windows backend. 2010-06-14 12:44:20 +01:00
Chris Wilson
5f10139cd9 NEWS: A couple more tweaks
I only spotted these in the release announcement.
2010-06-13 12:33:10 +01:00
Chris Wilson
4932aaa317 version: 1.9.9
Post-snapshot bump.
2010-06-13 12:02:53 +01:00
Chris Wilson
3a20b10cd0 version: 1.9.8
Snapshot time!
2010-06-13 11:40:40 +01:00
Andrea Canciani
b612a23086 test: update quartz ref images in makefile 2010-06-13 12:30:11 +02:00