Commit graph

10685 commits

Author SHA1 Message Date
David Maxwell
4e751fcb03 type1-subset: always include subroutine 4 (hint replacement idiom)
http://lists.cairographics.org/archives/cairo/2012-December/023846.html
2012-12-22 14:36:38 +10:30
Behdad Esfahbod
b94a519aad [ft] Fix resizing of bitmap fonts
Say, you were asking cairo for a font at 200px.  For bitmap-only fonts,
cairo was finding the closes strike size and using it.  If the strike
was at 20px, well, that's what you were getting.  We now scale that 20px
strike by a factor of 10 to get the correct size rendering.

Note that by itself this patch doesn't change much on the Linux desktop.
The reason is that the size you are interested in (eg. 200px) is lost by
fontconfig.  When you request a font at 200px, fontconfig returns a font
pattern that says 20px, and so the next layers thing you want a font at
20px.  To address that, one also needs a piece of fontconfig config that
puts the 200 back into the pixelsize.  Something like this:

<match target="font">
  <test name="scalable" mode="eq">
    <bool>false</bool>
  </test>
  <edit name="pixelsize" mode="assign">
    <times>
      <name>size</name>
      <name>dpi</name>
      <double>0.0138888888888</double> <!--1/72.-->
    </times>
  </edit>
</match>

I'm going to try to upstream this config so it will be enabled by
default.  The config can be a bit smarter.  For example, if
metricshinting is enabled and the size difference is small, we may as
well not scale.

The nice thing about this is that the configuration of whether and when
to scale bitmaps will be done in fontconfig, not cairo / Qt / ... code.
2012-12-21 18:47:16 -05:00
Behdad Esfahbod
1404ed9692 [ft] Remove ancient check for FT_Bitmap_Size.y_ppem
That member is available in the version of FreeType we require.
2012-12-21 18:47:10 -05:00
Behdad Esfahbod
867c876b0e [Minor] Improve logging 2012-12-21 18:46:56 -05:00
Adam Jackson
5d21c9e224 xlib/shm: Fix memory leak
Despite subclassing image surfaces, we never called down to the image
surface destructor, so we leaked a pixman_image_t every time.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=882976
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-12-18 20:27:19 +00:00
Uli Schlachter
51435eeb0c xcb: Fix xcb-huge-subimage
This teaches the xcb backend how to split up a PutImage request for a subimage
into multiple requests. The backend already does the same for "normal" PutImage
where it doesn't have to assemble the image from various rows.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Uli Schlachter
5fb364287f test: Add xcb-huge-subimage
This creates an image surface with a non-natural stride and paints it to a
similar surface.

In the xcb backend, this causes a call to _cairo_xcb_connection_put_subimage()
which tries to send a huge PutImage request. As a result, xcb kills the X11
connection.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Uli Schlachter
749ef6be4d context: Use recording surfaces for unbounded groups
The old code uses an uninitialized variable for the extents of the group that is
created. This patch makes it use an unbounded recording surface instead.

This has the implicit assumption that everything that is unbounded smells like a
recording surface. Let's see when this assumption breaks. :-)

http://lists.cairographics.org/archives/cairo/2012-October/023585.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:09 +01:00
Martin Robinson
433a5829d7 Revert "gl/msaa: Share the depth/stencil buffer among all surfaces"
This was pushed mistakenly. Sorry.

This reverts commit a7d684e6fe.
2012-12-17 17:56:19 +01:00
Uli Schlachter
000a137a65 boilerplate-xcb: Ignore MappingNotify events
The boilerplate code makes sure that our tests didn't cause any X11 errors or
X11 events, because those might confuse API users.

However, when the keyboard layout changes, every connection gets a MappingNotify
event. This means that the test and performance test suites failed when the
keyboard layout was changed while they are running.

Fix this by ignoring MappingNotifies.

