Commit graph

8775 commits

Author SHA1 Message Date
Andrea Canciani
7668323649 perf: Improve calibration
Make the loops count depend on the actual calibration_loops/calibration_time
instead of calibration_loops/calibration_max_time.
This avoids having some tests take much less/more than the wanted time per iteration
(I was having some tests taking about 1 second, other taking about 7 seconds when
the ms_per_iteration was 2000)

Spend 0.5-1 times the time wanted for each iteration in calibration, increase the
accuracy of loops count. Just making the loops count be the correct ratio doesn't
guarantee that the iteration time is accurate. By actually measuring iteration
times until it gets greater than 1/4 of the wanted time, the total sum is bound
to be <= the wanted iteration time and last calibration time is between 1/4 and
1/2 of the wanted time, so it should give a very accurate loop count.
2010-08-09 19:19:04 +02:00
Rich Walsh
046b642db0 os2: Restore surface type checking in the get_extents method. 2010-08-08 22:33:43 +03:00
Rich Walsh
78bdd87b75 os2: Fix clipping to bounds when blitting pixels.
The bounds checks on the rectangle to blit were done
after converting target/source to inclusive/noninclusive
coordinates rather than before, potentially causing an
off-by-one in the sizes, since the same logic was applied
to both inclusive and non-inclusive coordinates.  This
patch enforces bounds up front.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
d0284687b3 os2: Tweak an inline declaration.
C99 and cairo prefers "static inline <return type>" rather
than "static <return type> inline".

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
cb30340064 os2: Consolidate error paths of cairo_os2_surface_create().
Use a single code path to release the resources acquired
for a surface that's been partially constructed, rather than
have multiple error exits which each release the resources
acquired so far.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
66e3d650fe os2: Document ownership of OS/2 objects passed to surfaces.
Clarify the documentation for cairo_os2_surface_create()
and cairo_os2_surface_set_hwnd() to note that the ownership
of the presentation space and window respectively
remains with the caller.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
0152527154 os2: Don't fake an Anchor Block when one isn't needed.
The code was being tricky about passing in a HAB to
DevOpenDC() even though one isn't needed at all under
OS/2.  Pass in NULL instead.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
883d9725e0 os2: Fix buffer allocator behaviour on arithmetic overflow.
On arithmetic overflow the buffer allocator would attempt
to allocate zero bytes instead of failing the allocation.
Depending on the implementation of the underlying allocator
being proxied, this may result in an allocation of a zero
length buffer, causing all kinds of grief.  This patch
causes arithmetic overflows to explicitly fail the allocation.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:40 +03:00
Rich Walsh
b54037828c os2: Fix blitting 24 bpp pixel data.
There's a format mismatch between cairo's pixel formats
and OS/2 24 bpp data: the individual pixels in OS/2 take
only three bytes per pixel, but there needs to be padding
between lines to make the start of a line always be aligned
at a DWORD boundary.

This patch fixes the format conversion code to include
the required padding between rows.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08 22:29:39 +03:00
Rich Walsh
5aadecb3ac os2: New API to create surfaces without a persistent HPS.
It's not always necessary to create a presentation space (HPS) for
surface tied to a window, as the user may have one already.  This patch
introduces three new functions to create a surface without an HPS
and let the user manage an HPS associated with the surface.

Thread "OS/2 surface fixes" on cairo-l:
http://lists.cairographics.org/archives/cairo/2010-July/020343.html

Mozilla Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=557159
2010-08-08 22:29:39 +03:00
Benjamin Otte
9669faa936 gl: Handle errors from _cairo_gl_gradient_render()
Thanks Andrea for finding this.
2010-08-08 17:23:05 +02:00
Benjamin Otte
e31b56e020 configure: Fix gobject handling
1) Explicitly depend on glib, too.
2) Don't link gobject into libcairo proper (thanks Joonas for noticing).
2010-08-08 16:09:13 +02:00
Andrea Canciani
ae2b7b13cd pattern: Simplify degenerate linear pattern to solid colors
Degenerate linear patterns are considered clear if they have
EXTEND_NONE, the average of the first and the last stop if they are
EXTEND_PAD, the weighted average of the stops (based on the size of
the interpolation range in which they are active, just like integrating
over the whole interpolation range and taking the average) if they are
EXTEND_REPEAT or EXTEND_REFLECT.

