Commit graph

10934 commits

Author SHA1 Message Date
Bryce Harrington
2be98be04e Fix segfault in firefox when scrolling on certain pages
Bug discovered by thorsten <fly_a320@gmx.de>

Patch from Chris Wilson <chris@chris-wilson.co.uk>
2014-08-27 11:01:20 +02:00
Uli Schlachter
5b083237f5 mask compositor: Set a check_composite method
Commit 503b6b9e2e added a check_composite method to the mask compositor, but
only added it to one of the existing implementations. This commit fixes that.

In cairo-image-compositor.c, there is already a check_composite method which
just returns success for the traps compositor. This commit makes the mask
compositor use that one.

I don't want to say much about cairo-image-mask-compositor.c except that I
wondered why this file and the file above both define a non-static function
called _cairo_image_mask_compositor_get(). In my opinion, that file should just
be deleted, since it confuses e.g. ctags, but I'll let someone else clean this
up.

Fixes 493 crashes in the test suite for the test-mask target.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Tested-by: Bryce Harrington <b.harrington@samsung.com>
2014-08-27 11:00:42 +02:00
Uli Schlachter
17e14b62e0 clip: Fix handling of special all-clipped cairo_clip_t
_cairo_clip_intersect_box() wasn't checking if it was called with the special,
read-only all-clipped clip and thus could have ended up writing to read-only
memory.

References: https://bugs.freedesktop.org/show_bug.cgi?id=75819
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-27 10:59:28 +02:00
Chris Wilson
087b92f32b clip: Do not modify the special all-clipped cairo_clip_t
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75819
2014-08-27 10:59:17 +02:00
Koji Egashira
518c9e4992 image: Add NULL checks for return value of _pixman_image_for_color()
This fixes crash in pixman_image_composite32().

Originally fixed by Yoshitaro Makise.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-08-27 10:58:49 +02:00
Bryce Harrington
91d245b204 image: Fix bad HTML generation in code docs for cairo-format-stride-for-width
Patch from Simon Kågedal Reimer

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63257
2014-08-27 10:58:27 +02:00
Adrian Johnson
920247086c type1: strip space from end of font name 2014-08-27 10:56:54 +02:00
Adrian Johnson
15045aebeb ps: add font DSC comments 2014-08-27 10:56:44 +02:00
Adrian Johnson
f5f09c9350 ps: cairo_set_page_size does not need to be in eps output 2014-08-27 10:56:31 +02:00
Adrian Johnson
be03857b51 ps: use setpagedevice to set page size
https://bugs.freedesktop.org/show_bug.cgi?id=73452
2014-08-27 10:56:17 +02:00
Marek Kasik
0f94381322 font: Generate PDFs with correct font names
Escape PostScript names of loaded fonts. These can not
contain white spaces and delimiter characters when saving
them to a PostScript file or a PDF file.
2014-08-27 10:56:06 +02:00
Adrian Johnson
990d384d9e ps: fix imagemask with pattern source failure on some printers
When /PaintProc is invoked the pattern dict is pushed onto the stack.
Ensure this dict is removed.

https://bugs.freedesktop.org/show_bug.cgi?id=69485
2014-08-27 10:55:55 +02:00
Adrian Johnson
892e564317 ps: remove duplicate /Interpolate from image dictionary
http://lists.freedesktop.org/archives/poppler/2014-January/010748.html
2014-08-27 10:55:43 +02:00
Adrian Johnson
51c2f018d7 pdf: fix rectangle stroke with non rectilinear pen 2014-08-27 10:55:30 +02:00
egag
caf1b826da Fixes stroke-clipped, i.c. of a dashed stroke
Similar to 1f4d05b55c
 'Fix calling '_cairo_spline_intersect' for in-bounds checking of splines'

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-08-27 10:54:45 +02:00
Uli Schlachter
c553424a1d fill_reduces_to_source(): Handle failure of color_to_pixel()
The function color_to_pixel() can fail for unsupported pixman image formats, but
fill_reduces_to_source() ignored this possibility.

Fix this by using the return value of color_to_pixel():

Fixes the following compiler warnings:

cairo-image-compositor.c: In function 'fill_boxes':
cairo-image-compositor.c:349:15: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]
cairo-image-compositor.c: In function 'fill_rectangles':
cairo-image-compositor.c:304:18: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-27 10:53:03 +02:00
Uli Schlachter
549129e306 check-doc-syntax: Don't hardcode path to awk
Instead of expecting awk in /usr/bin, this commit changes the code to call awk
through a shell so that $PATH is searched.

Since this awk script shouldn't really be called manually, this is done by
removing the shebang from the awk script, marking it non-executable and fixing
up the caller.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67674
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-27 10:52:07 +02:00
Uli Schlachter
384878373d cairo-gobject: Require at least glib 2.14
cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions
were added in glib 2.14 and thus cairo needs at least this version for its
gobject helper functions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-27 10:51:19 +02:00
Adrian Johnson
6369470f30 ps: fix embedding of mime data 2014-08-27 10:51:04 +02:00
Adrian Johnson
35e0a26851 pdf: fix embedding of mime data that has been broken since 0a10982f
For some reason the mime-data test is not detecting this failure.
2014-08-27 10:50:51 +02:00
Adrian Johnson
3b3202dc00 svg: Don't embed CMYK Jpeg images
None of the SVG viewers I tried (rsvg, firefox, inkscape) support CMYK
Jpeg images.

Bug 68965
2014-08-27 10:49:32 +02:00
Chris Wilson
59e2a93b3c Post-release version bump 2013-08-26 18:46:19 +01:00
Chris Wilson
8e11a42e3e 1.12.16 release 2013-08-26 17:56:27 +01:00
Chris Wilson
b710a47309 Make "make check" happy
A recursive include should hide the bare header from
check-preprocessor-syntax.sh

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-26 17:56:27 +01:00
Chris Wilson
fb8881e84b win32: Prevent double-free of similar images
Based on a patch and analysis by Michael Henning.

When we create a similar-image surface for win32, we set up a couple of
back references from the image to the win32 surface, and vice versa. We
need to be careful when decoupling the reference cycle to avoid chasing
around the loop upon destruction. Currently we handled destroying the
similar-image via the parent win32 surface, but similar precaution is
required when destroying the surface via the similar-image.

Reported-by: Michael Henning <drawoc@darkrefraction.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63787
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 12:53:27 +01:00
Chris Wilson
054f34111d Provide backwards compatibilty with old pixman
The goal is to allow compilation against older pixman to ease regression
testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 12:53:27 +01:00
Martin Robinson
95f320e3f2 gl: Return surface in error when creating oversized texture surfaces
When creating a texture surface that is larger than the maximum
framebuffer or texture dimensions of the context, return a surface in
error. Previously the code failed an assertion, but this prevents an
application from easily detecting when to fall back.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-19 14:54:28 -07:00
Henry Song
b5e1373c58 gl/msaa: Clean up msaa depth/stencil buffer for OpenGLES
OpenGLES also uses the depth/stencil buffer when doing multisampling, so
it's a leak to only clean up the buffer for desktop OpenGL.
2013-08-19 12:56:58 -07:00
Uli Schlachter
54a51968e8 surface_get_extents: Reject finished or error surface
This fixes a crash in the api-special-cases with xlib-xcb when calling
cairo_clip_extents() on a context that refers to a finished surface.

The crash was a simple NULL pointer dereference, because the underlying xcb
surface that was used in xlib-xcb was gone and set to NULL already.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-13 19:25:17 +02:00
Uli Schlachter
3c4e0f0f1a push_group: Refuse working with unusable surface
Make cairo_push_group() fail when the context's target surface is finished.

This fixes the api-special-cases for the xcb backend:

   Detected error during xcb run: error=9, seqno=0x13c, major=53, minor=0

The problem was that the Pixmap for the cairo surface was already freed and
cairo still tried to use it again as the drawable in a CreatePixmap request.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-13 19:21:57 +02:00
Uli Schlachter
18633b0810 surface: Error out on finished surfaces
Finished surfaces and surfaces with an error status must not be usable anymore,
so refuse to work on them.

