win32 print: fix cache_frozen assertions

Bug 81709
configure.ac: configuration check to enable either gl or glesv2, not both at the same time

A proposed solution for the discussion in
https://bugs.freedesktop.org/show_bug.cgi?id=57379#c12,
to avoid muliple definition of cairo_gl_* symbols when
both gl and glesv2 backends are enabled at the same time

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Fix width and height args for _cairo_xcb_connection_copy_area()

Found via static analysis.

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by:  Uli Schlachter <psychon@znc.in>
xcb: Correctly check for image surface for inplace upload

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82987
Signed-off-by: Uli Schlachter <psychon@znc.in>
traps,xcb: Prefilter zero-area boxes when converting traps

The rectangular tesselation routines rely on the presuming that all the
boxes it has to handle are already filtered to remove empty boxes.

<< /width 800 /height 600 >> surface context
0.0848671 0 0 0.0848671 39.907812 5.608896 matrix transform
8 0 m 12.417969 0 16 3.582031 16 8 c 16 12.417969 12.417969 16 8 16 c
3.582031 16 0 12.417969 0 8 c 0 3.582031 3.582031 0 8 0 c h
clip
16 0 m 8 8 l 16 16 l h
clip
0 0 16 16 rectangle
fill

Triggers the error given a traps tesselator like cairo-xlib.

Reported-by: Henrique Lengler <henriqueleng@openmailbox.org>
Analyzed-by: Massimo <sixtysix@inwind.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
traps,xcb: Set the box count after filtering

After converting, the number of boxes should only count the number of
non-zero boxes and forget about the zero-sized boxes we skipped over.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src: Fix memory issue reported by cppcheck static analysis tool

cppcheck analysis tool reports the following issues when run on the
latest Cairo source.

$ grep "(error)"  cppcheck_error_log.txt
[src/skia/cairo-skia-surface.cpp:245]: (error) Memory leak: surface
$

The proposed changes fixes the above issues.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
test: Fix null pointer issue reported by cppcheck static analysis tool

cppcheck analysis tool reports the following issues when run on the
latest Cairo source.

$ grep "(error)"  cppcheck_error_log.txt
[test/pdf-mime-data.c:58]: (error) Possible null pointer dereference: file - otherwise it is redundant to check if file is null at line 53
[test/pdf-mime-data.c:75]: (error) Resource leak: fp
$

The proposed changes fixes the above issues.

And also it does some refactoring to print the appropriate error messages
for each error condition in read_file() function and also to free the allocated
data buffer.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Fix font x_scale value in _compute_transform()

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Fix _cairo_mesh_pattern_equal() when cairo_mesh_patch_t structs are different

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
qt: Suppress warnings in qt backend build

This patch fixes majorly 2 kinds of warning issues:

(1)
cc1plus: warning: command line option '-Wold-style-definition' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wnested-externs' is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wmissing-prototypes' is valid for Ada/C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [enabled by default]

Solution: Enable these warnings only for C compiler and not for C++

(2)
cairo-qt-surface.cpp: In function 'cairo_int_status_t _cairo_qt_surface_fill(void*, cairo_operator_t, const cairo_pattern_t*, const cairo_path_fixed_t*, cairo_fill_rule_t, double, cairo_antialias_t, const cairo_clip_t*)':
cairo-qt-surface.cpp:852:5: warning: inlining failed in call to 'PatternToBrushConverter::PatternToBrushConverter(const cairo_pattern_t*)': --param max-inline-insns-single limit reached [-Winline]
cairo-qt-surface.cpp:1339:38: warning: called from here [-Winline]
cairo-qt-surface.cpp:390:1: warning: inlining failed in call to 'QPainterPath _ZL10path_to_qtPK17_cairo_path_fixedPK13_cairo_matrix.part.13()': call is unlikely and code size would grow [-Winline]
cairo-qt-surface.cpp:1306:1: warning: called from here [-Winline]
cairo-qt-surface.cpp:1051:5: warning: inlining failed in call to 'PatternToBrushConverter::~PatternToBrushConverter()': call is unlikely and code size would grow [-Winline]

Solution: Add __attribute__ ((noinline)) to the function as mentioned in
http://stackoverflow.com/questions/11724235/warning-for-template-with-g-o2-or-os-o-o1 (Edit 3)

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
made paths to pixman, libpng and zlib configurable by commandline for win32 builds

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
xcb: Initialize font options from Xft resources

There is a similar code in the Xlib backend. The logic here is the same, but
XCB doesn't support X resources directly, so there is some custom code
to get and parse the resources from the root window.

Signed-off-by: Lukáš Lalinský <lukas@oxygene.sk>
Reviewed-by: Uli Schlachter <psychon@znc.in>
win32 printing: fix image scale when GDI scale is not identity
Disable font options for xcb.

This patch makes a bunch of tests pass again. The first hunk one fixes a
shameful oversight (whoops), the second one effectively reverts
e691d242.  That change broke 102 xcb and 70 xlib tests, including a
bunch of *twin-antialias-* test cases.  Patch thanks to Uli Schlachter.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
NEWS:  Bring up to date with recent bug fixes.
README:  Update required dependencies

Also adds mention of the skia backend.
AUTHORS: Add Ravi, myself, and a couple other frequent contributors
NEWS: Drop unfinished thought
test: Add test oversized egl surfaces

This test exercises error scenario when creating over sized egl surface
that is larger than maximum framebuffer or texture dimensions of the
context

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>