[cairo-commit] Branch '1.14' - 30 commits - boilerplate/cairo-boilerplate-win32.c build/aclocal.cairo.m4 build/configure.ac.features cairo-version.h doc/public NEWS RELEASING src/cairo-array.c src/cairo-atomic-private.h src/cairo-cff-subset.c src/cairo-font-face.c src/cairo-ft-font.c src/cairo-gl-shaders.c src/cairoint.h src/cairo-misc.c src/cairo-pattern.c src/cairo-pdf-surface.c src/cairo-polygon-intersect.c src/cairo-quartz-font.c src/cairo-surface.c src/cairo-win32.h src/drm src/win32 test/clip-complex-bug61592.c test/coverage.c test/make-cairo-test-constructors.sh test/Makefile.am test/reference test/zero-alpha.c util/cairo-script
Bryce Harrington
bryce at kemper.freedesktop.org
Wed Jun 24 19:13:46 PDT 2015
NEWS | 8
RELEASING | 20
boilerplate/cairo-boilerplate-win32.c | 242 +++++++++-
build/aclocal.cairo.m4 | 12
build/configure.ac.features | 2
cairo-version.h | 2
dev/null |binary
doc/public/cairo-docs.xml | 3
src/cairo-array.c | 3
src/cairo-atomic-private.h | 90 +++
src/cairo-cff-subset.c | 4
src/cairo-font-face.c | 7
src/cairo-ft-font.c | 49 +-
src/cairo-gl-shaders.c | 8
src/cairo-misc.c | 2
src/cairo-pattern.c | 10
src/cairo-pdf-surface.c | 2
src/cairo-polygon-intersect.c | 203 ++------
src/cairo-quartz-font.c | 2
src/cairo-surface.c | 12
src/cairo-win32.h | 4
src/cairoint.h | 1
src/drm/cairo-drm-intel-debug.c | 2
src/win32/cairo-win32-display-surface.c | 68 ++
test/Makefile.am | 2
test/clip-complex-bug61592.c | 2
test/coverage.c | 2
test/make-cairo-test-constructors.sh | 4
test/reference/clip-complex-bug61592.ref.png |binary
test/reference/coverage-intersecting-triangles.image.xfail.png |binary
test/reference/coverage-intersecting-triangles.ref.png |binary
test/zero-alpha.c | 2
util/cairo-script/cairo-script-file.c | 2
util/cairo-script/cairo-script-hash.c | 5
util/cairo-script/cairo-script-interpreter.c | 3
util/cairo-script/cairo-script-objects.c | 2
util/cairo-script/cairo-script-operators.c | 2
util/cairo-script/cairo-script-private.h | 2
util/cairo-script/cairo-script-scanner.c | 79 +--
util/cairo-script/cairo-script-stack.c | 2
util/cairo-script/csi-bind.c | 40 +
util/cairo-script/csi-exec.c | 40 +
util/cairo-script/csi-replay.c | 40 +
util/cairo-script/csi-trace.c | 40 +
44 files changed, 754 insertions(+), 271 deletions(-)
New commits:
commit 3a2893debf6f40609cd2cb0573c5e162c46fdc68
Author: Alban Browaeys <prahal at yahoo.com>
Date: Wed Jan 21 12:01:45 2015 +0100
pattern: allow for a floating one pixel rounded difference.
That is if the difference between the origin and the end is bigger than
.5 round up regardless of the coordinates.
Round the difference of the floats instead of rounding the floats then
diff them.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index ac5d7af..562724d 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -3531,7 +3531,7 @@ _cairo_pattern_get_extents (const cairo_pattern_t *pattern,
cairo_rectangle_int_t *extents)
{
double x1, y1, x2, y2;
- int ix1, ix2, iy1, iy2;
+ double ix1, ix2, iy1, iy2;
cairo_bool_t round_x = FALSE;
cairo_bool_t round_y = FALSE;
@@ -3725,12 +3725,12 @@ _cairo_pattern_get_extents (const cairo_pattern_t *pattern,
if (x1 < CAIRO_RECT_INT_MIN)
ix1 = CAIRO_RECT_INT_MIN;
else
- ix1 = _cairo_lround (x1);
+ ix1 = x1;
if (x2 > CAIRO_RECT_INT_MAX)
ix2 = CAIRO_RECT_INT_MAX;
else
- ix2 = _cairo_lround (x2);
- extents->x = ix1; extents->width = ix2 - ix1;
+ ix2 = x2;
+ extents->x = ix1; extents->width = _cairo_lround(ix2 - ix1);
if (!round_y) {
y1 -= 0.5;
@@ -3744,7 +3744,7 @@ _cairo_pattern_get_extents (const cairo_pattern_t *pattern,
iy2 = CAIRO_RECT_INT_MAX;
else
iy2 = _cairo_lround (y2);
- extents->y = iy1; extents->height = iy2 - iy1;
+ extents->y = iy1; extents->height = _cairo_lround(iy2 - iy1);
return;
commit dd2cbd7268f7b34f512965fac63da762f523f1a4
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Jun 16 16:42:56 2015 -0700
cairo-script: Rename struct member to avoid name collision on AIX
On AIX, the token jmpbuf is a pre-processor macro.
cairo-script-scanner.c includes a private struct with a member named
jmpbuf which gets renamed to __jmpbuf when AIX's sys/context.h has been
included.
While judicious ordering of includes might kludge around this problem
(by causing all references to .jmpbuf to become .__jmpbuf), it's better
to simply select a new name for the struct member that won't suffer the
collision.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89339
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/util/cairo-script/cairo-script-private.h b/util/cairo-script/cairo-script-private.h
index 6bf41b4..8d158d6 100644
--- a/util/cairo-script/cairo-script-private.h
+++ b/util/cairo-script/cairo-script-private.h
@@ -435,7 +435,7 @@ union _csi_union_object {
};
struct _csi_scanner {
- jmp_buf jmpbuf;
+ jmp_buf jump_buffer;
int depth;
int bind;
diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index 980c608..3dfb3a9 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -199,13 +199,13 @@ _buffer_grow (csi_t *ctx, csi_scanner_t *scan)
char *base;
if (_csi_unlikely (scan->buffer.size > INT_MAX / 2))
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_NO_MEMORY));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_NO_MEMORY));
offset = scan->buffer.ptr - scan->buffer.base;
newsize = scan->buffer.size * 2;
base = _csi_realloc (ctx, scan->buffer.base, newsize);
if (_csi_unlikely (base == NULL))
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_NO_MEMORY));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_NO_MEMORY));
scan->buffer.base = base;
scan->buffer.ptr = base + offset;
@@ -441,12 +441,12 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
&scan->procedure_stack,
&scan->build_procedure);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
status = csi_array_new (ctx, 0, &scan->build_procedure);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
scan->build_procedure.type |= CSI_OBJECT_ATTR_EXECUTABLE;
return;
@@ -454,7 +454,7 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
if (_csi_unlikely
(scan->build_procedure.type == CSI_OBJECT_TYPE_NULL))
{
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
}
if (scan->procedure_stack.len) {
@@ -470,7 +470,7 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
scan->build_procedure.type = CSI_OBJECT_TYPE_NULL;
}
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
return;
}
@@ -480,19 +480,19 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
if (len >= 2 && s[1] == '/') { /* substituted name */
status = csi_name_new (ctx, &obj, s + 2, len - 2);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
status = _csi_name_lookup (ctx, obj.datum.name, &obj);
} else { /* literal name */
status = csi_name_new (ctx, &obj, s + 1, len - 1);
}
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
} else {
if (! _csi_parse_number (&obj, s, len)) {
status = csi_name_new (ctx, &obj, s, len);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
obj.type |= CSI_OBJECT_ATTR_EXECUTABLE;
}
@@ -510,7 +510,7 @@ token_end (csi_t *ctx, csi_scanner_t *scan, csi_file_t *src)
status = scan_push (ctx, &obj);
}
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
static void
@@ -531,7 +531,7 @@ string_end (csi_t *ctx, csi_scanner_t *scan)
scan->buffer.base,
scan->buffer.ptr - scan->buffer.base);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
if (scan->build_procedure.type != CSI_OBJECT_TYPE_NULL)
status = csi_array_append (ctx,
@@ -540,7 +540,7 @@ string_end (csi_t *ctx, csi_scanner_t *scan)
else
status = scan_push (ctx, &obj);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
static int
@@ -588,7 +588,7 @@ hex_end (csi_t *ctx, csi_scanner_t *scan)
scan->buffer.base,
scan->buffer.ptr - scan->buffer.base);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
if (scan->build_procedure.type != CSI_OBJECT_TYPE_NULL)
status = csi_array_append (ctx,
@@ -597,7 +597,7 @@ hex_end (csi_t *ctx, csi_scanner_t *scan)
else
status = scan_push (ctx, &obj);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
static void
@@ -605,7 +605,7 @@ base85_add (csi_t *ctx, csi_scanner_t *scan, int c)
{
if (c == 'z') {
if (_csi_unlikely (scan->accumulator_count != 0))
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
buffer_check (ctx, scan, 4);
buffer_add (&scan->buffer, 0);
@@ -613,7 +613,7 @@ base85_add (csi_t *ctx, csi_scanner_t *scan, int c)
buffer_add (&scan->buffer, 0);
buffer_add (&scan->buffer, 0);
} else if (_csi_unlikely (c < '!' || c > 'u')) {
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
} else {
scan->accumulator = scan->accumulator*85 + c - '!';
if (++scan->accumulator_count == 5) {
@@ -641,7 +641,7 @@ base85_end (csi_t *ctx, csi_scanner_t *scan, cairo_bool_t deflate)
case 0:
break;
case 1:
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
break;
case 2:
@@ -670,14 +670,14 @@ base85_end (csi_t *ctx, csi_scanner_t *scan, cairo_bool_t deflate)
(Bytef *) scan->buffer.ptr - source,
len);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
} else {
status = csi_string_new (ctx,
&obj,
scan->buffer.base,
scan->buffer.ptr - scan->buffer.base);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
if (scan->build_procedure.type != CSI_OBJECT_TYPE_NULL)
@@ -687,7 +687,7 @@ base85_end (csi_t *ctx, csi_scanner_t *scan, cairo_bool_t deflate)
else
status = scan_push (ctx, &obj);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
static void
@@ -764,7 +764,7 @@ base64_end (csi_t *ctx, csi_scanner_t *scan)
scan->buffer.base,
scan->buffer.ptr - scan->buffer.base);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
if (scan->build_procedure.type != CSI_OBJECT_TYPE_NULL)
status = csi_array_append (ctx,
@@ -773,7 +773,7 @@ base64_end (csi_t *ctx, csi_scanner_t *scan)
else
status = scan_push (ctx, &obj);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
static void
@@ -783,7 +783,7 @@ scan_read (csi_scanner_t *scan, csi_file_t *src, void *ptr, int len)
do {
int ret = csi_file_read (src, data, len);
if (_csi_unlikely (ret == 0))
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_READ_ERROR));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_READ_ERROR));
data += ret;
len -= ret;
} while (_csi_unlikely (len));
@@ -801,7 +801,7 @@ string_read (csi_t *ctx,
status = csi_string_new (ctx, obj, NULL, len);
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
if (compressed) {
uint32_t u32;
@@ -1015,7 +1015,7 @@ scan_none:
case 157:
case 158:
case 159:
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
case '#': /* PDF 1.2 escape code */
{
@@ -1044,7 +1044,7 @@ scan_none:
status = scan_push (ctx, &obj);
}
if (_csi_unlikely (status))
- longjmp (scan->jmpbuf, status);
+ longjmp (scan->jump_buffer, status);
}
}
return;
@@ -1135,7 +1135,7 @@ scan_string:
next = csi_file_getc (src);
switch (next) {
case EOF:
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
case 'n':
string_add (ctx, scan, '\n');
@@ -1229,7 +1229,7 @@ scan_string:
break;
}
}
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
scan_hex:
buffer_reset (&scan->buffer);
@@ -1276,10 +1276,10 @@ scan_hex:
break;
default:
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
}
}
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
scan_base85:
buffer_reset (&scan->buffer);
@@ -1306,7 +1306,7 @@ scan_base85:
break;
}
}
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
scan_base64:
buffer_reset (&scan->buffer);
@@ -1324,14 +1324,14 @@ scan_base64:
base64_end (ctx, scan);
goto scan_none;
}
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
default:
base64_add (ctx, scan, c);
break;
}
}
- longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (scan->jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
}
static csi_status_t
@@ -1396,7 +1396,7 @@ _csi_scan_file (csi_t *ctx, csi_file_t *src)
*/
if (ctx->scanner.depth++ == 0) {
- if ((status = setjmp (ctx->scanner.jmpbuf))) {
+ if ((status = setjmp (ctx->scanner.jump_buffer))) {
ctx->scanner.depth = 0;
return status;
}
@@ -1759,7 +1759,7 @@ _translate_push (csi_t *ctx, csi_object_t *obj)
case CSI_OBJECT_TYPE_PATTERN:
case CSI_OBJECT_TYPE_SCALED_FONT:
case CSI_OBJECT_TYPE_SURFACE:
- longjmp (ctx->scanner.jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (ctx->scanner.jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
break;
}
@@ -1805,7 +1805,7 @@ _translate_execute (csi_t *ctx, csi_object_t *obj)
case CSI_OBJECT_TYPE_PATTERN:
case CSI_OBJECT_TYPE_SCALED_FONT:
case CSI_OBJECT_TYPE_SURFACE:
- longjmp (ctx->scanner.jmpbuf, _csi_error (CSI_STATUS_INVALID_SCRIPT));
+ longjmp (ctx->scanner.jump_buffer, _csi_error (CSI_STATUS_INVALID_SCRIPT));
break;
}
@@ -1877,7 +1877,7 @@ _csi_translate_file (csi_t *ctx,
csi_status_t status;
struct _translate_closure translator;
- if ((status = setjmp (ctx->scanner.jmpbuf)))
+ if ((status = setjmp (ctx->scanner.jump_buffer)))
return status;
status = build_opcodes (ctx, &translator.opcodes);
commit 5fda59a2f7e50d2a89052eca8c118babf9813c99
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Jun 16 15:18:23 2015 -0700
cairo-script: Prefer cairo from local tree
Use quoted includes rather than bracketed, to prefer linking to the
in-tree cairo in preference to the system cairo.
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/util/cairo-script/cairo-script-interpreter.c b/util/cairo-script/cairo-script-interpreter.c
index f94e39a..dfce8a1 100644
--- a/util/cairo-script/cairo-script-interpreter.c
+++ b/util/cairo-script/cairo-script-interpreter.c
@@ -34,9 +34,8 @@
#include "config.h"
-#include <cairo.h>
-
#include "cairo-script-private.h"
+#include "cairo.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/util/cairo-script/csi-bind.c b/util/cairo-script/csi-bind.c
index e7c89a3..b2a6d69 100644
--- a/util/cairo-script/csi-bind.c
+++ b/util/cairo-script/csi-bind.c
@@ -34,8 +34,8 @@
#include "config.h"
-#include <cairo.h>
-#include <cairo-script-interpreter.h>
+#include "cairo.h"
+#include "cairo-script-interpreter.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/util/cairo-script/csi-exec.c b/util/cairo-script/csi-exec.c
index 5a7d811..175328c 100644
--- a/util/cairo-script/csi-exec.c
+++ b/util/cairo-script/csi-exec.c
@@ -34,8 +34,8 @@
#include "config.h"
-#include <cairo.h>
-#include <cairo-script-interpreter.h>
+#include "cairo.h"
+#include "cairo-script-interpreter.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/util/cairo-script/csi-replay.c b/util/cairo-script/csi-replay.c
index b6f56d0..4c66b77 100644
--- a/util/cairo-script/csi-replay.c
+++ b/util/cairo-script/csi-replay.c
@@ -34,8 +34,8 @@
#include "config.h"
-#include <cairo.h>
-#include <cairo-script-interpreter.h>
+#include "cairo.h"
+#include "cairo-script-interpreter.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c
index 3a1428e..52eeade 100644
--- a/util/cairo-script/csi-trace.c
+++ b/util/cairo-script/csi-trace.c
@@ -34,8 +34,8 @@
#include "config.h"
-#include <cairo-script.h>
-#include <cairo-script-interpreter.h>
+#include "cairo-script.h"
+#include "cairo-script-interpreter.h"
#include <stdio.h>
#include <stdlib.h>
commit 475916b84e1490be252910d6950d2aea89a5f722
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Jun 16 15:13:31 2015 -0700
cairo-script: Cleanup boilerplate header for consistency
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/util/cairo-script/cairo-script-hash.c b/util/cairo-script/cairo-script-hash.c
index 69af575..58786fc 100644
--- a/util/cairo-script/cairo-script-hash.c
+++ b/util/cairo-script/cairo-script-hash.c
@@ -1,5 +1,4 @@
-/* cairo - a vector graphics library with display and print output
- *
+/*
* Copyright © 2004 Red Hat, Inc.
* Copyright © 2005 Red Hat, Inc.
*
commit 99c89b3fffa2df580065a0ecf9bd576ed2102510
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Jun 16 15:06:59 2015 -0700
cairo-script: Add missing copyright and boilerplate
Chris wrote all of the cairo script stuff. I'm making a guess about the
copyright date.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/util/cairo-script/csi-bind.c b/util/cairo-script/csi-bind.c
index 11f666a..e7c89a3 100644
--- a/util/cairo-script/csi-bind.c
+++ b/util/cairo-script/csi-bind.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright © 2008 Chris Wilson <chris at chris-wilson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Chris Wilson.
+ *
+ * Contributor(s):
+ * Chris Wilson <chris at chris-wilson.co.uk>
+ */
#include "config.h"
diff --git a/util/cairo-script/csi-exec.c b/util/cairo-script/csi-exec.c
index 5648a95..5a7d811 100644
--- a/util/cairo-script/csi-exec.c
+++ b/util/cairo-script/csi-exec.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright © 2008 Chris Wilson <chris at chris-wilson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Chris Wilson.
+ *
+ * Contributor(s):
+ * Chris Wilson <chris at chris-wilson.co.uk>
+ */
#include "config.h"
diff --git a/util/cairo-script/csi-replay.c b/util/cairo-script/csi-replay.c
index 1309985..b6f56d0 100644
--- a/util/cairo-script/csi-replay.c
+++ b/util/cairo-script/csi-replay.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright © 2008 Chris Wilson <chris at chris-wilson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Chris Wilson.
+ *
+ * Contributor(s):
+ * Chris Wilson <chris at chris-wilson.co.uk>
+ */
#include "config.h"
diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c
index bed7236..3a1428e 100644
--- a/util/cairo-script/csi-trace.c
+++ b/util/cairo-script/csi-trace.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright © 2008 Chris Wilson <chris at chris-wilson.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is Chris Wilson.
+ *
+ * Contributor(s):
+ * Chris Wilson <chris at chris-wilson.co.uk>
+ */
#include "config.h"
commit 0b885d045619208fb75074f4d7196c2dc5b49a1d
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Jun 16 15:05:54 2015 -0700
cairo-script: Always include config.h first thing
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/util/cairo-script/cairo-script-file.c b/util/cairo-script/cairo-script-file.c
index 0274a3e..e7c5376 100644
--- a/util/cairo-script/cairo-script-file.c
+++ b/util/cairo-script/cairo-script-file.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
#include "cairo-script-private.h"
#include <stdio.h>
diff --git a/util/cairo-script/cairo-script-hash.c b/util/cairo-script/cairo-script-hash.c
index 4d11103..69af575 100644
--- a/util/cairo-script/cairo-script-hash.c
+++ b/util/cairo-script/cairo-script-hash.c
@@ -37,6 +37,8 @@
* Karl Tomlinson <karlt+ at karlt.net>, Mozilla Corporation
*/
+#include "config.h"
+
#include "cairo-script-private.h"
#include <stdlib.h>
diff --git a/util/cairo-script/cairo-script-interpreter.c b/util/cairo-script/cairo-script-interpreter.c
index 50170fc..f94e39a 100644
--- a/util/cairo-script/cairo-script-interpreter.c
+++ b/util/cairo-script/cairo-script-interpreter.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
#include <cairo.h>
#include "cairo-script-private.h"
diff --git a/util/cairo-script/cairo-script-objects.c b/util/cairo-script/cairo-script-objects.c
index a625489..2d7937b 100644
--- a/util/cairo-script/cairo-script-objects.c
+++ b/util/cairo-script/cairo-script-objects.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
#include "cairo-script-private.h"
#include <limits.h> /* INT_MAX */
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index 0d6cafc..aa38823 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
/* TODO real path type */
#include "cairo-script-private.h"
diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index 84b45df..980c608 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
#include "cairo-script-private.h"
#include <limits.h> /* INT_MAX */
diff --git a/util/cairo-script/cairo-script-stack.c b/util/cairo-script/cairo-script-stack.c
index b1d146c..ff1e91a 100644
--- a/util/cairo-script/cairo-script-stack.c
+++ b/util/cairo-script/cairo-script-stack.c
@@ -32,6 +32,8 @@
* Chris Wilson <chris at chris-wilson.co.uk>
*/
+#include "config.h"
+
#include "cairo-script-private.h"
#include <limits.h> /* INT_MAX */
diff --git a/util/cairo-script/csi-bind.c b/util/cairo-script/csi-bind.c
index 91b58fb..11f666a 100644
--- a/util/cairo-script/csi-bind.c
+++ b/util/cairo-script/csi-bind.c
@@ -1,3 +1,6 @@
+
+#include "config.h"
+
#include <cairo.h>
#include <cairo-script-interpreter.h>
diff --git a/util/cairo-script/csi-exec.c b/util/cairo-script/csi-exec.c
index d30b1c9..5648a95 100644
--- a/util/cairo-script/csi-exec.c
+++ b/util/cairo-script/csi-exec.c
@@ -1,3 +1,6 @@
+
+#include "config.h"
+
#include <cairo.h>
#include <cairo-script-interpreter.h>
diff --git a/util/cairo-script/csi-replay.c b/util/cairo-script/csi-replay.c
index 67fed3b..1309985 100644
--- a/util/cairo-script/csi-replay.c
+++ b/util/cairo-script/csi-replay.c
@@ -1,3 +1,6 @@
+
+#include "config.h"
+
#include <cairo.h>
#include <cairo-script-interpreter.h>
diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c
index a0466a3..bed7236 100644
--- a/util/cairo-script/csi-trace.c
+++ b/util/cairo-script/csi-trace.c
@@ -1,3 +1,6 @@
+
+#include "config.h"
+
#include <cairo-script.h>
#include <cairo-script-interpreter.h>
commit be05125611ab635af2aa1a6e77efcdec38188532
Author: Fredrik Fornwall <fredrik at fornwall.net>
Date: Sun May 31 20:36:48 2015 +0200
Fix cairo_get_locale_decimal_point() on Android
diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index df8a4ef..3c7c959 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -774,7 +774,7 @@ cairo_get_locale_decimal_point (void)
const char *
cairo_get_locale_decimal_point (void)
{
- return '.';
+ return ".";
}
#endif
commit a1146f54d7c2c99c0b4fc7091b10354adf611056
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date: Tue Sep 23 12:37:35 2014 +0200
polygon-intersection: Delete misleading comments and dead-code
den_det is positive because intersect_lines is called
only after _slope_compare returned > 0 and slope_compare
is returning the sign of den_det
The quadratic-time intersection finder is #if 0-ed out
in src/cairo-bentley-ottman.c, but is unusable even there
since the second commit to that file.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index 52e6775..8cb8fb1 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -605,24 +605,14 @@ intersect_lines (cairo_bo_edge_t *a,
R = det32_64 (dx2, dy2,
b->edge.line.p1.x - a->edge.line.p1.x,
b->edge.line.p1.y - a->edge.line.p1.y);
- if (_cairo_int64_negative (den_det)) {
- if (_cairo_int64_ge (den_det, R))
- return FALSE;
- } else {
if (_cairo_int64_le (den_det, R))
return FALSE;
- }
R = det32_64 (dy1, dx1,
a->edge.line.p1.y - b->edge.line.p1.y,
a->edge.line.p1.x - b->edge.line.p1.x);
- if (_cairo_int64_negative (den_det)) {
- if (_cairo_int64_ge (den_det, R))
- return FALSE;
- } else {
if (_cairo_int64_le (den_det, R))
return FALSE;
- }
/* We now know that the two lines should intersect within range. */
@@ -686,54 +676,8 @@ static cairo_bool_t
_cairo_bo_edge_contains_intersect_point (cairo_bo_edge_t *edge,
cairo_bo_intersect_point_t *point)
{
- int cmp_top, cmp_bottom;
-
- /* XXX: When running the actual algorithm, we don't actually need to
- * compare against edge->top at all here, since any intersection above
- * top is eliminated early via a slope comparison. We're leaving these
- * here for now only for the sake of the quadratic-time intersection
- * finder which needs them.
- */
-
- cmp_top = _cairo_bo_intersect_ordinate_32_compare (point->y,
- edge->edge.top);
- cmp_bottom = _cairo_bo_intersect_ordinate_32_compare (point->y,
- edge->edge.bottom);
-
- if (cmp_top < 0 || cmp_bottom > 0)
- {
- return FALSE;
- }
-
- if (cmp_top > 0 && cmp_bottom < 0)
- {
- return TRUE;
- }
-
- /* At this stage, the point lies on the same y value as either
- * edge->top or edge->bottom, so we have to examine the x value in
- * order to properly determine containment. */
-
- /* If the y value of the point is the same as the y value of the
- * top of the edge, then the x value of the point must be greater
- * to be considered as inside the edge. Similarly, if the y value
- * of the point is the same as the y value of the bottom of the
- * edge, then the x value of the point must be less to be
- * considered as inside. */
-
- if (cmp_top == 0) {
- cairo_fixed_t top_x;
-
- top_x = _line_compute_intersection_x_for_y (&edge->edge.line,
- edge->edge.top);
- return _cairo_bo_intersect_ordinate_32_compare (point->x, top_x) >= 0;
- } else { /* cmp_bottom == 0 */
- cairo_fixed_t bot_x;
-
- bot_x = _line_compute_intersection_x_for_y (&edge->edge.line,
- edge->edge.bottom);
- return _cairo_bo_intersect_ordinate_32_compare (point->x, bot_x) < 0;
- }
+ return _cairo_bo_intersect_ordinate_32_compare (point->y,
+ edge->edge.bottom) < 0;
}
/* Compute the intersection of two edges. The result is provided as a
commit 99f56be5f545c0136b198d83c0a4c692b9f9f770
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date: Tue Sep 23 12:37:26 2014 +0200
polygon-intersection: Try not to invoke undefined behaviour
Optimizing compilers aggressively remove code that is executed only
after an undefined behaviour occurred.
Also, the difference of two (non char) pointers hides an integer
division that, because the divisor is known at compile time, is
transformed into a multiplication by a pseudo-reciprocal, and in this
case the difference is not always a multiple of the divisor, resulting
in an invalid comparison predicate.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index 02ef3b5..52e6775 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -76,7 +76,7 @@ struct _cairo_bo_edge {
#define PQ_LEFT_CHILD_INDEX(i) ((i) << 1)
typedef enum {
- CAIRO_BO_EVENT_TYPE_STOP,
+ CAIRO_BO_EVENT_TYPE_STOP = -1,
CAIRO_BO_EVENT_TYPE_INTERSECTION,
CAIRO_BO_EVENT_TYPE_START
} cairo_bo_event_type_t;
@@ -783,7 +783,7 @@ cairo_bo_event_compare (const cairo_bo_event_t *a,
if (cmp)
return cmp;
- return a - b;
+ return a < b ? -1 : a == b ? 0 : 1;
}
static inline void
commit 6879be20f03a1347e16cda2f603b0fedf256caf0
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date: Tue Sep 23 12:37:20 2014 +0200
polygon-intersection: Include approximation in intersection points
In Hobby's paper it is proved that INTERSECTION events can be
processed in any order by ignoring intersections between edges
non-adjacent in the active edges list.
But with respect to START/STOP events they must be processed in
order. Because START/STOP events have always exact y, it is
sufficient to know whether an integer y intersection is a
default/excess approximation of the exact to properly sort events.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index c574154..02ef3b5 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -42,11 +42,10 @@
#include "cairo-freelist-private.h"
#include "cairo-combsort-inline.h"
-typedef cairo_point_t cairo_bo_point32_t;
typedef struct _cairo_bo_intersect_ordinate {
int32_t ordinate;
- enum { EXACT, INEXACT } exactness;
+ enum { EXCESS = -1, EXACT = 0, DEFAULT = 1 } approx;
} cairo_bo_intersect_ordinate_t;
typedef struct _cairo_bo_intersect_point {
@@ -84,18 +83,18 @@ typedef enum {
typedef struct _cairo_bo_event {
cairo_bo_event_type_t type;
- cairo_point_t point;
+ cairo_bo_intersect_point_t point;
} cairo_bo_event_t;
typedef struct _cairo_bo_start_event {
cairo_bo_event_type_t type;
- cairo_point_t point;
+ cairo_bo_intersect_point_t point;
cairo_bo_edge_t edge;
} cairo_bo_start_event_t;
typedef struct _cairo_bo_queue_event {
cairo_bo_event_type_t type;
- cairo_point_t point;
+ cairo_bo_intersect_point_t point;
cairo_bo_edge_t *e1;
cairo_bo_edge_t *e2;
} cairo_bo_queue_event_t;
@@ -142,16 +141,20 @@ _line_compute_intersection_x_for_y (const cairo_line_t *line,
}
static inline int
-_cairo_bo_point32_compare (cairo_bo_point32_t const *a,
- cairo_bo_point32_t const *b)
+_cairo_bo_point32_compare (cairo_bo_intersect_point_t const *a,
+ cairo_bo_intersect_point_t const *b)
{
int cmp;
- cmp = a->y - b->y;
+ cmp = a->y.ordinate - b->y.ordinate;
if (cmp)
return cmp;
- return a->x - b->x;
+ cmp = a->y.approx - b->y.approx;
+ if (cmp)
+ return cmp;
+
+ return a->x.ordinate - b->x.ordinate;
}
/* Compare the slope of a to the slope of b, returning 1, 0, -1 if the
@@ -525,6 +528,30 @@ det64x32_128 (cairo_int64_t a, int32_t b,
_cairo_int64x32_128_mul (c, b));
}
+static inline cairo_bo_intersect_ordinate_t
+round_to_nearest (cairo_quorem64_t d,
+ cairo_int64_t den)
+{
+ cairo_bo_intersect_ordinate_t ordinate;
+ int32_t quo = d.quo;
+ cairo_int64_t drem_2 = _cairo_int64_mul (d.rem, _cairo_int32_to_int64 (2));
+
+ /* assert (! _cairo_int64_negative (den));*/
+
+ if (_cairo_int64_lt (drem_2, _cairo_int64_negate (den))) {
+ quo -= 1;
+ drem_2 = _cairo_int64_negate (drem_2);
+ } else if (_cairo_int64_le (den, drem_2)) {
+ quo += 1;
+ drem_2 = _cairo_int64_negate (drem_2);
+ }
+
+ ordinate.ordinate = quo;
+ ordinate.approx = _cairo_int64_is_zero (drem_2) ? EXACT : _cairo_int64_negative (drem_2) ? EXCESS : DEFAULT;
+
+ return ordinate;
+}
+
/* Compute the intersection of two lines as defined by two edges. The
* result is provided as a coordinate pair of 128-bit integers.
*
@@ -610,22 +637,8 @@ intersect_lines (cairo_bo_edge_t *a,
den_det);
if (_cairo_int64_eq (qr.rem, den_det))
return FALSE;
-#if 0
- intersection->x.exactness = _cairo_int64_is_zero (qr.rem) ? EXACT : INEXACT;
-#else
- intersection->x.exactness = EXACT;
- if (! _cairo_int64_is_zero (qr.rem)) {
- if (_cairo_int64_negative (den_det) ^ _cairo_int64_negative (qr.rem))
- qr.rem = _cairo_int64_negate (qr.rem);
- qr.rem = _cairo_int64_mul (qr.rem, _cairo_int32_to_int64 (2));
- if (_cairo_int64_ge (qr.rem, den_det)) {
- qr.quo = _cairo_int64_add (qr.quo,
- _cairo_int32_to_int64 (_cairo_int64_negative (qr.quo) ? -1 : 1));
- } else
- intersection->x.exactness = INEXACT;
- }
-#endif
- intersection->x.ordinate = _cairo_int64_to_int32 (qr.quo);
+
+ intersection->x = round_to_nearest (qr, den_det);
/* y = det (a_det, dy1, b_det, dy2) / den_det */
qr = _cairo_int_96by64_32x64_divrem (det64x32_128 (a_det, dy1,
@@ -633,22 +646,8 @@ intersect_lines (cairo_bo_edge_t *a,
den_det);
if (_cairo_int64_eq (qr.rem, den_det))
return FALSE;
-#if 0
- intersection->y.exactness = _cairo_int64_is_zero (qr.rem) ? EXACT : INEXACT;
-#else
- intersection->y.exactness = EXACT;
- if (! _cairo_int64_is_zero (qr.rem)) {
- if (_cairo_int64_negative (den_det) ^ _cairo_int64_negative (qr.rem))
- qr.rem = _cairo_int64_negate (qr.rem);
- qr.rem = _cairo_int64_mul (qr.rem, _cairo_int32_to_int64 (2));
- if (_cairo_int64_ge (qr.rem, den_det)) {
- qr.quo = _cairo_int64_add (qr.quo,
- _cairo_int32_to_int64 (_cairo_int64_negative (qr.quo) ? -1 : 1));
- } else
- intersection->y.exactness = INEXACT;
- }
-#endif
- intersection->y.ordinate = _cairo_int64_to_int32 (qr.quo);
+
+ intersection->y = round_to_nearest (qr, den_det);
return TRUE;
}
@@ -662,9 +661,8 @@ _cairo_bo_intersect_ordinate_32_compare (cairo_bo_intersect_ordinate_t a,
return +1;
if (a.ordinate < b)
return -1;
- /* With quotient identical, if remainder is 0 then compare equal */
- /* Otherwise, the non-zero remainder makes a > b */
- return INEXACT == a.exactness;
+
+ return a.approx; /* == EXCESS ? -1 : a.approx == EXACT ? 0 : 1;*/
}
/* Does the given edge contain the given point. The point must already
@@ -757,27 +755,17 @@ _cairo_bo_edge_contains_intersect_point (cairo_bo_edge_t *edge,
static cairo_bool_t
_cairo_bo_edge_intersect (cairo_bo_edge_t *a,
cairo_bo_edge_t *b,
- cairo_bo_point32_t *intersection)
+ cairo_bo_intersect_point_t *intersection)
{
- cairo_bo_intersect_point_t quorem;
-
- if (! intersect_lines (a, b, &quorem))
+ if (! intersect_lines (a, b, intersection))
return FALSE;
- if (! _cairo_bo_edge_contains_intersect_point (a, &quorem))
+ if (! _cairo_bo_edge_contains_intersect_point (a, intersection))
return FALSE;
- if (! _cairo_bo_edge_contains_intersect_point (b, &quorem))
+ if (! _cairo_bo_edge_contains_intersect_point (b, intersection))
return FALSE;
- /* Now that we've correctly compared the intersection point and
- * determined that it lies within the edge, then we know that we
- * no longer need any more bits of storage for the intersection
- * than we do for our edge coordinates. We also no longer need the
- * remainder from the division. */
- intersection->x = quorem.x.ordinate;
- intersection->y = quorem.y.ordinate;
-
return TRUE;
}
@@ -907,7 +895,7 @@ _cairo_bo_event_queue_insert (cairo_bo_event_queue_t *queue,
cairo_bo_event_type_t type,
cairo_bo_edge_t *e1,
cairo_bo_edge_t *e2,
- const cairo_point_t *point)
+ const cairo_bo_intersect_point_t *point)
{
cairo_bo_queue_event_t *event;
@@ -975,11 +963,14 @@ static cairo_status_t
event_queue_insert_stop (cairo_bo_event_queue_t *event_queue,
cairo_bo_edge_t *edge)
{
- cairo_bo_point32_t point;
+ cairo_bo_intersect_point_t point;
+
+ point.y.ordinate = edge->edge.bottom;
+ point.y.approx = EXACT;
+ point.x.ordinate = _line_compute_intersection_x_for_y (&edge->edge.line,
+ point.y.ordinate);
+ point.x.approx = EXACT;
- point.y = edge->edge.bottom;
- point.x = _line_compute_intersection_x_for_y (&edge->edge.line,
- point.y);
return _cairo_bo_event_queue_insert (event_queue,
CAIRO_BO_EVENT_TYPE_STOP,
edge, NULL,
@@ -998,7 +989,7 @@ event_queue_insert_if_intersect_below_current_y (cairo_bo_event_queue_t *event_q
cairo_bo_edge_t *left,
cairo_bo_edge_t *right)
{
- cairo_bo_point32_t intersection;
+ cairo_bo_intersect_point_t intersection;
if (_line_equal (&left->edge.line, &right->edge.line))
return CAIRO_STATUS_SUCCESS;
@@ -1267,11 +1258,11 @@ intersection_sweep (cairo_bo_event_t **start_events,
_cairo_bo_sweep_line_init (&sweep_line);
while ((event = _cairo_bo_event_dequeue (&event_queue))) {
- if (event->point.y != sweep_line.current_y) {
+ if (event->point.y.ordinate != sweep_line.current_y) {
active_edges (sweep_line.head,
sweep_line.current_y,
polygon);
- sweep_line.current_y = event->point.y;
+ sweep_line.current_y = event->point.y.ordinate;
}
switch (event->type) {
@@ -1418,10 +1409,12 @@ _cairo_polygon_intersect (cairo_polygon_t *a, int winding_a,
event_ptrs[j] = (cairo_bo_event_t *) &events[j];
events[j].type = CAIRO_BO_EVENT_TYPE_START;
- events[j].point.y = a->edges[i].top;
- events[j].point.x =
+ events[j].point.y.ordinate = a->edges[i].top;
+ events[j].point.y.approx = EXACT;
+ events[j].point.x.ordinate =
_line_compute_intersection_x_for_y (&a->edges[i].line,
- events[j].point.y);
+ events[j].point.y.ordinate);
+ events[j].point.x.approx = EXACT;
events[j].edge.a_or_b = 0;
events[j].edge.edge = a->edges[i];
@@ -1435,10 +1428,12 @@ _cairo_polygon_intersect (cairo_polygon_t *a, int winding_a,
event_ptrs[j] = (cairo_bo_event_t *) &events[j];
events[j].type = CAIRO_BO_EVENT_TYPE_START;
- events[j].point.y = b->edges[i].top;
- events[j].point.x =
+ events[j].point.y.ordinate = b->edges[i].top;
+ events[j].point.y.approx = EXACT;
+ events[j].point.x.ordinate =
_line_compute_intersection_x_for_y (&b->edges[i].line,
- events[j].point.y);
+ events[j].point.y.ordinate);
+ events[j].point.x.approx = EXACT;
events[j].edge.a_or_b = 1;
events[j].edge.edge = b->edges[i];
commit 9db73dd41784880948e4dbd49379984467dc0f14
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date: Tue Sep 23 12:37:08 2014 +0200
polygon-intersection: Do not discard intersection exactly at top edge
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index 2cd73d2..c574154 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -728,7 +728,7 @@ _cairo_bo_edge_contains_intersect_point (cairo_bo_edge_t *edge,
top_x = _line_compute_intersection_x_for_y (&edge->edge.line,
edge->edge.top);
- return _cairo_bo_intersect_ordinate_32_compare (point->x, top_x) > 0;
+ return _cairo_bo_intersect_ordinate_32_compare (point->x, top_x) >= 0;
} else { /* cmp_bottom == 0 */
cairo_fixed_t bot_x;
commit d00f8133ef84bb01a2f54ab0a3cec9529de7921c
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Thu Jun 4 14:24:31 2015 -0700
cairo-script: Improve buffer length check
Quells the following warning:
cairo-script-scanner.c: In function ‘_translate_string’:
cairo-script-scanner.c:1623:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (buf_len <= 8 + 2*string->len) {
^
diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index 4254aa0..84b45df 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -1620,7 +1620,8 @@ _translate_string (csi_t *ctx,
if (uncompress ((Bytef *) buf, &buf_len,
(Bytef *) string->string, string->len) == Z_OK)
{
- if (buf_len <= 8 + 2*string->len) {
+ assert(string->len > 0);
+ if (buf_len <= 8 + 2*((unsigned long)string->len)) {
method = NONE;
deflate = 0;
} else {
commit 34ba17b01b4dc09f6ece1a45b635e04900b722d0
Author: Julien Isorce <j.isorce at samsung.com>
Date: Wed Sep 3 10:58:18 2014 +0100
build: Show all disabled features in cairo-features.h
Even features which are disabled by default should appear in
cairo-features.h.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83359
(Patch approved by Behdad Esfahbod in bug tracker.)
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/build/configure.ac.features b/build/configure.ac.features
index e4a2aaf..77f2035 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -241,7 +241,7 @@ CAIRO_FEATURE_HOOK_REGISTER(*,!no,!,dnl
])dnl
dnl Collect list of all supported disabled public features
CAIRO_ACCUMULATORS_REGISTER(NO_FEATURES,[ ])dnl
-CAIRO_FEATURE_HOOK_REGISTER(no,!no,!,
+CAIRO_FEATURE_HOOK_REGISTER(no,*,!,
[dnl
CAIRO_ACCUMULATE(NO_FEATURES, cr_feature_tag)
])dnl
commit da8b29e21f641621e10e1b218e231ae10798b1b4
Author: Nathan Froyd <froydnj at mozilla.com>
Date: Mon May 4 13:38:41 2015 -0400
Support new-style __atomic_* primitives
Recent versions of GCC/clang feature a new set of compiler intrinsics
for performing atomic operations, motivated by the operations needed to
support the C++11 memory model. These intrinsics are more flexible than
the old __sync_* intrinstics and offer efficient support for atomic load
and store operations.
Having the load appear atomic to the compiler is particular important
for tools like ThreadSanitizer so they don't report false positives on
memory operations that we intend to be atomic.
Patch from Nathan Froyd <froydnj at mozilla.com>
diff --git a/build/aclocal.cairo.m4 b/build/aclocal.cairo.m4
index 2f4873b..44ba5fd 100644
--- a/build/aclocal.cairo.m4
+++ b/build/aclocal.cairo.m4
@@ -168,6 +168,13 @@ int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i
cairo_cv_atomic_primitives="Intel"
)
+ AC_TRY_LINK([
+int atomic_add(int i) { return __atomic_fetch_add(&i, 1, __ATOMIC_SEQ_CST); }
+int atomic_cmpxchg(int i, int j, int k) { return __atomic_compare_exchange_n(&i, &j, k, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
+], [],
+ cairo_cv_atomic_primitives="cxx11"
+ )
+
if test "x$cairo_cv_atomic_primitives" = "xnone"; then
AC_CHECK_HEADER([atomic_ops.h],
cairo_cv_atomic_primitives="libatomic-ops")
@@ -178,6 +185,11 @@ int atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i
cairo_cv_atomic_primitives="OSAtomic")
fi
])
+ if test "x$cairo_cv_atomic_primitives" = xcxx11; then
+ AC_DEFINE(HAVE_CXX11_ATOMIC_PRIMITIVES, 1,
+ [Enable if your compiler supports the GCC __atomic_* atomic primitives])
+ fi
+
if test "x$cairo_cv_atomic_primitives" = xIntel; then
AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1,
[Enable if your compiler supports the Intel __sync_* atomic primitives])
diff --git a/src/cairo-atomic-private.h b/src/cairo-atomic-private.h
index 327fed1..11b2887 100644
--- a/src/cairo-atomic-private.h
+++ b/src/cairo-atomic-private.h
@@ -53,6 +53,96 @@
CAIRO_BEGIN_DECLS
+/* C++11 atomic primitives were designed to be more flexible than the
+ * __sync_* family of primitives. Despite the name, they are available
+ * in C as well as C++. The motivating reason for using them is that
+ * for _cairo_atomic_{int,ptr}_get, the compiler is able to see that
+ * the load is intended to be atomic, as opposed to the __sync_*
+ * version, below, where the load looks like a plain load. Having
+ * the load appear atomic to the compiler is particular important for
+ * tools like ThreadSanitizer so they don't report false positives on
+ * memory operations that we intend to be atomic.
+ */
+#if HAVE_CXX11_ATOMIC_PRIMITIVES
+
+#define HAS_ATOMIC_OPS 1
+
+typedef int cairo_atomic_int_t;
+
+static cairo_always_inline cairo_atomic_int_t
+_cairo_atomic_int_get (cairo_atomic_int_t *x)
+{
+ return __atomic_load_n(x, __ATOMIC_SEQ_CST);
+}
+
+static cairo_always_inline void *
+_cairo_atomic_ptr_get (void **x)
+{
+ return __atomic_load_n(x, __ATOMIC_SEQ_CST);
+}
+
+# define _cairo_atomic_int_inc(x) ((void) __atomic_fetch_add(x, 1, __ATOMIC_SEQ_CST))
+# define _cairo_atomic_int_dec(x) ((void) __atomic_fetch_sub(x, 1, __ATOMIC_SEQ_CST))
+# define _cairo_atomic_int_dec_and_test(x) (__atomic_fetch_sub(x, 1, __ATOMIC_SEQ_CST) == 1)
+
+#if SIZEOF_VOID_P==SIZEOF_INT
+typedef int cairo_atomic_intptr_t;
+#elif SIZEOF_VOID_P==SIZEOF_LONG
+typedef long cairo_atomic_intptr_t;
+#elif SIZEOF_VOID_P==SIZEOF_LONG_LONG
+typedef long long cairo_atomic_intptr_t;
+#else
+#error No matching integer pointer type
+#endif
+
+static cairo_always_inline cairo_bool_t
+_cairo_atomic_int_cmpxchg_impl(cairo_atomic_int_t *x,
+ cairo_atomic_int_t oldv,
+ cairo_atomic_int_t newv)
+{
+ cairo_atomic_int_t expected = oldv;
+ return __atomic_compare_exchange_n(x, &expected, newv, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+}
+
+#define _cairo_atomic_int_cmpxchg(x, oldv, newv) \
+ _cairo_atomic_int_cmpxchg_impl(x, oldv, newv)
+
+static cairo_always_inline cairo_atomic_int_t
+_cairo_atomic_int_cmpxchg_return_old_impl(cairo_atomic_int_t *x,
+ cairo_atomic_int_t oldv,
+ cairo_atomic_int_t newv)
+{
+ cairo_atomic_int_t expected = oldv;
+ (void) __atomic_compare_exchange_n(x, &expected, newv, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+ return expected;
+}
+
+#define _cairo_atomic_int_cmpxchg_return_old(x, oldv, newv) \
+ _cairo_atomic_int_cmpxchg_return_old_impl(x, oldv, newv)
+
+static cairo_always_inline cairo_bool_t
+_cairo_atomic_ptr_cmpxchg_impl(void **x, void *oldv, void *newv)
+{
+ void *expected = oldv;
+ return __atomic_compare_exchange_n(x, &expected, newv, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+}
+
+#define _cairo_atomic_ptr_cmpxchg(x, oldv, newv) \
+ _cairo_atomic_ptr_cmpxchg_impl(x, oldv, newv)
+
+static cairo_always_inline void *
+_cairo_atomic_ptr_cmpxchg_return_old_impl(void **x, void *oldv, void *newv)
+{
+ void *expected = oldv;
+ (void) __atomic_compare_exchange_n(x, &expected, newv, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+ return expected;
+}
+
+#define _cairo_atomic_ptr_cmpxchg_return_old(x, oldv, newv) \
+ _cairo_atomic_ptr_cmpxchg_return_old_impl(x, oldv, newv)
+
+#endif
+
#if HAVE_INTEL_ATOMIC_PRIMITIVES
#define HAS_ATOMIC_OPS 1
commit 010fb4c4370686b76f0f0aa226a65576bac8938b
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Thu May 21 22:37:06 2015 +0930
cff: ensure glyph widths are positive when font matrix yy is negative
Bug 90538
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index f15deb5..3ffe6f6 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -1163,8 +1163,8 @@ cairo_cff_font_read_font_metrics (cairo_cff_font_t *font, cairo_hash_table_t *t
if (p < end)
p = decode_number (p, &yy);
}
- /* Freetype uses 1/yy to get units per EM */
- font->units_per_em = _cairo_round(1.0/yy);
+ /* Freetype uses 1/abs(yy) to get units per EM */
+ font->units_per_em = _cairo_round(1.0/fabs(yy));
}
static cairo_int_status_t
commit 3f6f251e7ffe003e541ec38281ee0b95a3204a66
Author: Zan Dobersek <zdobersek at igalia.com>
Date: Fri May 8 01:50:25 2015 -0700
Manually transpose the matrix in _cairo_gl_shader_bind_matrix()
To maintain compatibility with OpenGL ES 2.0, the matrix in
_cairo_gl_shader_bind_matrix() should be manually transposed,
and GL_FALSE passed as the transpose argument to the
glUniformMatrix3fv() call as it is the only valid value for
that parameter in OpenGL ES 2.0.
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
Acked-by: "Henry (Yu) Song" <henry.song at samsung.com>
diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 2710606..fe975d2 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -973,12 +973,12 @@ _cairo_gl_shader_bind_matrix (cairo_gl_context_t *ctx,
{
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
float gl_m[9] = {
- m->xx, m->xy, m->x0,
- m->yx, m->yy, m->y0,
- 0, 0, 1
+ m->xx, m->yx, 0,
+ m->xy, m->yy, 0,
+ m->x0, m->y0, 1
};
assert (location != -1);
- dispatch->UniformMatrix3fv (location, 1, GL_TRUE, gl_m);
+ dispatch->UniformMatrix3fv (location, 1, GL_FALSE, gl_m);
}
void
commit 6156a4d64548ef60a8fd9c872fb12b5f34441e12
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Fri Apr 24 18:23:46 2015 -0700
Fix broken canvas text font size in Inkscape
An earlier fix to bug 84324 added a regression in the font size of
canvas text in Inkscape when compiled with the Quartz backend.
Patch from Andrea Canciani
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84324
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c
index 02f3426..feee61a 100644
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -560,7 +560,7 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
-font->base.scale.yy,
0, 0);
- ctFont = CTFontCreateWithGraphicsFont (font_face->cgFont, 0.0, NULL, NULL);
+ ctFont = CTFontCreateWithGraphicsFont (font_face->cgFont, 1.0, NULL, NULL);
glyphPath = CTFontCreatePathForGlyph (ctFont, glyph, &textMatrix);
CFRelease (ctFont);
if (!glyphPath)
commit bfbc1649a13d7743e143db3dd6c68c9f5865ac23
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Apr 21 14:29:41 2015 -0700
[ft] Return CAIRO_STATUS_FILE_NOT_FOUND if font file can't be opened
A common source of error when people are setting up pango on a new
device is when font files don't have the right permissions and cannot
be opened. Cairo was returning out-of-memory before, making the
Pango error message useless.
With this change, cairo will return file-not-found, and pango prints
that out. It's still not ideal; a ENOACCESS equivalent would have
been better.
[update: Fixed a couple goofs]
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index 3bcd2a1..795951b 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -67,6 +67,13 @@ const cairo_font_face_t _cairo_font_face_nil = {
{ 0, 0, 0, NULL }, /* user_data */
NULL
};
+const cairo_font_face_t _cairo_font_face_nil_file_not_found = {
+ { 0 }, /* hash_entry */
+ CAIRO_STATUS_FILE_NOT_FOUND, /* status */
+ CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
+ { 0, 0, 0, NULL }, /* user_data */
+ NULL
+};
cairo_status_t
_cairo_font_face_set_error (cairo_font_face_t *font_face,
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 87e733b..3e485c5 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -216,6 +216,17 @@ _cairo_ft_resolve_pattern (FcPattern *pattern,
#endif
+static cairo_status_t
+_ft_to_cairo_error (FT_Error error)
+{
+ /* Currently we don't get many (any?) useful statuses here.
+ * Populate as needed. */
+ switch (error)
+ {
+ default: return CAIRO_STATUS_NO_MEMORY;
+ }
+}
+
/*
* We maintain a hash table to map file/id => #cairo_ft_unscaled_font_t.
* The hash table itself isn't limited in size. However, we limit the
@@ -645,6 +656,7 @@ _cairo_ft_unscaled_font_lock_face (cairo_ft_unscaled_font_t *unscaled)
{
cairo_ft_unscaled_font_map_t *font_map;
FT_Face face = NULL;
+ FT_Error error;
CAIRO_MUTEX_LOCK (unscaled->mutex);
unscaled->lock_count++;
@@ -674,14 +686,15 @@ _cairo_ft_unscaled_font_lock_face (cairo_ft_unscaled_font_t *unscaled)
}
_cairo_ft_unscaled_font_map_unlock ();
- if (FT_New_Face (font_map->ft_library,
- unscaled->filename,
- unscaled->id,
- &face) != FT_Err_Ok)
+ error = FT_New_Face (font_map->ft_library,
+ unscaled->filename,
+ unscaled->id,
+ &face);
+ if (error)
{
unscaled->lock_count--;
CAIRO_MUTEX_UNLOCK (unscaled->mutex);
- _cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
+ _cairo_error_throw (_ft_to_cairo_error (error));
return NULL;
}
@@ -835,7 +848,7 @@ _cairo_ft_unscaled_font_set_scale (cairo_ft_unscaled_font_t *unscaled,
sf.y_scale * 64.0 + .5,
0, 0);
if (error)
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ return _cairo_error (_ft_to_cairo_error (error));
return CAIRO_STATUS_SUCCESS;
}
@@ -1240,6 +1253,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
FT_Bitmap tmp;
FT_Int align;
+ FT_Error error;
format = CAIRO_FORMAT_A8;
@@ -1247,8 +1261,9 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
FT_Bitmap_New( &tmp );
- if (FT_Bitmap_Convert( library, bitmap, &tmp, align ))
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ error = FT_Bitmap_Convert( library, bitmap, &tmp, align );
+ if (error)
+ return _cairo_error (_ft_to_cairo_error (error));
FT_Bitmap_Done( library, bitmap );
*bitmap = tmp;
@@ -1277,7 +1292,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
default:
if (own_buffer)
free (bitmap->buffer);
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
}
/* XXX */
@@ -1328,7 +1343,7 @@ _render_glyph_outline (FT_Face face,
FT_BBox cbox;
unsigned int width, height;
cairo_status_t status;
- FT_Error fterror;
+ FT_Error error;
FT_Library library = glyphslot->library;
FT_Render_Mode render_mode = FT_RENDER_MODE_NORMAL;
@@ -1441,20 +1456,20 @@ _render_glyph_outline (FT_Face face,
FT_Library_SetLcdFilter (library, lcd_filter);
#endif
- fterror = FT_Render_Glyph (face->glyph, render_mode);
+ error = FT_Render_Glyph (face->glyph, render_mode);
#if HAVE_FT_LIBRARY_SETLCDFILTER
FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE);
#endif
- if (fterror != 0)
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ if (error)
+ return _cairo_error (_ft_to_cairo_error (error));
bitmap_size = _compute_xrender_bitmap_size (&bitmap,
face->glyph,
render_mode);
if (bitmap_size < 0)
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
bitmap.buffer = calloc (1, bitmap_size);
if (bitmap.buffer == NULL)
@@ -3284,8 +3299,12 @@ cairo_ft_font_face_create_for_pattern (FcPattern *pattern)
cairo_status_t status;
status = _cairo_ft_unscaled_font_create_for_pattern (pattern, &unscaled);
- if (unlikely (status))
+ if (unlikely (status)) {
+ if (status == CAIRO_STATUS_FILE_NOT_FOUND)
+ return (cairo_font_face_t *) &_cairo_font_face_nil_file_not_found;
+ else
return (cairo_font_face_t *) &_cairo_font_face_nil;
+ }
if (unlikely (unscaled == NULL)) {
/* Store the pattern. We will resolve it and create unscaled
* font when creating scaled fonts */
diff --git a/src/cairoint.h b/src/cairoint.h
index 5bca003..555aa89 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -814,6 +814,7 @@ _cairo_color_get_content (const cairo_color_t *color) cairo_pure;
/* cairo-font-face.c */
extern const cairo_private cairo_font_face_t _cairo_font_face_nil;
+extern const cairo_private cairo_font_face_t _cairo_font_face_nil_file_not_found;
cairo_private void
_cairo_font_face_init (cairo_font_face_t *font_face,
commit 4dc3f3d7f21ef23bcb767d8118382427ad431f6c
Author: 江頭幸路 <koji.egashira at access-company.com>
Date: Fri Apr 17 20:59:17 2015 +0900
Avoid appending an empty slot to an user data array when user_data is NULL.
Otherwise, calling cairo_set_user_data(cr, key, 0, 0) many times
causes a long user data array, almost all of whose slots are empty.
It leads to unnecessarily much memory consumption and long execution time of
cairo_set_user_data(cr, key, 0, 0) and cairo_get_user_data(cr, key) after
it.
This issue probably happens since the commit
http://cgit.freedesktop.org/cairo/commit/?id=9341c254a
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-array.c b/src/cairo-array.c
index 4f3c082..58c9a38 100644
--- a/src/cairo-array.c
+++ b/src/cairo-array.c
@@ -485,6 +485,9 @@ _cairo_user_data_array_set_data (cairo_user_data_array_t *array,
return CAIRO_STATUS_SUCCESS;
}
+ if (user_data == NULL)
+ return CAIRO_STATUS_SUCCESS;
+
status = _cairo_array_append (array, &new_slot);
if (unlikely (status))
return status;
commit 1bd07b2d1949f4159cf542f0aaef248788c96422
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Thu Apr 9 01:31:34 2015 +0200
test: Correct bug number in clip-complex-bug61592
The filename of the C source file is correct, but the test name (both
as function name and as reference image name) has a typo in it.
Related to https://bugs.freedesktop.org/show_bug.cgi?id=61592
diff --git a/test/clip-complex-bug61592.c b/test/clip-complex-bug61592.c
index 998b7aa..46f8fb8 100644
--- a/test/clip-complex-bug61592.c
+++ b/test/clip-complex-bug61592.c
@@ -52,7 +52,7 @@ draw (cairo_t *cr, int width, int height)
return CAIRO_TEST_SUCCESS;
}
-CAIRO_TEST (clip_complex_bug61492,
+CAIRO_TEST (clip_complex_bug61592,
"Exercise a bug found in 1.12",
"clip", /* keywords */
NULL, /* requirements */
diff --git a/test/reference/clip-complex-bug61492.ref.png b/test/reference/clip-complex-bug61492.ref.png
deleted file mode 100644
index 8e2e982..0000000
Binary files a/test/reference/clip-complex-bug61492.ref.png and /dev/null differ
diff --git a/test/reference/clip-complex-bug61592.ref.png b/test/reference/clip-complex-bug61592.ref.png
new file mode 100644
index 0000000..8e2e982
Binary files /dev/null and b/test/reference/clip-complex-bug61592.ref.png differ
commit 549e511814c4ebb476b6e45871ab7734f7ca915d
Author: Руслан Ижбулатов <lrn1986 at gmail.com>
Date: Sat Apr 4 15:58:53 2015 +0000
win32: Add a win32 boilerplate that uses a real window
This way it uses the codepath for cairo_win32_surface_create_with_format(),
instead of the cairo_win32_surface_create_with_dib().
Without the recording tests (which terminate the testsuite)
the testsuite results for win32 are:
284 Passed, 167 Failed [1 crashed, 9 expected], 23 Skipped
win32 (rgb24): 1 crashed!
win32 (rgb24): 17 error
win32 (rgb24): 155 failed
win32 (argb32): 1 crashed!
win32 (argb32): 17 error
win32 (argb32): 68 failed
win32-window-color (rgb24): 1 crashed!
win32-window-color (rgb24): 17 error
win32-window-color (rgb24): 148 failed
win32-window-coloralpha (argb32): 1 crashed!
win32-window-coloralpha (argb32): 17 error
win32-window-coloralpha (argb32): 66 failed
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 7469cc7..4fd0a10 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -28,15 +28,191 @@
#include <cairo-win32.h>
+static const cairo_user_data_key_t win32_closure_key;
+
+typedef struct _win32_target_closure {
+ HWND wnd;
+ HDC dc;
+ ATOM bpl_atom;
+ cairo_surface_t *surface;
+} win32_target_closure_t;
+
+static void
+_cairo_boilerplate_win32_cleanup_window_surface (void *closure)
+{
+ win32_target_closure_t *win32tc = closure;
+
+ if (win32tc != NULL)
+ {
+ if (win32tc->wnd != NULL &&
+ ReleaseDC (win32tc->wnd, win32tc->dc) != 1)
+ fprintf (stderr,
+ "Failed to release DC of a test window when cleaning up.\n");
+ if (win32tc->wnd != NULL &&
+ DestroyWindow (win32tc->wnd) == 0)
+ fprintf (stderr,
+ "Failed to destroy a test window when cleaning up, GLE is %lu.\n",
+ GetLastError ());
+ if (win32tc->bpl_atom != 0 &&
+ UnregisterClassA ((LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0), GetModuleHandle (NULL)) == 0 &&
+ GetLastError () != ERROR_CLASS_DOES_NOT_EXIST)
+ fprintf (stderr,
+ "Failed to unregister boilerplate window class, GLE is %lu.\n",
+ GetLastError ());
+
+ free (win32tc);
+ }
+}
+
+static win32_target_closure_t *
+_cairo_boilerplate_win32_create_window (int width,
+ int height)
+{
+ WNDCLASSEXA wincl;
+ win32_target_closure_t *win32tc;
+ LPCSTR window_class_name;
+
+ ZeroMemory (&wincl, sizeof (WNDCLASSEXA));
+ wincl.cbSize = sizeof (WNDCLASSEXA);
+ wincl.hInstance = GetModuleHandle (0);
+ wincl.lpszClassName = "cairo_boilerplate_win32_dummy";
+ wincl.lpfnWndProc = DefWindowProcA;
+ wincl.style = CS_OWNDC;
+
+ win32tc = calloc (1, sizeof (win32_target_closure_t));
+
+ if (win32tc == NULL)
+ {
+ int error = errno;
+ fprintf (stderr, "Ran out of memory: %d.\n", error);
+ return NULL;
+ }
+
+ ZeroMemory (win32tc, sizeof (win32_target_closure_t));
+
+ win32tc->bpl_atom = RegisterClassExA (&wincl);
+
+ if (win32tc->bpl_atom == 0 && GetLastError () != ERROR_CLASS_ALREADY_EXISTS)
+ {
+ fprintf (stderr,
+ "Failed to register a boilerplate window class, GLE is %lu.\n",
+ GetLastError ());
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ if (win32tc->bpl_atom == 0)
+ window_class_name = wincl.lpszClassName;
+ else
+ window_class_name = (LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0);
+
+ win32tc->wnd = CreateWindowExA (WS_EX_TOOLWINDOW,
+ window_class_name,
+ 0,
+ WS_POPUP,
+ 0,
+ 0,
+ width,
+ height,
+ 0,
+ 0,
+ 0,
+ 0);
+
+ if (win32tc->wnd == NULL)
+ {
+ fprintf (stderr,
+ "Failed to create a test window, GLE is %lu.\n",
+ GetLastError ());
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ win32tc->dc = GetDC (win32tc->wnd);
+
+ if (win32tc->dc == NULL)
+ {
+ fprintf (stderr, "Failed to get test window DC.\n");
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ SetWindowPos (win32tc->wnd,
+ HWND_BOTTOM,
+ INT_MIN,
+ INT_MIN,
+ width,
+ height,
+ SWP_NOACTIVATE | SWP_SHOWWINDOW);
+
+ return win32tc;
+}
+
static cairo_surface_t *
-_cairo_boilerplate_win32_create_surface (const char *name,
- cairo_content_t content,
- double width,
- double height,
- double max_width,
- double max_height,
- cairo_boilerplate_mode_t mode,
- void **closure)
+_cairo_boilerplate_win32_create_window_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
+{
+ win32_target_closure_t *win32tc;
+ cairo_surface_t *surface;
+ cairo_format_t format;
+ cairo_status_t status;
+
+ win32tc = _cairo_boilerplate_win32_create_window (width, height);
+
+ if (win32tc == NULL)
+ return NULL;
+
+ format = cairo_boilerplate_format_from_content (content);
+
+ surface = cairo_win32_surface_create_with_format (win32tc->dc, format);
+
+ win32tc->surface = surface;
+
+ status = cairo_surface_status (surface);
+
+ if (status != CAIRO_STATUS_SUCCESS)
+ {
+ fprintf (stderr,
+ "Failed to create the test surface: %s [%d].\n",
+ cairo_status_to_string (status), status);
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+ return NULL;
+ }
+
+ status = cairo_surface_set_user_data (surface, &win32_closure_key, win32tc, NULL);
+
+ if (status != CAIRO_STATUS_SUCCESS)
+ {
+ fprintf (stderr,
+ "Failed to set surface userdata: %s [%d].\n",
+ cairo_status_to_string (status), status);
+
+ cairo_surface_destroy (surface);
+ _cairo_boilerplate_win32_cleanup_window_surface (win32tc);
+
+ return NULL;
+ }
+
+ *closure = win32tc;
+
+ return surface;
+}
+
+static cairo_surface_t *
+_cairo_boilerplate_win32_create_dib_surface (const char *name,
+ cairo_content_t content,
+ double width,
+ double height,
+ double max_width,
+ double max_height,
+ cairo_boilerplate_mode_t mode,
+ void **closure)
{
cairo_format_t format;
@@ -52,12 +228,16 @@ static const cairo_boilerplate_target_t targets[] = {
"win32", "win32", NULL, NULL,
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
"cairo_win32_surface_create_with_dib",
- _cairo_boilerplate_win32_create_surface,
+ _cairo_boilerplate_win32_create_dib_surface,
cairo_surface_create_similar,
- NULL, NULL,
+ NULL,
+ NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
- NULL, NULL, NULL, TRUE, FALSE, FALSE
+ NULL,
+ NULL,
+ NULL,
+ TRUE, FALSE, FALSE
},
/* Testing the win32 surface isn't interesting, since for
* ARGB images it just chains to the image backend
@@ -66,12 +246,46 @@ static const cairo_boilerplate_target_t targets[] = {
"win32", "win32", NULL, NULL,
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_win32_surface_create_with_dib",
- _cairo_boilerplate_win32_create_surface,
+ _cairo_boilerplate_win32_create_dib_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ NULL,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "win32-window-color", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 1,
+ "cairo_win32_surface_create",
+ _cairo_boilerplate_win32_create_window_surface,
+ cairo_surface_create_similar,
+ NULL,
+ NULL,
+ _cairo_boilerplate_get_image_surface,
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_win32_cleanup_window_surface,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
+ },
+ {
+ "win32-window-coloralpha", "win32", NULL, NULL,
+ CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 1,
+ "cairo_win32_surface_create_with_format",
+ _cairo_boilerplate_win32_create_window_surface,
cairo_surface_create_similar,
- NULL, NULL,
+ NULL,
+ NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
- NULL, NULL, NULL, FALSE, FALSE, FALSE
+ _cairo_boilerplate_win32_cleanup_window_surface,
+ NULL,
+ NULL,
+ FALSE, FALSE, FALSE
},
};
CAIRO_BOILERPLATE (win32, targets)
commit 3d489616a2fc624dc5e94164f23a4c8536d466d0
Author: Руслан Ижбулатов <lrn1986 at gmail.com>
Date: Thu Mar 26 19:33:43 2015 +0000
win32: Add cairo API to set up a Win32 surface for an HDC with an alpha channel.
Signed-off-by: Руслан Ижбулатов <lrn1986 at gmail.com>
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/cairo-win32.h b/src/cairo-win32.h
index 3d2e1c6..db4cac6 100644
--- a/src/cairo-win32.h
+++ b/src/cairo-win32.h
@@ -49,6 +49,10 @@ cairo_public cairo_surface_t *
cairo_win32_surface_create (HDC hdc);
cairo_public cairo_surface_t *
+cairo_win32_surface_create_with_format (HDC hdc,
+ cairo_format_t format);
+
+cairo_public cairo_surface_t *
cairo_win32_printing_surface_create (HDC hdc);
cairo_public cairo_surface_t *
diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 965f2c4..1571480 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -917,31 +917,41 @@ static const cairo_surface_backend_t cairo_win32_display_surface_backend = {
*/
/**
- * cairo_win32_surface_create:
+ * cairo_win32_surface_create_with_format:
* @hdc: the DC to create a surface for
+ * @format: format of pixels in the surface to create
*
* Creates a cairo surface that targets the given DC. The DC will be
* queried for its initial clip extents, and this will be used as the
- * size of the cairo surface. The resulting surface will always be of
- * format %CAIRO_FORMAT_RGB24; should you need another surface format,
- * you will need to create one through
- * cairo_win32_surface_create_with_dib().
+ * size of the cairo surface.
*
- * Return value: the newly created surface
+ * Supported formats are:
+ * %CAIRO_FORMAT_ARGB32
+ * %CAIRO_FORMAT_RGB24
*
- * Since: 1.0
+ * Note: @format only tells cairo how to draw on the surface, not what
+ * the format of the surface is. Namely, cairo does not (and cannot)
+ * check that @hdc actually supports alpha-transparency.
+ *
+ * Return value: the newly created surface, NULL on failure
+ *
+ * Since: 1.14.3
**/
cairo_surface_t *
-cairo_win32_surface_create (HDC hdc)
+cairo_win32_surface_create_with_format (HDC hdc, cairo_format_t format)
{
cairo_win32_display_surface_t *surface;
- cairo_format_t format;
cairo_status_t status;
cairo_device_t *device;
- /* Assume that everything coming in as a HDC is RGB24 */
- format = CAIRO_FORMAT_RGB24;
+ switch (format) {
+ default:
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
+ case CAIRO_FORMAT_ARGB32:
+ case CAIRO_FORMAT_RGB24:
+ break;
+ }
surface = malloc (sizeof (*surface));
if (surface == NULL)
@@ -977,6 +987,28 @@ cairo_win32_surface_create (HDC hdc)
}
/**
+ * cairo_win32_surface_create:
+ * @hdc: the DC to create a surface for
+ *
+ * Creates a cairo surface that targets the given DC. The DC will be
+ * queried for its initial clip extents, and this will be used as the
+ * size of the cairo surface. The resulting surface will always be of
+ * format %CAIRO_FORMAT_RGB24; should you need another surface format,
+ * you will need to create one through
+ * cairo_win32_surface_create_with_format() or
+ * cairo_win32_surface_create_with_dib().
+ *
+ * Return value: the newly created surface, NULL on failure
+ *
+ * Since: 1.0
+ **/
+cairo_surface_t *
+cairo_win32_surface_create (HDC hdc)
+{
+ return cairo_win32_surface_create_with_format (hdc, CAIRO_FORMAT_RGB24);
+}
+
+/**
* cairo_win32_surface_create_with_dib:
* @format: format of pixels in the surface to create
* @width: width of the surface, in pixels
@@ -1027,12 +1059,16 @@ cairo_win32_surface_create_with_ddb (HDC hdc,
HDC screen_dc, ddb_dc;
HBITMAP saved_dc_bitmap;
- if (format != CAIRO_FORMAT_RGB24)
+ switch (format) {
+ default:
+/* XXX handle these eventually */
+ case CAIRO_FORMAT_A8:
+ case CAIRO_FORMAT_A1:
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-/* XXX handle these eventually
- format != CAIRO_FORMAT_A8 ||
- format != CAIRO_FORMAT_A1)
-*/
+ case CAIRO_FORMAT_ARGB32:
+ case CAIRO_FORMAT_RGB24:
+ break;
+ }
if (!hdc) {
screen_dc = GetDC (NULL);
commit 74c85aadb37a5e63d7414dd2a0ef819505e29fea
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Thu Mar 26 17:36:16 2015 +0100
test: Fix coverage-intersecting-triangles reference
Commit 4e3ef57bc892b0b046c486390adc7164a1de64de added
coverage-intersecting-triangles with an incorrect reference and
generator. The test checks the rasterization of two overlapping
triangles in the following position:
. .
|\ /|
| X |
|/ \|
.---.
Since the triangles have both vertical and horizontal sides of size
x/WIDTH, the expected coverage is 3/4 (75%) of (x/WIDTH)^2. The
original code, instead, was checking for a coverage of 0.75*x/WIDTH,
as if one of the sides was always 1 unit long.
The image and xlib backends still suffer from some jitter, caused by
the approximation of the actual coverage by means of sampling. For
this reason their references are still considered XFAIL, even though
their result now looks mostly consistent with the expected reference.
diff --git a/test/coverage.c b/test/coverage.c
index 12225c3..86216df 100644
--- a/test/coverage.c
+++ b/test/coverage.c
@@ -203,7 +203,7 @@ intersecting_triangles (cairo_t *cr, int width, int height)
#if GENERATE_REFERENCE
for (x = 0; x < WIDTH; x++) {
- cairo_set_source_rgba (cr, 1, 1, 1, x * 0.75 / WIDTH);
+ cairo_set_source_rgba (cr, 1, 1, 1, x * x * 0.75 / (WIDTH * WIDTH));
cairo_rectangle (cr, x, 0, 1, HEIGHT);
cairo_fill (cr);
}
diff --git a/test/reference/coverage-intersecting-triangles.image.xfail.png b/test/reference/coverage-intersecting-triangles.image.xfail.png
new file mode 100644
index 0000000..c0290e4
Binary files /dev/null and b/test/reference/coverage-intersecting-triangles.image.xfail.png differ
diff --git a/test/reference/coverage-intersecting-triangles.ref.png b/test/reference/coverage-intersecting-triangles.ref.png
index 40a48c1..adf93db 100644
Binary files a/test/reference/coverage-intersecting-triangles.ref.png and b/test/reference/coverage-intersecting-triangles.ref.png differ
diff --git a/test/reference/coverage-intersecting-triangles.xfail.png b/test/reference/coverage-intersecting-triangles.xfail.png
deleted file mode 100644
index c0290e4..0000000
Binary files a/test/reference/coverage-intersecting-triangles.xfail.png and /dev/null differ
commit 7ab94215f891df2ef5d8ce95e7591de0bdce2add
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Sat Apr 4 15:49:18 2015 -0700
Fix spellings descibed, indicies, stange
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index fd52b0d..4bc2947 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -136,7 +136,7 @@
* %CAIRO_MIME_TYPE_JBIG2, %CAIRO_MIME_TYPE_JBIG2_GLOBAL,
* %CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID.
*
- * JBIG2 data in PDF must be in the embedded format as descibed in
+ * JBIG2 data in PDF must be in the embedded format as described in
* ISO/IEC 11544. Image specific JBIG2 data must be in
* %CAIRO_MIME_TYPE_JBIG2. Any global segments in the JBIG2 data
* (segments with page association field set to 0) must be in
diff --git a/src/drm/cairo-drm-intel-debug.c b/src/drm/cairo-drm-intel-debug.c
index 7068c93..bfe5136 100644
--- a/src/drm/cairo-drm-intel-debug.c
+++ b/src/drm/cairo-drm-intel-debug.c
@@ -445,7 +445,7 @@ debug_variable_length_prim (struct debug_stream *stream)
len = 1+(i+2)/2;
fprintf (stderr, "%04x: ", stream->offset);
- fprintf (stderr, "3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len);
+ fprintf (stderr, "3DPRIM, %s variable length %d indices (%d dwords):\n", prim, i, len);
for (i = 0; i < len; i++)
fprintf (stderr, "\t0x%08x\n", ptr[i]);
fprintf (stderr, "\n");
diff --git a/test/zero-alpha.c b/test/zero-alpha.c
index 0105cc8..01da92c 100644
--- a/test/zero-alpha.c
+++ b/test/zero-alpha.c
@@ -30,7 +30,7 @@
/* History:
*
- * 2006-06-13 Paul Giblock reports a "Stange alpha channel problem" on
+ * 2006-06-13 Paul Giblock reports a "Strange alpha channel problem" on
* the cairo mailing list.
*
* 2006-06-13 Carl Worth writes this test in an attempt to reproduce
commit 4a7182f647d2c5f67668f2ba08bfc814c9923a76
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Wed Mar 18 18:46:35 2015 -0700
NEWS: Sp. fix
diff --git a/NEWS b/NEWS
index 93b650e..6511af0 100644
--- a/NEWS
+++ b/NEWS
@@ -520,7 +520,7 @@ Release 1.12.4 (2012-10-05 Chris Wilson <chris at chris-wilson.co.uk>)
===================================================================
More bugs, and more importantly, more fixes. On the cairo-gl side, we
have refinements to the MSAA compositor which enables hardware
-acceleration of comparitively low-quality antialiasing - which is useful
+acceleration of comparatively low-quality antialiasing - which is useful
in animations and on very high density screens. For cairo-xlib, we have
finally enabled SHM transport for image transfers to and from the X
server. A long standing required feature, SHM transport offers a notable
@@ -1457,7 +1457,7 @@ Optimisations:
image in the final output. This is unlike previous versions of cairo
which would generate very large PDF files with multiple copies of
the same image. Adrian says that the PDF is not quite working as
- well as it should yet, so we hope for futher improvements before
+ well as it should yet, so we hope for further improvements before
cairo 1.10.
Bug fixes:
@@ -2209,7 +2209,7 @@ cairo_font_options_set_lcd_filter
cairo_font_options_get_lcd_filter
These add the possibility to choose between various available LCD subpixel
- filters. The available filter values are modeled after what FreeType
+ filters. The available filter values are modelled after what FreeType
provides.
@@ -5834,7 +5834,7 @@ General bug fixes
(Richard Stellingwerff, Owen Taylor)
* 4231
- * 4298 - Accomodate gentoo and Mandriva versions in X server vendor string check
+ * 4298 - Accommodate gentoo and Mandriva versions in X server vendor string check
(Billy Biggs, Frederic Crozat, Owen Taylor)
win32-specific fixes
commit 45cbf45b74b84ca71c0f610146f898068f49408b
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Wed Mar 18 15:49:41 2015 -0700
surface: Clarify flush documentation
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 89345f5..bfe3fa1 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1554,12 +1554,12 @@ _cairo_surface_flush (cairo_surface_t *surface, unsigned flags)
* cairo_surface_flush:
* @surface: a #cairo_surface_t
*
- * Do any pending drawing for the surface and also restore any
- * temporary modifications cairo has made to the surface's
- * state. This function must be called before switching from
- * drawing on the surface with cairo to drawing on it directly
- * with native APIs. If the surface doesn't support direct access,
- * then this function does nothing.
+ * Do any pending drawing for the surface and also restore any temporary
+ * modifications cairo has made to the surface's state. This function
+ * must be called before switching from drawing on the surface with
+ * cairo to drawing on it directly with native APIs, or accessing its
+ * memory outside of Cairo. If the surface doesn't support direct
+ * access, then this function does nothing.
*
* Since: 1.0
**/
commit 70ad79a1f8a4ef3800798eaf3ed5ee31cb0c0199
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Thu Mar 12 17:02:02 2015 +0100
Harden make-cairo-test-constructors.sh
The make-cairo-test-constructors.sh script executes several commands
without checking their success. This can lead to undetected errors,
like those fixed in 86fad78fcd2bf987249890aea4eabcce02a58f45.
The script now exits with an error status if no file is
input. Moreover, it sets the '-e' flag, so that if a command fails,
the whole script is immediately terminated with an error.
In the Makefile.am, the script result is now checked and the target
file is removed upon error. This ensures that the
'cairo-test-constructors.c' target completes succesfully only if no
error occurred.
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index 950629b..b2fcd27 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -81,7 +81,7 @@ noinst_SCRIPTS = check-refs.sh
TESTS += cairo-test-suite$(EXEEXT)
cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors.sh
- (cd $(srcdir) && sh ./make-cairo-test-constructors.sh $(test_sources)) > $@
+ (cd $(srcdir) && sh ./make-cairo-test-constructors.sh $(test_sources)) > $@ || (rm $@ ; exit 1)
cairo_test_suite_SOURCES = \
$(cairo_test_suite_sources) \
diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
index cb1391e..a03d61c 100644
--- a/test/make-cairo-test-constructors.sh
+++ b/test/make-cairo-test-constructors.sh
@@ -1,8 +1,10 @@
#! /bin/sh
+set -e
+
if test $# -eq 0; then
echo "$0: no input files." >&2
- exit 0
+ exit 1
fi
cat <<HERE
commit 79042143fe12cf6e208f525a969982e7d637907f
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Fri Mar 13 13:17:28 2015 -0700
Start 1.14.3 development
diff --git a/cairo-version.h b/cairo-version.h
index 516999e..31168dd 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
#define CAIRO_VERSION_MAJOR 1
#define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 2
+#define CAIRO_VERSION_MICRO 3
#endif
commit c4b67b56f4314fee2c892db3099998905d46110e
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Wed Mar 11 19:16:38 2015 +1030
doc: add index of new symbols in 1.14
diff --git a/doc/public/cairo-docs.xml b/doc/public/cairo-docs.xml
index baf844c..d54e63b 100644
--- a/doc/public/cairo-docs.xml
+++ b/doc/public/cairo-docs.xml
@@ -76,5 +76,8 @@
<index id="index-1.12" role="1.12">
<title>Index of new symbols in 1.12</title>
</index>
+ <index id="index-1.14" role="1.14">
+ <title>Index of new symbols in 1.14</title>
+ </index>
<xi:include href="language-bindings.xml"/>
</book>
commit 2a8d50a0dd8331570537a40e63864dd18471f92d
Author: Bryce Harrington <bryce at osg.samsung.com>
Date: Tue Mar 10 19:55:35 2015 -0700
RELEASING: Update contacts
Add a CC to the cairo@ list itself.
Drop updating of the GNOME dependencies page; this appears to have not
been updated since 2008.
diff --git a/RELEASING b/RELEASING
index f6f5eeb..641ac1f 100644
--- a/RELEASING
+++ b/RELEASING
@@ -113,7 +113,7 @@ Here are the steps to follow to create a new cairo release:
8) Push the newly created tag out to the central tree with a command
something like:
- git push upstream master X.Y.Z
+ git push origin master X.Y.Z
9) Edit the cairo bugzilla product and add the new version numbers. Note
that you need to add two versions. One for the release/snapshot (with
@@ -121,12 +121,13 @@ Here are the steps to follow to create a new cairo release:
odd micro version).
10) Send a message to cairo-announce at cairographics.org and CC
- gnome-announce-list at gnome.org and ftp-release at lists.freedesktop.org
- (pr at lwn.net as well for major releases) to announce the new release
- using the text provided from "make release-publish", adding the excerpt
- from NEWS, your signature, followed by the standard "What is cairo" and
- "Where to get more information about cairo" blurbs from README, and
- finally the shortlog of all changes since last release, generated by:
+ cairo at cairographics.org, gnome-announce-list at gnome.org and
+ ftp-release at lists.freedesktop.org (pr at lwn.net as well for major
+ releases) to announce the new release using the text provided from
+ "make release-publish", adding the excerpt from NEWS, your
+ signature, followed by the standard "What is cairo" and "Where to
+ get more information about cairo" blurbs from README, and finally
+ the shortlog of all changes since last release, generated by:
git shortlog X.Y.Z...
@@ -135,8 +136,3 @@ Here are the steps to follow to create a new cairo release:
11) Edit the cairo wiki to add the announcement to the NEWS page and
the front page. (just the parts before your signature).
-12) For minor releases (no X.Y change), notify desktop-devel-list at gnome.org
- or update the ExternalDependencies page for the current cycle if you
- know where it is. Currently it's:
-
- http://live.gnome.org/TwoPointNineteen/ExternalDependencies
More information about the cairo-commit
mailing list