Commit graph

6749 commits

Author SHA1 Message Date
Chris Wilson
bc38108947 xlib/shm: Limit use of the impromptu fallback pixmap for uploads
We want to avoid unnecessary readback and so only want to use the
ShmPixmap when uploading the complete surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 23:20:01 +01:00
Chris Wilson
4af7a1c863 xlib/shm: Propagate the last-request to the synchronous create
If we optimise away the pending frees we must be careful to propagate
the implied sync.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 23:20:01 +01:00
Chris Wilson
1a87c526bf xcb: Migrate to the common mempool implementation
Having extracted the code for use by the SHM allocator for xlib, remove
the now redundant copy from xcb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 17:52:37 +01:00
Chris Wilson
e568e7c18b xlib/shm: Fix up the shrinking of the priority queue
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 15:38:16 +01:00
Chris Wilson
f42c0dcf7b tor22: Add a simple method to quickly compute coverage (with saturation)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 13:58:09 +01:00
Chris Wilson
0bfd2acd35 xlib: Implement SHM fallbacks and fast upload paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 13:58:09 +01:00
Daniel Stone
140fafed89 Fix broken XRender ARGB32 formats
46d79228 did indeed silence the compilation warning, but did so by never
creating an ARGB32 format, as PictStandardARGB32 is defined to 0.  Fix
this by using PictStandardNUM as our canary value instead.

This fixes GEdit and Chromium for me, both of which were only rendering
backgrounds and text in their GTK+ sections.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-08-16 20:11:44 +01:00
Chris Wilson
95b7f4fe3a image: Temporarily resurrect the old non-pixman glyph compositor
As the easiest approach to making another snapshot that only depends
upon a stable pixman, make the new dependency a compile time option.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-12 19:10:04 +01:00
Chris Wilson
16426dab48 skia: Compile fix for changes to map-to-image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-12 16:12:47 +01:00
Chris Wilson
d647d4f7db damage: Update tail pointer after allocating new chunk
Reported and based on a patch by fmot.fics

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53384
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 19:29:19 +01:00
Chris Wilson
adfe9b7eb6 gl: Fudge gradient color generation to handle multiple stops at 0
In order to generate the correct left-hand border color, we need to
fudge the offsets of the color stops if multiple stops are defined at 0.
The reason is that pixman will generate our color ramp by using the
right-most color stop for the pixel centre, but in order to provide the
sample colour outside of the gradient we need pixel 0 to be have the
left-most color.

Reported by Henry Song.
2012-08-11 18:25:27 +01:00
Chris Wilson
b0336e9aad gl: Use a wide texture ramp to emulate a linear step function
If the gradient contains a step function, we need an infinitely sharp
texture to emulate the correct output. Failing that, lets just use as
large a texture as can be reasonably handled by the hardware
2012-08-11 18:25:27 +01:00
Chris Wilson
46d79228df xlib: Silence compiler warning
cairo-xlib-display.c: In function '_cairo_xlib_display_get_xrender_format':
cairo-xlib-display.c:519:21: warning: 'pict_format' may be used
uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 17:48:17 +01:00
Chris Wilson
40e6be3278 gl: Remove unused variable
cairo-gl-glyphs.c: In function '_cairo_gl_composite_glyphs_with_clip':
cairo-gl-glyphs.c:442:9: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 17:43:46 +01:00
Chris Wilson
f59b0914f4 egl: s/EGL_KHR_surfaceless_opengl/EGL_KHR_surfaceless_context/
Mesa changed the name of the extension it invented, so check for the
real name and the old name before falling back to pbuffers which are not
supported by most EGL implementations.

References: https://bugs.freedesktop.org/show_bug.cgi?id=53361
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 17:42:17 +01:00
Adrian Johnson
65854a0015 type1 subset: ensure encoding includes all glyphs
Bug 53040
2012-08-03 18:23:55 +09:30
Adrian Johnson
5dd0f2eb95 cff subsetting: widths can be floating point
Bug 52972
2012-07-31 22:52:09 +09:30
Henry Song
1e9abd6e4e gl: use absolute value for color difference between gradient stops 2012-07-26 18:32:00 +01:00
Chris Wilson
652c632fb2 gl: Fallback for copy_boxes if src/dst do not belong to the same device
If the source and destination are on difference devices (GL contexts) we
can not simply texture from one to the other, and must either import the
source into the destination context (which has not yet been done) or
fallback through an image copy.