Fixes degenerate-linear-gradient
2010-08-08 12:07:08 +02:00
Andrea Canciani
d54a5a9fc9 pattern: Add gradient degeneracy testing functions
Introduce two new (private) functions for testing the degeneracy of linear
and radial gradients and use them instead of verbose (and error-prone) tests.
2010-08-08 10:53:51 +02:00
Andrea Canciani
63434bc438 gstate: Correct comment 2010-08-08 10:53:51 +02:00
Andrea Canciani
28cd511fb9 Correct color stops comparison function
Two clear stops with different "underlying" colors must be considered
different, since when interpolated with non-clear colors they will
produce different results.
2010-08-08 10:53:44 +02:00
Andrea Canciani
f71a618bd2 Fix configuration if gobject is absent
Autodetect gobject and only use it if present.
Its absence is not to be considered a failure since it's not required.
2010-08-07 21:32:09 +02:00
Benjamin Otte
661f4859cd Add cairo-gobject library
This library is supposed to contain GType declarations for Cairo types.
It is also meant to support gobject-introspection binding creation.
2010-08-07 20:19:27 +02:00
Søren Sandmann Pedersen
fc4e8f0363 Update documentation to reflect that rgb565 is no longer deprecated. 2010-08-07 12:10:49 -04:00
Andrea Canciani
de606af5d6 quartz: improve backend detection
Quartz previously crashed with NULL backends and didn't check for
the backend type when getting a CGContext from a quartz surface,
returning meaningless data for subsurfaces.
2010-08-07 12:37:22 +02:00
Andrea Canciani
056ce165c4 quartz: fix solid masking fallback
Falling back when painting would ignore the alpha value (which is
needed to have the correct mask opacity).
_cairo_quartz_surface_paint_cg doesn't fallback, so the usual mask
fallback path is now taken, as expected.
2010-08-07 12:21:06 +02:00
Andrea Canciani
bdeade14ea quartz: fix stroking with unbounded operators
Self-intersecting strokes were drawn incorrectly when an unbounded
operator was used, since the fixup operation also cleared the
intersection.

Fixes clip-stroke-unbounded.
2010-08-06 20:24:52 +02:00
Andrea Canciani
8f38d2aa29 test: improve clip-*-unbounded tests
Merge clip-*-unbounded tests and add self-intersections to the paths
that are drawn. This exposes a bug in the unbounded fixup code in quartz.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-06 19:36:37 +02:00
Benjamin Otte
142df6f963 configure: Disable xml backend by default
We don't want to enable it by default when nobody uses it.
2010-07-30 22:27:28 +02:00
Benjamin Otte
9f33f8453b configure: Disable tee backend by default
We don't want to enable it by default when nobody uses it.
2010-07-30 22:27:27 +02:00
Benjamin Otte
9f4d677e2a tee: Move definitions into separate header 2010-07-30 22:27:08 +02:00
Kristian Høgsberg
14639e6b85 egl: Use EGL_KHR_surfaceless_opengl extension when available
This lets us avoid creating a throwaway pbuffer just to make the
context current.
2010-07-28 23:17:42 -04:00
Chris Wilson
b6fd673d37 version: 1.9.15 post-snapshot bump 2010-07-26 13:15:38 +01:00
Chris Wilson
ed8c6f4254 version: 1.9.14 snapshot 2010-07-26 12:53:44 +01:00
Chris Wilson
81094cf462 NEWS: 1.9.14 2010-07-26 12:52:56 +01:00
Andrea Canciani
c1fcbd0322 quartz: fix REFLECT radial gradients
The interpolation range of repeating radial gradients can safely be
reflected around any integer (previously 0), but for reflect-extended
radial gradients can only be reflected around odd integers if the
appearance is to be the same, thus reflecting around 1 is correct for both.