Reported by Arthur Huillet on IRC.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 17:12:59 +01:00
Martin Robinson
9d9aa04b60 gl: Add BGRA download support for GLES2
Some OpenGLES2 drivers support downloading BGRA data. On little-endian
systems BGRA and GL_UNSIGNED_BYTe is equivalent to the typical
cairo_image_t format, so this can prevent CPU bit swizzling for
operations that involve images.
2012-12-10 10:18:15 +01:00
Martin Robinson
a7d684e6fe gl/msaa: Share the depth/stencil buffer among all surfaces
Instead of allocating a depth/stencil buffer for all surfaces, share a
common buffer that's the size of the largest surface. This reduces
video memory usage when there are many GL surfaces.
2012-12-08 13:31:13 +01:00
Chuanbo Weng
ba4a4eae05 gl/msaa: Use GL_IMG_multisampled_render_to_texture when available
Some OpenGLES platforms support GL_IMG_multisampled_render_to_texture
instead of GL_EXT_multisampled_render_to_texture.
2012-12-05 16:17:10 -08:00
Henry Song
3bedff0c00 gl: Properly disable ctx->spans when necessary
When compositing starts, if we are not using the spans compositor, we
should set the spans member of the context to false.
2012-12-05 15:56:35 -08:00
Henry Song
18e7234c7e gl/msaa: Also setmsaa_active to true for non-texture surfaces
This is important because there are places in the code where msaa_active
is used to decide whether or not to complete an operation with
multisampling or not.
2012-12-05 15:30:28 -08:00
Henry Song
9f43f096b2 gl: Flush context upon evicting a gradient
As the random selection of a gradient can possible destroy the currently
active gradient, we need to flush the context in order to flush any
references to the texture before deletion.
2012-12-01 17:08:56 +00:00
Chris Wilson
a0fb139131 mempool: Reduce the assertion into an alignment adjustment for the base
Instead of asserting that the caller passed in a chunk-aligned base
pointer, just perform the fixup whilst initialising the mempool. This
means that the caller (xcb!) cannot assume that the mempool->base is
then the same base pointer as passed in and so needs to store it
separately for use in computing SHM offsets.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-01 09:23:37 +00:00
Chris Wilson
153b11612f script: Fix map-to-image/unmap stack manipulations
The idiom (and expectation) for surface operators is that it leaves the
surface on the stack for the next operation. Also we need to hold onto a
surface reference for objects put onto the stack, yet for the
map-to-image return we did not own one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:57:29 +00:00
Chris Wilson
dfbf80a57d trace: Do not forcibly add surfaces to the dictionary
Adjust the stack manipulation to avoid moving an unknown surface to
the dictionary.

Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:36:59 +00:00
Chris Wilson
376d39121c trace: Fix operand emission for map-to-image and unmap-image
Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-27 12:25:56 +00:00
Zozó Teki
62b795fe52 recording: Append new elements to the end of the bbtree chain
I have noticed that some of my objects were lost when drawing them on
a recording surface and playing them back. Later elements with the same
extents as a prior one tend to disappear from the chain of headers
having similar extents. After doing some debugging, I found that they
are not properly added to the bbtree during playback, and were instead
clobbering the existing chain.
2012-11-10 08:37:23 +00:00
Chris Wilson
6ed1da67b5 version: Post-release bump to 1.12.9 2012-11-04 15:34:34 +00:00
Chris Wilson
cc162915a5 1.12.8 release 2012-11-04 14:23:09 +00:00
Adrian Johnson
cf07bd866d type1-subset: remove unused variable 2012-11-03 11:08:01 +10:30
Adrian Johnson
9f537156ad type1-subset: fix memory leak 2012-11-03 11:07:02 +10:30
Chris Wilson
724c6dfa95 xlib/shm: Need IncludeInferiors when creating the source fallback
Reported-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 17:01:07 +00:00
Chris Wilson
1f4d05b55c stroke: Fix calling '_cairo_spline_intersect' for in-bounds checking of splines
Fixes stroke-clipped, within reason. There still remains some
antialiasing noise (between rendering the circle piecewise and wholly)
worth investigating - but that is probably an artefact of switching
between analytical rendering modes in the scanline
rasterisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:53:18 +00:00
Chris Wilson
2dd4ff3206 test: Add stroke-clipped
Exercise a bug in the determine of clip-bounds when stroking, as
reported by ed44.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:48:40 +00:00
Chris Wilson
e9d4570584 pen: Tighten checking for bevel (start==stop) joins
From commit d7f5a1bec4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 31 09:27:52 2012 +0000

    pen: First check whether the in/out edges lie within the single pen vertex