This patch is based on the work by Henry Song, but moving the check from
the common compositor layer down into the GL backend. This should have
the same effect...

Fixes gl-surface-source

Suggested-by: Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-25 17:08:30 +01:00
Henry Song
f3abb1079a gl: translate proper matrix depending up type of gl_operand
Fixes radial-gradiant-mask-source.
2012-07-25 17:08:30 +01:00
Andrea Canciani
d00539ca13 quartz: Use the correct transform when replaying recording surfaces
Recording surfaces should be replayed with the transform matrix used
in the pattern, otherwise the image surface will be transformed,
introducing artifacts.

Fixes record{1414x,2x}-paint-alpha-{,solid-clip,clip},
record2x-{self-intersecting,text-transform} and record90-paint-alpha.
2012-07-24 11:06:30 +02:00
Henry (Yu) Song - SISA
44a07a6613 quartz: Never acquire recording surfaces
We need to replay if the source/mask surface is a recording surface
otherwise, a crash happens if it is unbounded.

Fixes crashes in recordxx-xxx tests
2012-07-24 11:06:30 +02:00
Henry (Yu) Song - SISA
459c060b6f clip: Transform clip path in _cairo_clip_intersect_clip_path_transformed()
_cairo_clip_intersect_clip_path_transformed() completely ignored the
transformation matrix instead of transforming all the clip paths with
it.

This caused bugs when replaying recording surfaces.

Fixes record{2x,1414x,90}-paint-alpha-clip-mask.
2012-07-24 11:06:29 +02:00
Andrea Canciani
5f1dd8b368 xcb: Fix make check
The xcb private header uses the ASSERT_NOT_REACHED macro.
This macro is defined in cairoint.h, which needs to be included.

Fixes:

  CHECK cairo-xcb-private.h
In file included from headers-standalone-tmp.c:1:
./cairo-xcb-private.h: In function ‘_cairo_xcb_connection_shm_put_image’:
./cairo-xcb-private.h:636: error: ‘ASSERT_NOT_REACHED’ undeclared (first use in this function)
./cairo-xcb-private.h:636: error: (Each undeclared identifier is reported only once
./cairo-xcb-private.h:636: error: for each function it appears in.)
2012-07-24 10:45:52 +02:00
Chuanbo Weng
21e3f2e903 gl: copy_boxes() does not support copying from a non-texture source
So check for the appropriate surface type at the start and return
UNSUPPORTED if we cannot handle it directly. We will then fallback to
pushing the image instead.

Together with the previous patch, fixes 8 fails in cairo-test-suite.
2012-07-12 18:15:00 +01:00
Chuanbo Weng
77f8bd3199 gl: Create a new texture surface if the source surface type is gl-window
When the source surface type is gl-window, we should return unsupported
and then create a new texture surface for it. Based on the code of
Henry's tree.
2012-07-12 18:14:59 +01:00
Dongyeon Kim
ac2668dd08 gl: Set is_clear flag to FALSE after map_to_image
In _cairo_gl_surface_map_to_image(), the image surface data has been
filled by glReadPixels, so is_clear flag should be set to FALSE.
Otherwise mapped image surface does not get drawn as it is presumed
clear and so returns true from nothing_to_do().
2012-07-12 18:14:59 +01:00
Chris Wilson
6aed048484 gl: Add the compile fix that I forgot to add to the previous commit 2012-07-11 11:51:36 +01:00
Henry Song
bdb9c2cb43 gl: Destroy glyph cache surface during finish
We must destroy glyph cache surface in device_finish instead of in
device_destroy because in device_destroy device status is
DEVICE_FINISHED and the operation is invalid.
2012-07-11 10:05:51 +01:00
Henry Song
64a236246b gl: generate correct gradient color texture
Pixman generates gradient color at the center of pixel.  We need to
adjust such accordingly in GL when generating gradient texture
2012-07-10 16:14:54 +01:00
Chris Wilson
6938592ec7 xlib: If a sample accesses outside of a repeating image, upload it all
Fixes bug-51910

