Commit graph

10232 commits

Author SHA1 Message Date
Chris Wilson
c0eaaa1680 test: Refresh the fallback-resolution reference images
Despite copying across the font options from the PDF backend, it still
looks like the image surface is override the glyph placement... Odd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 15:32:39 +00:00
Chris Wilson
1952fec829 surface: Relax assertion about not rendering to a snapshot
Recently I began using the surface->snapshot_of member of a subsurface
to cache a target representation of the current subsurface. More
recently, I discovered this caused an assertion failure in epiphany, and
probably other GTK3 based programs.

Throwaway the assertion and trust that the programmer doesn't make any
mistakes...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-08 15:20:21 +00:00
Martin Robinson
04108ce492 gl/msaa: Do not attach a depth-stencil attachment to the default framebuffer
Only texture surfaces need to have a depth-stencil attachment.
The default framebuffer is responsible for managing its own
depth and stencil attachments.
2012-03-07 00:02:52 +00:00
Chris Wilson
3454604459 xlib: Apply the glyph offset
The (dst_x, dst_y) parameters passed to the XRenderCompositeText are
misleading and do not perform any adjustment, so we have to do it
ourselves.

Fixes clip-operator

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:20 +00:00
Chris Wilson
ad758280b6 traps: The CompositeTrapezoids requires the unbounded fixup for clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:17 +00:00
Chris Wilson
753007ea00 traps: Avoid double application of unaligned clip boxes
Both combine-with-clip functions now take care of any intersection with
clip boxes so the result would be to have overdrawn the unaligned clip
box mask twice.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 21:13:17 +00:00
Chris Wilson
d40b90a577 clip: Use the boxes-intersection routine for computing the clip polygon
If we have more than a single box, run the boxes intersection as a
post-processing step on the clip polygon, as it should be faster than
doing it inline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 15:00:53 +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
5bd29eda63 surface-wrapper: Only apply the wrapped transform to the scaled-font
And not the device_transform of the target. This smells fishy, but
appears to make the test suite happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-06 14:11:49 +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
e572ae253a spans: Handle fallbacks from upload-boxes by reverting to the normal composite
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-05 12:02:31 +00:00
Chris Wilson
ac80097a31 traps: First attempt to convert curvy unantialiased polygon to scanlines
If we have a curvy polygon, we can expect to generate lots of short
trapezoids. However, we may be able to reduce the transport size by
converting them into a set of boxes instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 22:54:02 +00:00
Chris Wilson
c45822886a traps: Use the mono-scan-converter to reduce the number of traps
This trick only seems effective with mono-rasterisation, with a win of
about 10% for tiger-demo --antialias=none. At other antialias setting,
performance is reduced.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 22:54:02 +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
aed5a1cf1e spans: Reduce composite_aligned_boxes with over to source for opaque patterns
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
bda545dee4 spans: Retrim extents to clipped polygon
After combining the mask polygon with the clip polygon, recompute the
extents of the operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-04 16:16:19 +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
Uli Schlachter
a77db2f6e2 xlib-xcb: Fix make check
cairo_xcb_device_debug_cap_xrender_version is called by xlib-xcb's
cairo_xlib_device_debug_cap_xrender_version and thus must be marked slim_hidden.

Checking .libs/libcairo.so for local PLT entries
0000000000306ff8  0000024200000007 R_X86_64_JUMP_SLOT
     000000000009e720 cairo_xcb_device_debug_cap_xrender_version + 0
FAIL: check-plt.sh

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-03 15:10:41 +01:00
Uli Schlachter
f905f71006 Fix docs for cairo_xlib_device_debug_cap_xrender_version
The documentation was apparently copied from
cairo_xcb_device_debug_cap_xrender_version without changing "XCB" into "Xlib".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-03 13:45:59 +01:00
Chris Wilson
03df52a833 image: Correct origin of unbound recording surface source
Clearly demonstrated by using the test-base with the recording surfaces
and exemplified by the fallback-resolution with PDF, which is *almost*
fixed!

