Commit graph

32 commits

Author SHA1 Message Date
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
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
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
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
Søren Sandmann Pedersen
4b5d3436a3 image: Fix bugs related to glyph mask creation
In addition to fixing a bug 7d8d98b91c releated to
expanding a8 glyphs into a8r8g8b8, this commit also added an
optimization where if the first glyph had format a8r8g8b8, the mask
was created in this format from the beginning instead of later
converting from a8 to a8r8g8b8.

However, the optimization had two bugs in it:

(1) The computed stride was 3 * width, not 4 * times width, and
(2) In the case where the mask was allocated on the stack, it was
    allocated as PIXMAN_a8 and not a8r8g8b8.

The commit fixes both bugs.
2012-06-01 08:13:17 +01:00
Chris Wilson
7d8d98b91c image: Upconvert glyphs through a WHITE source when adding to the glyph mask
We need to scale the channels of the glyph into the destination (and
indeed expand a8 into a8r8g8b8) when adding into the mask. Normally we
have matching formats for the glyph surfaces and the temporary mask,
for which we can continue to take the faster path.

Reported-by: Søren Sandmann <sandmann@cs.au.dk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 11:25:11 +01:00
Chris Wilson
5a7a9c93e7 image: Tidy lerp8x4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 10:41:12 +01:00
Søren Sandmann Pedersen
af3c8abbce Revert "Use pixman glyphs"
This was pushed accidentally - apologies.

This reverts commit 752c3b69e0.
2012-04-30 12:02:38 -04:00
Søren Sandmann Pedersen
752c3b69e0 Use pixman glyphs 2012-04-30 09:41:44 -04:00
Chris Wilson
47368d5e83 image: Add a little bit of debugging to show number of boxes being drawn
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:02:17 +01:00
Chris Wilson
ec400daf9e image: Avoid overflow when computing lerp spans for a8
Reported-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 23:16:32 +01:00
Chris Wilson
957a9cc619 image: Fix typo in _blit_spans()
The height is 'h' not 'y'!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-26 08:54:39 +01:00
Chris Wilson
9417fec04a image: Split inline SRC composition
Currently we construct a mask for the entire line and try to process it
in one call to pixman (two without the LERP operator). An alternative
approach is split the row into separate composite operations for the
clear (which we can skip), fully opaque and partial spans.

As the source operator is typically mostly opaque or clear, this is a
good win as we are able to utilise more fast paths. In the worst case,
it degrades to the old method of constructing a whole mask for a row.
It may reduce performance for having to process lots of spans though
(this is where the pixman spans interface should help). However, such
geometry is rare and typically handled elsewhere.

And the existing code has a bug where it was clearing the destination
for clear regions of the mask outside of the spans.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 10:51:39 +01:00
Chris Wilson
8a65d8e2de image: Fix leak of white solid color for masked composition of CLEAR
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 00:34:45 +00:00
Chris Wilson
ea0703524f image: Support SRC compositing with in the inline span-compositor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-12 18:49:19 +00:00
Chris Wilson
f8f0510f89 image: Add unbounded support to the mono rasteriser fast-paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 14:42:19 +00:00
Chris Wilson
c65ed9c79d image: Try performing span composition a row at a time
In theory, this should be more cache efficient and allow us to trim the
operation to the width of row, shaving a few texel fetches. The cost is
that we cause pixman to evaluate the composite operation per-row. This
should only be a temporary solution until we can do something better
through pixman...

On a i5-2520m, ymmv,

  firefox-fishtank  64585.38 -> 56823.41:  1.14x speedup
  swfdec-fill-rate   1383.24  -> 1665.88:  1.20x slowdown

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 17:06:35 +00:00
Chris Wilson
c19bf1499a image: Add a simple inplace blitter for spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 17:06:02 +00:00
Chris Wilson
9f83ac5c63 image: Perform the simple solid-fill spans inplace
Reducing the number of passes has the usual change in the antialiasing
side-effects, as well as the boon of being faster (and theorectically more
accurate through reduced loss of dynamic range.)

On an i5-2520m:
    swfdec-giant-steps-full   3240.43  ->  2651.36:  1.22x speedup
             grads-heat-map    166.84  ->   136.79:  1.22x speedup
         swfdec-giant-steps    940.19  ->   796.24:  1.18x speedup
                  ocitysmap    953.51  ->   831.96:  1.15x speedup
        webkit-canvas-alpha  13924.01  -> 13115.70:  1.06x speedup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 17:03:53 +00:00
Chris Wilson
38a242a380 spans,image,gl: Add fast-path for simple copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 22:54:02 +00:00
Chris Wilson
cc13379ee3 image: Add a fast-path for mono-rasterised blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 22:54:02 +00:00
Chris Wilson
937325d664 image: Perform the general composite operation inplace for mono rasterisation
We suffer from the large overhead in calling pixman_image_composite32
per-span, but even will that overhead it is a net win with the usual
caveat about cache efficiency and function call overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 22:54:02 +00:00
Chris Wilson
61cb5539fa image: Add a fast path for solid-filled polygons
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 15:38:56 +00:00
Chris Wilson
b55e7c776f spans: Pass antialiasing hint down to the backends
The actual span rasterisers may be able to specialise if they know that
the spans will be pixel aligned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 15:38:56 +00:00
Chris Wilson
3c665102c2 spans+image: Fix clipping with polygons and spans
Fixes: clip-source, random-clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 22:27:18 +00:00
Chris Wilson
ae3319890e win32: Rebase on the new compositor infrastructure
Try and undo all the damage that has acrued over the years by plugging
into the compositor pipeline.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42739
References: https://bugs.freedesktop.org/show_bug.cgi?id=42821
References: https://bugs.freedesktop.org/show_bug.cgi?id=33081
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:37:11 +00:00
Chris Wilson
2c4f6bbfbc gl: Prevent the traps compositor from exploding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
538fa0d6fb fill: Fix unantialiased rectilinear-fill-to-boxes
We were calling the antialias close function from the unantialiased
paths - a function that operates on a completely different structure to
the one passed in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 15:58:14 +01:00
Chris Wilson
719bef0c90 image: Enable use of LERP_SRC for masked source composition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 13:07:23 +01:00
Chris Wilson
472e4515de image: fix compilation of spans with LERP 2011-09-14 20:21:08 +01:00
Chris Wilson
8a80bbf78d image: Adapt to updated pixman lerp operators
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 19:10:22 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00