makes a couple of tests much happier.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 11:42:46 +00:00
Chris Wilson
90860241bb gl: Tune the default VBO size to reduce overhead on embedded devices
Henry Song found that the 256k buffers were disadvantageous on his
embedded hardware. As there is no obvious right value for the default
VBO size, we can tune for the more obvious constraints.

Based on a patch by Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 09:47:00 +00:00
Chris Wilson
0c1ff1572f xlib: Fixup standalone header compilation for 'make check'
Missing include of string.h

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:45:37 +00:00
Chris Wilson
b6daf47fa0 spans: Do not assume that we manage to perform the clip geometrically
Even for bounded masks, we may fail to perform the clipping
geometrically for a variety of reasons, the prime one being that the
clip has a mixture of antialias settings. So when compositing the
polygon, we need to check whether a clip path still remains and so
requires a clipmask.

Fixes regression from

commit cd1004ce19
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 11 21:20:35 2012 +0100

    traps,spans-compositor: Avoid mistreating unaligned clips as aligned

and

commit 4ea3ace6c8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 11 21:51:44 2012 +0100

    spans: Only fallback for a clipmask if unbounded

Reported-by: Dominik Röttsches <dominik.rottsches@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56574
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:43:26 +00:00
Chris Wilson
5844dead01 util/show-polygon: Show the limited range of each edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:58 +00:00
Chris Wilson
03adea2f50 stroke: Precompute the line half-width
As we regularly recompute stroke->line_width/2 we may as compute it once
during initialisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:01 +00:00
Chris Wilson
dbc0d83f2a image: Add a couple of tracepoints for spans fallbacks
References: https://bugs.freedesktop.org/show_bug.cgi?id=56574
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 15:18:21 +00:00
Chris Wilson
9b7ed9b2cd xlib/shm: Fix bogus assertion without shm available
In particular note that _cairo_xlib_surface_put_shm is indeed called and
is expected to be a no-op when shm is not available.

Reported-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 13:15:07 +00:00
Chris Wilson
d7f5a1bec4 pen: First check whether the in/out edges lie within the single pen vertex
In order to prevent underflow when searching for the closing pen vertex,
we first need to be sure that it does not simply lie next to the opening
pen vertex. As a result we were missing many cases that should have been
a bevel (in == out) and generating almost complete round caps instead.

Reported-by: Dominik Röttsches <dominik.rottsches@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56432
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 09:27:52 +00:00
Chris Wilson
66625cb46c xlib: Apply the image offsets to the destination rather the source
So that we can specify the entire source surface as the region to copy
and not introduce clipping errors.

Fixes regression from
commit c068691ff5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 17 21:33:54 2012 +0100

    xlib/shm: Use an impromptu upload ShmSegment

Reported-by: John Lindgren <john.lindgren@aol.com>
Reported-by: Kalev Lember <kalevlember@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56547
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-30 12:40:41 +00:00
Kevin Tardif
65176b7380 type1-subset, cff-subset: Plugged 2 memory leaks
- _cairo_type1_font_subset_fini doesn't free font->cleartext
- _cairo_cff_font_create can exit without freeing font->font_name and/or
  font->data; _cairo_cff_font_load_opentype_cff is called to allocate
  font_name, then _cairo_cff_font_load_cff is called to allocate
  font->data, then _cairo_cff_font_load_cff's return status is checked
  and if it failed, it jumps to fail1. This can cause font_name to leak
  since the fail1 target only frees the font variable. In addition,
  _cairo_cff_font_load_cff can fail -after- allocating data, and then
  data won't be freed either.

