Commit graph

7886 commits

Author SHA1 Message Date
Alexander Shulgin
e11d2d0b4d surface: Fix detach mime-data after ecda633f88
Hi,

while browsing the git log I've noticed a small mistake in the above
commit, where we reversed the order of init/fini required to reset the
mime-data array.
2010-01-29 09:17:01 +00:00
Chris Wilson
5f0a0088af drm-intel: Unmap a full glyph cache.
When we swap a full glyph cache for a fresh one, be sure to unmap the
old one prior to release.
2010-01-28 13:23:39 +00:00
Chris Wilson
78cd947120 drm: Paranoid assert that the fallback is released upon finish. 2010-01-27 23:45:17 +00:00
Chris Wilson
5aa1191204 drm-intel: flush in memory modifications to texture.
If the surface was written to using a fallback, and so is mapped, we
need to flush those modifications by relinquishing the map. So the next
time the application tries to write to the surface, those writes are
correctly serialised with our reads.
2010-01-27 23:42:26 +00:00
Chris Wilson
a38accb694 drm-intel: The accumulation bo may be NULL, beware.
If we are not accumulating but rendering directly to the output vbo,
then the tail bo may not even be allocated, let alone mapped.
2010-01-27 23:27:46 +00:00
Chris Wilson
44734b9d3b drm-intel: Assert that the bo is unmapped upon release.
Check through error paths to catch a few more places where the mapped bo
may have been leaked, and add an assert to abort in case we do leak a
mapping.
2010-01-27 23:17:44 +00:00
Chris Wilson
6848c7c850 drm-i915: Don't tile temporary image textures.
As uploading to a tiled buffer is much slower than linear memory, don't
unless we expect to reuse the texture. This is not true for sub-image
clones, which are single shot affairs.
2010-01-27 23:01:37 +00:00
Chris Wilson
f75b7c4c11 drm/i915: Ensure surface is initialized.
Let's try that again, this time remembering to place it on the
conjunction of the two branches, so *both* paths are initialized.
2010-01-27 19:23:07 +00:00
Chris Wilson
02f20458d1 drm-i915: Ensure surface size for clone is initialized.
If the surface had a snapshot, then we would have not initialized the
surface size and so compute a bogus normalization matrix.
2010-01-27 19:02:21 +00:00
Chris Wilson
c82ff8cbcf configure: Enable AC_SYS_LARGEFILE for drm
drm makes use of 64bit offsets when mmaping, and so we require the
64bit file interfaces. I had presumed that it would be pulled in with
AC_GNU_SOURCE, but no.
2010-01-27 18:48:32 +00:00
Chris Wilson
6d2d338ac0 drm: compile fix for cairo_always_inline
s/always_inline/cairo_always_inline/
2010-01-27 17:55:28 +00:00
Benjamin Otte
58980b4ad6 build: Remove glitz surface
glitz is unmaintained and the GL surface is far superior anyway.
2010-01-27 09:56:14 +01:00
Benjamin Otte
17ddb1598b docs: appease make check 2010-01-25 20:17:12 +01:00
Benjamin Otte
bac513a85d build: Fix pthread detection
THe pthread.h detection code didn't pass -lpthread or -pthread to Cairo.
2010-01-25 20:13:48 +01:00
Benjamin Otte
582604f7b6 [png] Simplify coercion code
Call _cairo_image_surface_coerce() unconditionally to ensure coercion to
one of the standard formats happens even when it's a format we support.
2010-01-25 19:43:52 +01:00
Benjamin Otte
002e02715c Remove useless pixman version checks
We require pixman >= 0.15.16 in configure.ac, so checks for older
versions aren't required anymore.
2010-01-25 19:42:54 +01:00
Benjamin Otte
5a690ad4ac Give cairo_surface_mark_dirty() the slim hidden treatment
Fixes test suite failure
2010-01-25 19:39:23 +01:00
Chris Wilson
571ab10075 xcb: Fix linking with xcb-drm 2010-01-25 18:22:03 +00:00
Chris Wilson
ecda633f88 mime-data: Detach existing alternate representations upon modification
A major sore point in the current mime-data API is the choice to keep
the alternate mime-data representations after the user has actually
modifying the primary representation (i.e. has made it a target of a
cairo_t and drawn to it). This has been rightly chastised as unexpected
behaviour, and given that we already have the mechanism to detach
snapshots upon modification, there is no reason not to behave as
expected.
2010-01-25 18:17:28 +00:00
Chris Wilson
123bdb086a xcb: Make shm optional
Trying to build xcb on a system without SHM wrapped by xcb. The right
answer would be to build libxcb-shm. The quick answer is to compile out
shm support.
2010-01-25 16:45:03 +00:00
Chris Wilson
e1b3330376 configure: dri2 is only required for xcb-drm
Move the optional dependency on dri2 to the xcb-drm integration where it
is required.
2010-01-25 14:48:44 +00:00
Chris Wilson
8151c72307 xcb: compile errors with lockdep
After moving the mutex to the superclass, I forgot to update the
references from the lockdep asserts.
2010-01-25 12:14:39 +00:00
Chris Wilson
be81d656c5 clip: Create a fallback clip surface
If the destination cannot support a clip surface, then we will need to
use an intermediate image surface and trigger fallbacks upon use.
2010-01-25 11:56:29 +00:00
Chris Wilson
c453d8ab70 test: Erroneous ref image for big-line xlib-fallback. 2010-01-25 11:56:29 +00:00
Adrian Johnson
180aea76ad Fix printing of rotated user fonts
b7550bf0 introduced a regression when user fonts are rendered to a
rotated context.
2010-01-25 20:48:02 +10:30
Chris Wilson
abcb9d2c39 image: Prevent deref of NULL clip_region
Another stray from surface-fallback, spotted by Carlos:

*INT_cairo_region_get_extents (region=0x0, extents=0xbfffce90) at
cairo-region.c:385
385         if (region->status) {
(gdb) bt
0  *INT_cairo_region_get_extents (region=0x0, extents=0xbfffce90) at
cairo-region.c:385
1  0x0013ba46 in _cairo_image_surface_composite_trapezoids
(op=CAIRO_OPERATOR_OVER, pattern=0xbfffdda8, abstract_dst=0x837de10,
    antialias=CAIRO_ANTIALIAS_DEFAULT, src_x=486, src_y=45, dst_x=0,
dst_y=0, width=15, height=25, traps=0x837f100, num_traps=30,
clip_region=0x0)
    at cairo-image-surface.c:4102
2  0x0015d846 in _cairo_surface_composite_trapezoids
(op=CAIRO_OPERATOR_OVER, pattern=0xbfffdda8, dst=0x837de10,
antialias=CAIRO_ANTIALIAS_DEFAULT,
    src_x=486, src_y=45, dst_x=0, dst_y=0, width=15, height=25,
traps=0x837f100, num_traps=30, clip_region=0x0) at cairo-surface.c:2125
3  0x001607ce in _cairo_surface_fallback_composite_trapezoids
(op=CAIRO_OPERATOR_OVER, pattern=0xbfffdda8, dst=0x837db00,
    antialias=CAIRO_ANTIALIAS_DEFAULT, src_x=486, src_y=45, dst_x=486,
dst_y=45, width=15, height=25, traps=0x837fd78, num_traps=30,
clip_region=0x0)
    at cairo-surface-fallback.c:1641
4  0x0015d8a4 in _cairo_surface_composite_trapezoids
(op=CAIRO_OPERATOR_OVER, pattern=0xbfffdda8, dst=0x837db00,
antialias=CAIRO_ANTIALIAS_DEFAULT,
    src_x=486, src_y=45, dst_x=486, dst_y=45, width=15, height=25,
traps=0x837fd78, num_traps=30, clip_region=0x0) at cairo-surface.c:2137
5  0x001623b0 in _composite_traps_draw_func (closure=0xbfffd350,
op=CAIRO_OPERATOR_OVER, src=0xbfffdda8, dst=0x837db00, dst_x=0, dst_y=0,
    extents=0xbfffdc78, clip_region=0x0) at cairo-surface-fallback.c:546
6  0x00161234 in _clip_and_composite (clip=0x0, op=<value optimized
out>, src=0xbfffdda8, draw_func=0x162310 <_composite_traps_draw_func>,
    draw_closure=0xbfffd350, dst=0x837db00, extents=0xbfffdc78) at
cairo-surface-fallback.c:463
7  0x0016205b in _clip_and_composite_trapezoids (src=<value optimized
out>, op=CAIRO_OPERATOR_OVER, dst=0x837db00, traps=0xbfffd7bc,
    antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0x0, extents=0xbfffdc78) at
cairo-surface-fallback.c:853
8  0x001626ef in _cairo_surface_fallback_stroke (surface=0x837db00,
op=CAIRO_OPERATOR_OVER, source=0xbfffdda8, path=0x1b164c,
stroke_style=0x1b1524,
    ctm=0x1b15b0, ctm_inverse=0x1b15e0, tolerance=0.10000000000000001,
antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0x0) at
cairo-surface-fallback.c:1173
9  0x0015f2f4 in _cairo_surface_stroke (surface=0x837db00,
op=CAIRO_OPERATOR_OVER, source=0xbfffdda8, path=0x1b164c,
stroke_style=0x1b1524, ctm=0x1b15b0,
    ctm_inverse=0x1b15e0, tolerance=0.10000000000000001,
antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0xbfffde88) at
cairo-surface.c:2041
10 0x00134629 in _cairo_gstate_stroke (gstate=0x1b1514, path=0x1b164c)
at cairo-gstate.c:1133
11 0x0012a706 in *INT_cairo_stroke_preserve (cr=0x1b13c0) at
cairo.c:2234
12 0x0012a732 in *INT_cairo_stroke (cr=0x1b13c0) at cairo.c:2207
2010-01-25 09:35:09 +00:00
Chris Wilson
38ba696c48 surface-fallback: We no longer own a reference to the clip surface
_cairo_clip_get_surface() now returns a borrowed reference to the cached
surface on the clip, so we must not destroy it - as Carlos pointed out
when he hit the assert:

12:55 < KaL> ickle: cairo-surface.c:595: cairo_surface_destroy:
Assertion `((*&(&surface->ref_count)->ref_count) > 0)' failed.
12:56 < KaL> ickle: trying to render any pdf file with poppler glib demo
after installing cairo from git master
13:00 < KaL> ickle: well, it seems it has nothing ot do with poppler,
since it crashes in clearlooks src/clearlooks_draw.c:347
2010-01-25 09:20:11 +00:00
Chris Wilson
b3ba610ec0 win32: Trivially fix the compile error with printing.
_cairo_pattern_is_opaque() now takes the extents over which the
operation is defined so that we make exclude the clear pixels that
surround EXTEND_NONE surfaces when determining opacity. In order to take
full advantage of this we need to start performing an extents query on
the operation and pass that down to the analysis...

This patch however is just the quick compile fix to pass a NULL and
restore the old behaviour.

Fixes (with previous commit):
  Bug 26197 - Cairo doesn't build on windows
  http://bugs.freedesktop.org/show_bug.cgi?id=26197
2010-01-25 09:13:16 +00:00
Haakon Sporsheim
386ca53f28 win32: Compile fix, rename render_row to render_rows. 2010-01-25 09:13:06 +00:00
Andrea Canciani
a9a73e5df4 Constrain subsurface creation
Force the subsurface extents to be inside the target extents and
compose subsubsurfaces offsets correctly.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-24 23:51:09 +01:00
Adrian Johnson
b7550bf0f1 Fix incorrect font scale and glyph position in Type 3 fonts
The PDF file referenced by bug 26186 contains a Type 3 font with non
identity font matrix and a "1/2" glyph created by drawing the "1" and
"2" from a Type 1 font. This combination exposed a bug in the font
scale and glyph position in _cairo_type3_glyph_surface_show_glyphs
when printing user font glyphs.
2010-01-24 22:40:40 +10:30
Eric Anholt
ea7fda442c [gl] Release the context acquired in surface_create.
Fixes assertion failures in many testcases since
cf9ea9f2f0
2010-01-23 10:46:34 -08:00
Eric Anholt
20990365f3 [gl] Emit rectanges a whole primitive at a time.
Since the spans rework, we were emitting half a primitive at a time,
and if we flushed our VBO full of quads out halfway through, we could
end up dropping the primitive and then out of phase.
2010-01-23 10:44:07 -08:00
Andrea Canciani
c8a61a3267 Fix compilation on MacOS X
Some functions declared in MacOS X headers use the always_inline
attribute, thus defining it to be a different expression breaks the
build.
2010-01-23 18:25:11 +01:00
Andrea Canciani
90ba1242b6 Fix image backend compilation
When HAS_ATOMIC_OPS is not defined, cairo-image-surface.c does not
compile because _pixman_white_image calls _pixman_image_for_solid
which gets defined only later in the code.
2010-01-23 18:13:35 +01:00
Chris Wilson
2a466ba070 script: Encode octal values correctly.
Oops, we were emitting the octal numerals in reverse order.
2010-01-22 23:01:53 +00:00
Chris Wilson
87529198aa scaled-font: Mark an error site with _cairo_error() 2010-01-22 23:01:53 +00:00
Chris Wilson
6544f3b25d ps: Wean off the low-level image composite interface
The low-level surface composite interface will disappear in the near
future and results in much more ugly code than calling the high level
interface - so use it when flattening images into the page background.
2010-01-22 23:01:53 +00:00
Chris Wilson
f57cb45fa9 ps: Arguments to fill_extents() were reversed. 2010-01-22 23:01:53 +00:00
Chris Wilson
58540405d9 pdf: Arguments to fill_extents() were reversed. 2010-01-22 23:01:53 +00:00
Chris Wilson
34dd80632e glew: Silence compiler. 2010-01-22 23:01:53 +00:00
Chris Wilson
cf9ea9f2f0 gl: Acquire the context whilst creating surfaces. 2010-01-22 23:01:53 +00:00
Chris Wilson
a7e05bd602 glew: Do not assume that UNIX == GLX 2010-01-22 23:01:53 +00:00
Chris Wilson
c0008242b0 misc: Only use custom lround() under DISABLE_SOME_FLOATING_POINT
On my Core2, the library version of lround() is faster than our
hand-rolled non-floating point implementation. So only enable our code
if we are trying to minimise the number of floating point operations --
even then, it would worth investigating the library performance first.

[Just a reminder that optimisation choices will change over time as our
hardware and software evolves.]
2010-01-22 23:01:52 +00:00
Chris Wilson
1236c41072 xcb: Refresh.
Still an experimental backend, it's now a little too late to stabilise
for 1.10, but this should represent a major step forward in its feature
set and an attempt to catch up with all the bug fixes that have been
performed on xlib. Notably not tested yet (and expected to be broken)
are mixed-endian connections and low bitdepth servers (the dithering
support has not been copied over for instance). However, it seems robust
enough for daily use...

Of particular note in this update is that the xcb surface is now capable
of subverting the xlib surface through the ./configure --enable-xlib-xcb
option. This replaces the xlib surface with a proxy that forwards all
operations to an equivalent xcb surface whilst preserving the cairo-xlib
API that is required for compatibility with the existing applications,
for instance GTK+ and Mozilla. Also you can experiment with enabling a
DRM bypass, though you need to be extremely foolhardy to do so.
2010-01-22 23:01:52 +00:00
Chris Wilson
77afe8491e drm: Add backends for i915 and i965.
As proof-of-principle add the nearly working demonstrations of using DRM
to render directly with the GPU bypassing both RENDER and GL for
performance whilst preserving high quality rendering.

The basis behind developing these chip specific backends is that this is
the idealised interface that we desire for this chips, and so a target
for cairo-gl as we continue to develop both it and our GL stack.

Note that this backends do not yet fully pass the test suite, so only
use if you are brave and willing to help develop them further.
2010-01-22 23:01:52 +00:00
Chris Wilson
b9407af6a4 image: Implement high level interface.
Write a dedicated compositor for pixman so that we avoid the
middle-layer syndrome of surface-fallback. The major upshot of this
rewrite is that the image surface is now several times quicker for glyph
compositing, which dramatically improves performance for text rendering
by firefox and friends. It also uses a couple of the new scan
convertors, such as the rectangular scan converter for rectilinear
paths.

Speedups
========
image-rgba          firefox-talos-gfx-0    342050.17 (342155.88 0.02%) -> 69412.44 (69702.90 0.21%):  4.93x speedup
███▉
image-rgba                        vim-0    97518.13 (97696.23 1.21%) -> 30712.63 (31238.65 0.85%):  3.18x speedup
██▏
image-rgba                  evolution-0    69927.77 (110261.08 19.84%) -> 24430.05 (25368.85 1.89%):  2.86x speedup
█▉
image-rgba                    poppler-0    41452.61 (41547.03 2.51%) -> 21195.52 (21656.85 1.08%):  1.96x speedup
█
image-rgba       firefox-planet-gnome-0    217512.61 (217636.80 0.06%) -> 123341.02 (123641.94 0.12%):  1.76x speedup
▊
image-rgba             swfdec-youtube-0    41302.71 (41373.60 0.11%) -> 31343.93 (31488.87 0.23%):  1.32x speedup
▍
image-rgba         swfdec-giant-steps-0    20699.54 (20739.52 0.10%) -> 17360.19 (17375.51 0.04%):  1.19x speedup
▎
image-rgba                       gvim-0    167837.47 (168027.68 0.51%) -> 151105.94 (151635.85 0.18%):  1.11x speedup
▏
image-rgba          firefox-talos-svg-0    375273.43 (388250.94 1.60%) -> 356846.09 (370370.08 1.86%):  1.05x speedup
2010-01-22 23:01:52 +00:00
Chris Wilson
ec7cc9dea1 ft: Tidy computation of transformed bitmap, and mark if CA
Discard a redundant clear as the image surface is guaranteed to return
a cleared surface that meets pixman/xlib requirements for alignment, and
more importantly add the ComponentAlpha flag on the pixman image
generated as appropriate.
2010-01-22 23:01:52 +00:00
Chris Wilson
b713510f21 surface-fallback: Convert to composite rectangles 2010-01-22 23:01:52 +00:00
Chris Wilson
498c10032e clip: Implement clipping using only the high-level operators.
Revamp clipping in preparation for the removal of the low-level interface
and promote backend to use the higher levels. The principle here is that
the higher level interface gives the backend more scope for choosing
better performing primitives.
2010-01-22 23:01:52 +00:00