This improves the result for api-special-cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68014

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-13 19:21:02 +02:00
Uli Schlachter
b64c83e891 api-special-cases: Also test contexts
This adds code to the api-special-cases test which also tests the behavior of
cairo when the cairo context or the surface that is target is in an error state
or finished. These new tests call into all public entry points defined in
cairo.h which receive a cairo_t * as their first argument.

Currently this causes a new crash in the testsuite:

  cairo-surface.c:394:
  _cairo_surface_begin_modification: Assertion `!  surface->finished' failed.

Reported-by: christophe.troestler@umons.ac.be
References: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-13 19:17:56 +02:00
Bryce W. Harrington
e438071e9d perf: Move macro-benchmark documentation to cairo-traces
The macro benchmarks were moved to a separate repository some time ago,
but the perf README still refers to these tests as if they were still
present, which may lead to some confusion.  Instead, consolodate the
macro benchmark documentation with the macro benchmarks, and focus this
README on just the (still in tree) micro-benchmarks.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-11 16:37:02 +02:00
Bryce W. Harrington
4e133af60c HACKING: Make mention of the separate cairo-traces repo
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-11 16:33:43 +02:00
Behdad Esfahbod
46d9db96d4 [ft] Ensure alignment of bitmaps received from FreeType 2013-08-04 20:12:06 -04:00
Behdad Esfahbod
34a747e7bd [ft] Fix alignment 2013-08-04 20:11:51 -04:00
Behdad Esfahbod
3cd6c5966a Revert accidentally committed stuff 2013-07-29 22:47:26 -04:00
Behdad Esfahbod
0554d76402 [ft] Add missing include 2013-07-29 22:41:46 -04:00
Behdad Esfahbod
7d26341072 [ft] Fix math 2013-07-29 19:20:33 -04:00
Behdad Esfahbod
9444ef09cc Support 2bit and 4bit embedded bitmaps 2013-07-29 19:10:46 -04:00
Adrian Johnson
274863be08 type1-subset: Don't try to rename non winansi glyphs
When the latin subset contains glyphs that use the seac operator to
combine two glyphs, additional non winansi glyphs are added to the
subset.  These extra glyphs do not have a winansi name so they can't
be renamed.

Based on a patch by Salvador Ortiz.

Bug 67324
2013-07-28 09:30:05 +09:30
Henry Song
03c81d414d gl/msaa: Always use scissor when clipping
Even when using the stencil buffer for clipping, always scissor the clip
extents. This simplifies the code a bit.
2013-07-15 19:27:29 -07:00
Henry Song
8c710ed872 gl/msaa: Disable stencil and scissor during framebuffer blit
When blitting the framebuffer during transitions to and from
multi-sampling mode, we need to disable the stencil and scissor test so
that the entire surface is preserved. This fixes the bitmap-font test
for the MSAA compositor.
2013-07-15 19:27:24 -07:00
Henry Song
be2c09a1f5 gl/msaa: Properly destroy stencil buffer clip cache
When replacing the stencil buffer clip cache or destroying a surface,
destroy the cached clip. This prevents the clip from leaking.
2013-07-15 19:27:19 -07:00
Behdad Esfahbod
2cc353c3db Towards support loading color glyphs from FreeType
See comments.
2013-07-05 16:03:25 -06:00
Behdad Esfahbod
e738079302 [ft] Fix wrong assumptions
If subpixel rendering is enabled, but FT returns a 8bit gray bitmap
(perhaps because the font has 8bit embedded bitmaps) we were hitting
the assertions because the assumptions made were wrong.  Fix up.
2013-07-05 15:59:45 -06:00
Behdad Esfahbod
a0f556f37f [ft] Fix memory bug in copying bitmaps 2013-07-05 15:59:45 -06:00
Uli Schlachter
9f9796920f xcb: Fix some uninitialized variable warnings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00
Uli Schlachter
2170bdbb12 image compositor: Always finish the span renderer
In some obscure conditions that I don't really understand, the image compositor
did not finish a span renderer that it created. This could then cause the last
row of the span to be ignored.

Fixes: clip-complex-bug61492

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00
Uli Schlachter
9058e9ae28 Add new test for bug 61592
This test exercises some clipping-related failure that Seongwon Cho reported.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61592
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-07-04 21:57:12 +02:00