We're very close to making a release candidate for 1.12 now...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-03 12:35:07 +00:00
Chris Wilson
8968f01035 base: Remove the double application of the clip boxes
The clipping code was modified to handle partial boxes itself, so update
the base compositor to simply use the core clipping code and avoid
double application.
2012-03-02 12:31:41 +00:00
Chris Wilson
705cd6e1c6 test/record1414: Pixel align the clip for replay
In order to match the reference image we need complete coverage, and the
purpose of the test is to check non-integer scaling of replays rather
than handling of the clip pixels. That partial coverage is better tested
elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-02 12:30:28 +00:00
Zhigang Gong
b8a6019e0c mono: Always bias initial edge advancement
Even for a vertical edge, we still need to bias the error term otherwise
later we will find the error term is too larger and advance a pixel on
every row.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 14:41:58 +00:00
Chris Wilson
cdbf4c60fe spans,traps-compositor: Check for all-clipped after intersecting clip with boxes
If the mask does not intersect the clip, then there is no drawing to be
performed and we can report NOTHING_TO_DO.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 14:40:06 +00:00
Seongwon Cho
300e32a4a9 mono-scan-convertor: Include space for the closing span
When estimating the maximum number of spans required for a particular
width, we need to include a closing span.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 12:18:11 +00:00
Chris Wilson
2587b9dfd3 ft: Export FreeType synthesis options
Currently you can only specify that a cairo_ft_font_face_t should
synthesize a font (to make a bold variant) through an FcPattern. That is
direct consumers of the public cairo-ft API have no control over the
synthesize options.

Rectify this by creating some public API to allow control over the
synthesis flags, and include the ability to construct an oblique as
well an embolden font.

Based on a patch by Deokjin Kim <deokjin81.kim@samsung.com>.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 12:04:54 +00:00
Chris Wilson
231f0e32b9 ft: Remove unused HINT_METRICS from ft_font.extra-flags
This is handled through the normal cairo_font_options_t and was not
used.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 11:22:13 +00:00
Chris Wilson
a49a26f961 gl: Various fixes for glyphs
Not 100% improvement, there are still a variety of failures with
GLXWindows, but getting there. At least it fixes more things than its
breaks...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 10:27:39 +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
be5ab6df68 surface-wrapper: Apply the scaled-font ctm and non-default font-options
Improves record*-text-transform.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 18:11:22 +00:00
Chris Wilson
2c908f8a42 test: Regenerate reference images for vanilla record tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 17:59:13 +00:00
Chris Wilson
ef7e57f0fd scaled-font: Assign a temporary hash value for the placeholder
Fixes [large-]twin-antialias-mixed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 17:44:15 +00:00
Chris Wilson
050c246174 test: Add record90 to exercise replaying a rotated recording surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 17:38:21 +00:00
Chris Wilson
4429c7a301 scaled-font: Refactor the hash computation
Remove the cut'n'paste duplication and replace the hash computation with
a proper function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 15:05:57 +00:00
Chris Wilson
da381da7f3 scaled-font: Key the cache on the original font face
Complete the task started in cd4b2d843b by
remembering to compute the insertion hash on the original font face as
well as the lookup hashes. Also take advantage by deferring resolution
of the implementation for the font face until after we fail to find an
already constructed scaled font.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 14:50:16 +00:00
Chris Wilson
1cfd27851e test: Set record2x-fill-alpha as an xfail
As the path is converted to fixed-point prior to application of the
replay scale factor, we currently do anticipate some loss in precision
and slight difference in antialiasing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 15:14:33 +00:00
Chris Wilson
668e8eac3a test/record: Fix typo in record*-text-transform
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 15:14:33 +00:00
Chris Wilson
b1b5e9b908 surface-wrapper: Apply replay transforms to scaled font
Improves: record2x-select-font-face, record2x-text-transform
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 14:48:59 +00:00
Chris Wilson
78aeb0d14c test: Verify scaled replay of a recording surface
After this works, we may also like to check simple rotations and an
affine transform.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 14:47:25 +00:00
Adrian Johnson
2d3a1c7318 pdf: ensure all transparency groups are isolated 2012-02-25 16:57:58 +10:30
Adrian Johnson
2de75b1a34 test: add test to check that pdf transparency groups are non-isolated 2012-02-25 16:53:26 +10:30
Adrian Johnson
589216c1e3 win32: fix compilation on cygwin 2012-02-25 09:52:10 +10:30
Chris Wilson
7154f646d3 pdf,ps: The device offset only needs to taken into account for raster patterns
Ordinary patterns have their device offsets pre-baked into the pattern
matrix. The difference with raster patterns is that the surface is
generated upon use by the pdf,ps and so its device offset is not known
until then.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 16:15:31 +00:00
Chris Wilson
99ec915b97 test: a1-line-width is a test of rasterisation, so skip for the vector backends
PDF/PS do not have the concept of aliased rendering, so like many of the
other rasterisation tests, a1-line-width cannot be tested satisfactorily
on those backends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 14:30:14 +00:00
Chris Wilson
513841263e recording: Remove superfluous reset
When merging the two-clauses, I forgot to remove the second
_cairo_recording_surface_reset()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 14:07:10 +00:00