Reported-by: Albertas Vyšniauskas <thezbyg@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51910
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-09 21:57:03 +01:00
Adrian Johnson
1cac6e7fcc cff: initialise variable to prevent valgrind warning 2012-07-05 22:41:28 +09:30
Adrian Johnson
49c8e1b674 cff: use correct size for buffer
Bug 51443
2012-07-05 21:59:33 +09:30
Adrian Johnson
77106a038b cff: convert '.' to locale specific decimal point before using sscanf
to fix bug when decoding cff real numbers.

Bug 51443
2012-07-04 19:54:18 +09:30
Chris Wilson
cb85631c63 ft: Indentation fixup for _get_bitmap_surface()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 10:33:08 +01:00
Chuanbo Weng
1bdee6b1ad gl: Set correct operation extents.
The dst_x and dst_y should be considered when setting clip extents,
because they are not always be zero. (for example, in clip-operator.c)
2012-06-26 10:14:05 +01:00
Uli Schlachter
9f52261dd7 xcb: Correctly handle a recording surface's extents
The size of the target area doesn't really have much to do with the size of the
recording surface that we are painting from. Thus, let's use the recording
surface's size instead.

Since we apply the transformation before replaying the recording surface, we
need to transform the recording surface's size via the inverse of our pattern
matrix to get the size in the target surface. This makes this a little more
complex.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-25 21:18:18 +02:00
Uli Schlachter
e704f64d8f xcb: Handle recording surfaces differently
Let's say we are painting recording surface 'source' to xcb surface 'target' by
replaying the source to a temporary surface 'tmp'.

Previously, the xcb backend replayed the recording surface to tmp with just a
translation and then used that as its source surface with the pattern's
transformation. That means 'tmp' used the same coordinate system as 'source'.

This patch changes this so that the transformation is applied during the replay
and painting from 'tmp' to 'target' is just a simple translation, so 'tmp' now
uses the same coordinate system as 'target'.

This should produce way less better results, because transforming a recording
surface should have less artifacts than transforming a raster surface.

Fixes: record1414x-* record2x-* record90-* ps-surface-source

Breaks (or rather, "exposes unrelated bug that I have not yet figured out in"):
record-extend-*-similar

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-25 21:18:18 +02:00
Chuanbo Weng
13d61d7bdb gl: Set correct clip rectangle for non-texture destination surfaces
When the desintation surface is not a texture, it is flipped in the Y
axis. So we need to correct the Y coordinates when using glScissor to
the set the clip region.

Fixes 14 cases in cairo-test-suite, for example partial-clip-text-top
2012-06-24 12:13:02 +01:00
Chris Wilson
166e6f199e stroke: Skip inserting a round-join if within tolerance
If the angle between two segments is small we can simply replace the
round-join with a bevel-join. This is done automatically by the
insertion of the triangle fan as it will not be able to find a point
around the pen between the two vectors. However, we can make that search
cheaper by inspecting whether the bisection angle is small enough that
the bevel-join will be within geometric tolerance of the round-join.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-24 11:53:25 +01:00
Chris Wilson
b7bd5ae4f3 stroke: Use round-joins near inflection points of splines
Near an inflection, the angle between two segments of a spline increases
rapidly (as the radius of curvature decreases for the cusp). The angle
may increase so much that a simple line connecting the two outside
points of the spline is not within the user specified geometric
tolerance (with the result that you can generate severe ugliness around
a cusp). Extend the current detection of the exact inflection to cover
the sharp joins near the cusp by inspecting whether the bisection angle
is larger than acceptable.

Fixes bug-spline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-24 11:53:18 +01:00
Chris Wilson
185a351896 gl: Trim the glyph mask to the operation extents
In the case we try to use an unbounded operation, passing a NULL clip
causes that operation to clear the rest of the surface. Instead we need
to trim the _cairo_surface_mask() to the operation extents.

Fixes overlapping-glyphs.

Suggested-by: Chuanbo Weng <strgnm@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-20 09:20:06 +01:00
Chris Wilson
35e4ffd91c image: Fix up glyphs compositing
Jose Dapena Paz reported an assertion following the uninitialised status
value being returned. Also the function failed to free its allocations.