Bug 56566
2012-10-30 20:50:00 +10:30
Adrian Johnson
0c800dc3f6 type1-subset: ensure subroutine numnber is an integer 2012-10-30 19:23:30 +10:30
Adrian Johnson
5a6e1d680a type1-subset: restore correct callothersub behavior
that was removed in d57e652f. Without this subsetting of subroutines
won't work for some fonts.
2012-10-28 22:13:31 +10:30
Chris Wilson
0e24586978 xlib/shm: Use shmstr.h instead of shmproto.h if available
Before it was known as shmproto.h, the wire protocol definition was to
be found in shmstr.h, so if we don't have the current version of libXext
try to use the older includes.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Chris Wilson
f18199fcfb xlib/shm: Check for XShm headers
Not all version of libXext ship the same set of headers, so play safe
and check during configure that we have the headers we depend upon in
the code.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Adrian Johnson
d57e652f08 type1-subset: parse all operators
The PDF at bug 56265 contained a Type 1 font that used the "div"
operator to compute the glyph width. As the "div" operator was
not handled by the charstring parser this resulted in an incorrect
glyph width in the PDF output.

Fix this by upgrading the charstring parsing to handle all Type 1
operators.
2012-10-26 23:00:01 +10:30
Chris Wilson
fdd2082f92 xlib: Check for both X.org and Xorg ServerVendors
Martin Husemann reported that on his NetBSD machine the vendor was being
reported as "The Xorg Foundation", a non-conformist separatist split of
the Peoples' Liberation Army^W^W^W "The X.Org Foundation". Simply check
for both during initialisation.

Reported-by: Martin Husemann <martin@duskware.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-26 11:31:14 +01:00
Chris Wilson
00feb8ce53 xlib/shm: Sanity check that the server handles XSendEvent with ShmCompletion
Uli Schlachter suggested it would be wiser to complement our blacklist
of known broken X/libXext with an explicit roundtrip to check for a
BadValue error return when we try to use XSendEvent.

Suggested-by: Uli Schlachter <psychon@znc.in>
Reported-by: Martin Husemann <martin@duskware.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-26 10:59:05 +01:00
Chris Wilson
e43f53bf7f version: Post release bump to 1.12.7 2012-10-22 13:47:11 +01:00
Chris Wilson
fab6958eff 1.12.6 release 2012-10-22 11:07:15 +01:00
Gilles Espinasse
d49b2284b5 configure: fix unrecognized -Wno option
gcc-4.4 and later accept every -Wno option. So we can test for the
option without no in the name to check if the option is supported.

Each time a warning is emitted and without this fix, on gcc-4.4 that will
add this warning:
   cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"

bugs.freedesktop.org #51633, rediffed after 1.12.4

Of course this assumes that all compilers will behave like gcc, which is
reasonably implicit in the set of warning flags.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
[ickle: slight modification to test both -W and -Wno variants to ideally
preserve compatability with non-GCC compilers sharing GCC options!]
2012-10-21 17:32:53 +01:00
Gilles Espinasse
b12a94b983 configure: fix PKG_CHECK_MODULES tests displaying no no
Inside PKG_CHECK_MODULES, AC_MSG_RESULT(no) is already displayed, so the
caller should not use another AC_MSG_RESULT(no).

Add a comment that empty ACTION-IF-NOT-FOUND is not allowed for
PKG_CHECK_MODULES, but a simple : is enough.

This is bugs.freedesktop.org #51628, rediffed after 1.12.4

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-10-21 09:36:28 +01:00