Fixes radial-gradient.
2010-07-26 11:39:27 +02:00
Chris Wilson
3898e46d1d image: Compensate mask origins for glyph clipping
Fixes the regression in bitmap-font and large-font pointed out by Andrea
Canciani since ef067933.
2010-07-23 09:44:00 +01:00
M Joonas Pihlaja
53fcfc781e build: Typos in comments.
Fix inline "dnl" strings left over from a string
substitution "--" -> "dnl".
2010-07-21 22:39:40 +03:00
Hib Eris
fd1e731c9d build: Fix pthread detection code when there isn't one.
The code was testing the output variable $use_pthread rather than
the input variable $enable_pthread when checking that pthreads
were actually found when requested.
2010-07-21 22:34:05 +03:00
Karl Tomlinson
108b1c7825 clip: consider gstate target extents in _cairo_gstate_copy_clip_rectangle_list
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29125

To be consistent with _cairo_gstate_clip_extents, the context's clip
should be intersected with the target surface extents (instead of only
using them when there is no clip).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-17 11:32:02 +01:00
Karl Tomlinson
b79ea8a6ca clip: consider all_clipped in _cairo_clip_get_extents
If the gstate clip in _cairo_gstate_int_clip_extents() has all_clipped
set (and path NULL), then it returns the gstate target extents instead of
an empty rectangle.  If the target is infinite, then it says the clip is
unbounded.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29124
Tested-by test/get-clip

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-17 11:30:51 +01:00
Karl Tomlinson
6a51159013 test: return CAIRO_TEST_FAILURE from get-clip preamble on failure
https://bugs.freedesktop.org/show_bug.cgi?id=29120
2010-07-17 11:30:35 +01:00
Karl Tomlinson
f2fa15680e clip: return empty clip from _cairo_clip_copy_rectangle_list when all_clipped
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29122
Tested by test/get-clip

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-17 11:29:54 +01:00
Karl Tomlinson
33ac203587 test: use the surface size expected in get-clip phase "No clip set"
https://bugs.freedesktop.org/show_bug.cgi?id=29121
2010-07-17 11:22:28 +01:00
Chris Wilson
bac5c28a18 boilerplate: Offset the xlib window
An idea courtesy of Benjamin Otte is to stress the drivers a bit more by
not rendering to 0,0. Under various circumstances rendering to a Window
is mapped onto the Screen root Window with a collection of offsets and
clips by X. It is easy for the driver to make a mistake and misrender...
2010-07-17 10:09:14 +01:00
Benjamin Otte
51b0c21f02 build: Add explicit dependcy to cxx lib
Otherwise the build will fail because it doesn't add the dependency
manually.

https://bugs.freedesktop.org/show_bug.cgi?id=29114
2010-07-16 19:49:53 +02:00
Oleg Romashin
6b92d5a0f9 qt: Use native glyph rendering.
Remove the hack of using the xlib surface to do glyph rendering and use
the new interface introduced with Qt4.7, or else fallback to image
rendering with freetype.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
[2 files changed, 35 insertions(+), 140 deletions(-) \o/]
2010-07-16 09:49:42 +01:00
Chris Wilson
f53f072a22 clip: Do the NULL check before the dereference.
Breakage introduced in the commit earlier today.
2010-07-12 18:53:29 +01:00
Chris Wilson
ef0679333d image: Manually clip against bounds when rendering directly
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.
2010-07-12 16:33:42 +01:00
Chris Wilson
679e5a600b Differentiate between reducing clip to composite extents and a rectangle
This is required for handling glyphs when rendering directly to the
surface.
2010-07-12 16:33:38 +01:00
Chris Wilson
8546a87788 test: Add partial-clip-text
This exercises a bug found by Igor Nikitin:

  https://bugs.freedesktop.org/show_bug.cgi?id=29008
2010-07-12 16:33:38 +01:00
Chris Wilson
53ee897449 version: Post-snapshot bump to 1.9.13 2010-07-12 12:37:31 +01:00
Chris Wilson
aa4cd8287f version: 1.9.12 snapshot 2010-07-12 12:19:54 +01:00
Chris Wilson
53b129dd8a NEWS for 1.9.12. 2010-07-12 12:19:54 +01:00
Chris Wilson
01380f3a56 test: Missing REFERENCE_IMAGES 2010-07-12 11:50:42 +01:00