Based on a patch by Jose Dapena Paz <jdapena@igalia.com>.
Reported-by: Jose Dapena Paz <jdapena@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51104
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 10:52:25 +01:00
Henry Song
9bc1ea4431 subsurface: Disable subsurface-set-snapshot as it creates a ref cycle
_cairo_surface_subsurface_set_snapshot () sets the subsurface as the
snapshot of its target.  This creates a reference cycle (as the target
is already referenced by the surface) and thus a memory leak (assuming
the likely case that user doesn't call finish).

Test case: subsurface-similar-repeat.

So make this call as a no-op for the time being until the bug is fixed.
2012-06-14 23:07:34 +01:00
Andrea Canciani
13ba74a00d quart-image: Fix compilation
quartz-image uses _cairo_surface_is_image(), which is now declared in
cairo-image-surface-inline.h.

Fixes:
cairo-quartz-image-surface.c: In function 'cairo_quartz_image_surface_create':
cairo-quartz-image-surface.c:312: error: implicit declaration of function '_cairo_surface_is_image'
cairo-quartz-image-surface.c:312: warning: nested extern declaration of '_cairo_surface_is_image'
2012-06-14 08:12:41 +02:00
Søren Sandmann Pedersen
615205cf07 Use the new pixman_glyph_cache_t API that will be in pixman 0.28.0
This new pixman API allows glyphs to be cached and composited in one
go, which reduces overhead compared to individual calls to
pixman_image_composite_region32().

Notes:

- There is an explicit call to _cairo_image_scaled_glyph_fini(). This
  could instead be done with a private, but I chose not to do that
  since we don't need to store any actual data; we only need
  notification when the glyph dies.

- The slowdown in poppler-reseau is real and stable across runs. I'm
  not too concerned about it because this benchmark is only one run
  and so it is dominated by glyph cache setup costs and FreeType
  rasterizing.

Performance results, image backend:

    Speedups
       firefox-talos-gfx  5571.55 -> 4265.57:  1.31x speedup
      gnome-terminal-vim  1875.82 -> 1715.14:  1.09x speedup
               evolution  1128.24 -> 1047.68:  1.08x speedup
       xfce4-terminal-a1  1364.38 -> 1277.48:  1.07x speedup

    Slowdowns
          poppler-reseau   374.42 ->  394.29:  1.05x slowdown

Performance results, image16 backend:

    Speedups
       firefox-talos-gfx  5387.25 -> 4065.39:  1.33x speedup
      gnome-terminal-vim  2116.66 -> 1962.79:  1.08x speedup
               evolution   987.50 ->  924.27:  1.07x speedup
       xfce4-terminal-a1  1856.85 -> 1748.25:  1.06x speedup
                    gvim  1484.07 -> 1398.75:  1.06x speedup

    Slowdowns
          poppler-reseau   371.37 ->  393.99:  1.06x slowdown

Also bump pixman requirement to 0.27.1.
2012-06-09 15:52:59 -04:00
Chris Wilson
f228769dfe polygon-reduce: Reduce broken stopped-edge continuation
This is hopefully a lesser used path and the attempted optimisation to
continue a stopped edge with a colinear stopped edge highly unlikely and
lost in the noise of the general inefficiency of the routine. As it was
broken, rather than attempt to rectify the "optimisation" remove it.

Reported-by: Evangelos Foutras <evangelos@foutrelis.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50852
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 17:26:11 +01:00
Chris Wilson
fc501fd6b5 tor-scan-converter: Always recompute min-height following edge removal
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 17:26:11 +01:00
Chris Wilson
1bc696a8fd spans-compositor: After polygon intersection the fill rule is always non-zero
As it turns out due to the rules of polygon intersection, there is never
any overlapping spans so the choice is arbitrary. However, lets be
consistent with the rest of the code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 17:26:11 +01:00
Chris Wilson
37532b47c0 scaled-font: Take lock around disposing of an empty page upon alloc failure
Spotted by code inspection whilst looking at #50705

References: https://bugs.freedesktop.org/show_bug.cgi?id=50705
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 15:15:55 +01:00