2004-08-02 13:13:28 +00:00
|
|
|
/* cairo - a vector graphics library with display and print output
|
|
|
|
|
*
|
2004-10-21 18:40:50 +00:00
|
|
|
* Copyright © 2002 University of Southern California
|
2005-04-14 14:42:26 +00:00
|
|
|
* Copyright © 2005 Red Hat, Inc.
|
2003-07-18 11:34:19 +00:00
|
|
|
*
|
2004-08-02 13:13:28 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
2004-09-04 06:38:34 +00:00
|
|
|
* 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
|
2010-04-27 10:17:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
|
2004-09-04 06:38:34 +00:00
|
|
|
* 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 University of Southern
|
|
|
|
|
* California.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s):
|
2005-02-22 11:35:03 +00:00
|
|
|
* Carl D. Worth <cworth@cworth.org>
|
2003-07-18 11:34:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
2005-07-22 02:04:59 +00:00
|
|
|
* These definitions are solely for use by the implementation of cairo
|
2003-07-18 11:34:19 +00:00
|
|
|
* and constitute no kind of standard. If you need any of these
|
|
|
|
|
* functions, please drop me a note. Either the library needs new
|
|
|
|
|
* functionality, or there's a way to do what you need using the
|
2005-02-22 11:35:03 +00:00
|
|
|
* existing published interfaces. cworth@cworth.org
|
2003-07-18 11:34:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _CAIROINT_H_
|
|
|
|
|
#define _CAIROINT_H_
|
|
|
|
|
|
2004-05-28 12:37:15 +00:00
|
|
|
#if HAVE_CONFIG_H
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-09-20 17:52:19 -04:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
#define cairo_public __declspec(dllexport)
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-11-23 12:53:46 +00:00
|
|
|
#include <assert.h>
|
2003-09-30 18:56:22 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
2005-05-13 14:04:22 +00:00
|
|
|
#include <stdarg.h>
|
2007-04-03 20:25:30 -04:00
|
|
|
#include <stddef.h>
|
2005-04-07 12:56:43 +00:00
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
#define _USE_MATH_DEFINES
|
|
|
|
|
#endif
|
2003-07-18 11:34:19 +00:00
|
|
|
#include <math.h>
|
2004-04-20 12:35:44 +00:00
|
|
|
#include <limits.h>
|
2005-03-16 12:08:41 +00:00
|
|
|
#include <stdio.h>
|
2003-07-18 11:34:19 +00:00
|
|
|
|
|
|
|
|
#include "cairo.h"
|
2007-08-06 19:24:31 -04:00
|
|
|
#include <pixman.h>
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2007-09-23 21:00:23 +01:00
|
|
|
#include "cairo-compiler-private.h"
|
2010-04-24 00:50:33 +01:00
|
|
|
#include "cairo-error-private.h"
|
2007-09-23 21:00:23 +01:00
|
|
|
|
2012-03-29 14:48:24 +01:00
|
|
|
#if CAIRO_HAS_PDF_SURFACE || \
|
|
|
|
|
CAIRO_HAS_PS_SURFACE || \
|
|
|
|
|
CAIRO_HAS_SCRIPT_SURFACE || \
|
|
|
|
|
CAIRO_HAS_XML_SURFACE
|
2011-06-14 10:45:18 +02:00
|
|
|
#define CAIRO_HAS_DEFLATE_STREAM 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-10-12 12:11:12 +01:00
|
|
|
#if CAIRO_HAS_PS_SURFACE || \
|
|
|
|
|
CAIRO_HAS_PDF_SURFACE || \
|
|
|
|
|
CAIRO_HAS_SVG_SURFACE || \
|
|
|
|
|
CAIRO_HAS_WIN32_SURFACE
|
2008-09-02 20:20:49 -04:00
|
|
|
#define CAIRO_HAS_FONT_SUBSET 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-03-29 14:48:24 +01:00
|
|
|
#if CAIRO_HAS_PS_SURFACE || \
|
|
|
|
|
CAIRO_HAS_PDF_SURFACE || \
|
|
|
|
|
CAIRO_HAS_FONT_SUBSET
|
2008-09-02 20:20:49 -04:00
|
|
|
#define CAIRO_HAS_PDF_OPERATORS 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-12-18 16:37:14 +00:00
|
|
|
CAIRO_BEGIN_DECLS
|
|
|
|
|
|
2009-05-07 14:16:05 +01:00
|
|
|
#if _WIN32 && !_WIN32_WCE /* Permissions on WinCE? No worries! */
|
2007-12-29 00:15:03 +10:30
|
|
|
cairo_private FILE *
|
|
|
|
|
_cairo_win32_tmpfile (void);
|
|
|
|
|
#define tmpfile() _cairo_win32_tmpfile()
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-08-27 18:46:34 +00:00
|
|
|
#undef MIN
|
2005-01-28 12:27:23 +00:00
|
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
2005-08-27 18:46:34 +00:00
|
|
|
|
|
|
|
|
#undef MAX
|
2005-01-28 12:27:23 +00:00
|
|
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
|
2017-10-11 19:13:46 -07:00
|
|
|
#if _XOPEN_SOURCE >= 600 || defined (_ISOC99_SOURCE)
|
|
|
|
|
#define ISFINITE(x) isfinite (x)
|
|
|
|
|
#else
|
|
|
|
|
#define ISFINITE(x) ((x) * (x) >= 0.) /* check for NaNs */
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-02-01 15:06:33 +00:00
|
|
|
#ifndef FALSE
|
|
|
|
|
#define FALSE 0
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
|
#define TRUE 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-02-14 11:55:00 -08:00
|
|
|
#ifndef M_PI
|
|
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-01-22 01:03:02 -05:00
|
|
|
#ifndef M_SQRT2
|
|
|
|
|
#define M_SQRT2 1.41421356237309504880
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-02-06 13:01:52 -08:00
|
|
|
#ifndef M_SQRT1_2
|
|
|
|
|
#define M_SQRT1_2 0.707106781186547524400844362104849039
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-04-09 17:42:04 -07:00
|
|
|
#undef ARRAY_LENGTH
|
|
|
|
|
#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
|
2007-03-20 18:59:19 -04:00
|
|
|
|
2009-03-17 19:22:31 -04:00
|
|
|
#undef STRINGIFY
|
|
|
|
|
#undef STRINGIFY_ARG
|
|
|
|
|
#define STRINGIFY(macro_or_string) STRINGIFY_ARG (macro_or_string)
|
|
|
|
|
#define STRINGIFY_ARG(contents) #contents
|
2008-02-11 16:17:34 +00:00
|
|
|
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
#if defined (__GNUC__)
|
2008-09-02 10:08:04 +01:00
|
|
|
#define cairo_container_of(ptr, type, member) ({ \
|
2009-05-07 14:58:45 +01:00
|
|
|
const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \
|
2008-09-02 10:08:04 +01:00
|
|
|
(type *) ((char *) mptr__ - offsetof (type, member)); \
|
|
|
|
|
})
|
|
|
|
|
#else
|
|
|
|
|
#define cairo_container_of(ptr, type, member) \
|
2010-05-10 15:06:25 -04:00
|
|
|
((type *)((char *) (ptr) - (char *) &((type *)0)->member))
|
2008-09-02 10:08:04 +01:00
|
|
|
#endif
|
|
|
|
|
|
2008-02-11 16:17:34 +00:00
|
|
|
|
2005-03-23 13:52:11 +00:00
|
|
|
#define ASSERT_NOT_REACHED \
|
|
|
|
|
do { \
|
2010-04-21 11:59:33 +01:00
|
|
|
assert (!"reached"); \
|
2005-03-23 13:52:11 +00:00
|
|
|
} while (0)
|
2008-05-28 13:09:52 -04:00
|
|
|
#define COMPILE_TIME_ASSERT1(condition, line) \
|
2009-05-07 14:34:47 +01:00
|
|
|
typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1]
|
2008-05-28 13:09:52 -04:00
|
|
|
#define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line)
|
|
|
|
|
#define COMPILE_TIME_ASSERT(condition) COMPILE_TIME_ASSERT0(condition, __LINE__)
|
2005-03-23 13:52:11 +00:00
|
|
|
|
2010-06-01 19:39:02 +02:00
|
|
|
#define CAIRO_ALPHA_IS_CLEAR(alpha) ((alpha) <= ((double)0x00ff / (double)0xffff))
|
|
|
|
|
#define CAIRO_ALPHA_SHORT_IS_CLEAR(alpha) ((alpha) <= 0x00ff)
|
|
|
|
|
|
2005-06-20 11:09:51 +00:00
|
|
|
#define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
|
2007-04-19 09:22:08 +01:00
|
|
|
#define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00)
|
2005-08-21 21:04:52 +00:00
|
|
|
#define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0)
|
2005-06-20 11:09:51 +00:00
|
|
|
|
2010-06-01 19:39:02 +02:00
|
|
|
#define CAIRO_COLOR_IS_CLEAR(color) CAIRO_ALPHA_SHORT_IS_CLEAR ((color)->alpha_short)
|
2007-04-19 09:22:08 +01:00
|
|
|
#define CAIRO_COLOR_IS_OPAQUE(color) CAIRO_ALPHA_SHORT_IS_OPAQUE ((color)->alpha_short)
|
|
|
|
|
|
2006-06-20 10:59:22 -07:00
|
|
|
/* Reverse the bits in a byte with 7 operations (no 64-bit):
|
|
|
|
|
* Devised by Sean Anderson, July 13, 2001.
|
|
|
|
|
* Source: http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith32Bits
|
|
|
|
|
*/
|
|
|
|
|
#define CAIRO_BITSWAP8(c) ((((c) * 0x0802LU & 0x22110LU) | ((c) * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16)
|
|
|
|
|
|
2008-03-25 16:32:24 -07:00
|
|
|
/* Return the number of 1 bits in mask.
|
|
|
|
|
*
|
|
|
|
|
* GCC 3.4 supports a "population count" builtin, which on many targets is
|
|
|
|
|
* implemented with a single instruction. There is a fallback definition
|
|
|
|
|
* in libgcc in case a target does not have one, which should be just as
|
|
|
|
|
* good as the open-coded solution below, (which is "HACKMEM 169").
|
|
|
|
|
*/
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline int cairo_const
|
2008-03-25 16:32:24 -07:00
|
|
|
_cairo_popcount (uint32_t mask)
|
|
|
|
|
{
|
|
|
|
|
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
|
|
|
|
return __builtin_popcount (mask);
|
|
|
|
|
#else
|
|
|
|
|
register int y;
|
|
|
|
|
|
|
|
|
|
y = (mask >> 1) &033333333333;
|
|
|
|
|
y = mask - y - ((y >>1) & 033333333333);
|
|
|
|
|
return (((y + (y >> 3)) & 030707070707) % 077);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-08 12:05:48 +02:00
|
|
|
static cairo_always_inline cairo_bool_t
|
|
|
|
|
_cairo_is_little_endian (void)
|
|
|
|
|
{
|
|
|
|
|
static const int i = 1;
|
|
|
|
|
return *((char *) &i) == 0x01;
|
|
|
|
|
}
|
|
|
|
|
|
2006-06-20 10:59:22 -07:00
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
|
|
|
#define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) (c)
|
|
|
|
|
#else
|
|
|
|
|
#define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) CAIRO_BITSWAP8(c)
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-03-07 15:53:27 -05:00
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
|
|
|
|
|
|
|
|
#define cpu_to_be16(v) (v)
|
|
|
|
|
#define be16_to_cpu(v) (v)
|
|
|
|
|
#define cpu_to_be32(v) (v)
|
|
|
|
|
#define be32_to_cpu(v) (v)
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline uint16_t cairo_const
|
2007-03-07 15:53:27 -05:00
|
|
|
cpu_to_be16(uint16_t v)
|
|
|
|
|
{
|
|
|
|
|
return (v << 8) | (v >> 8);
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline uint16_t cairo_const
|
2007-03-07 15:53:27 -05:00
|
|
|
be16_to_cpu(uint16_t v)
|
|
|
|
|
{
|
|
|
|
|
return cpu_to_be16 (v);
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline uint32_t cairo_const
|
2007-03-07 15:53:27 -05:00
|
|
|
cpu_to_be32(uint32_t v)
|
|
|
|
|
{
|
2014-10-31 22:43:32 +10:30
|
|
|
return (v >> 24) | ((v >> 8) & 0xff00) | ((v << 8) & 0xff0000) | (v << 24);
|
2007-03-07 15:53:27 -05:00
|
|
|
}
|
|
|
|
|
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline uint32_t cairo_const
|
2007-03-07 15:53:27 -05:00
|
|
|
be32_to_cpu(uint32_t v)
|
|
|
|
|
{
|
|
|
|
|
return cpu_to_be32 (v);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-10-19 11:34:34 +10:30
|
|
|
/* Unaligned big endian access
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static inline uint16_t get_unaligned_be16 (const unsigned char *p)
|
|
|
|
|
{
|
|
|
|
|
return p[0] << 8 | p[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline uint32_t get_unaligned_be32 (const unsigned char *p)
|
|
|
|
|
{
|
|
|
|
|
return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void put_unaligned_be16 (uint16_t v, unsigned char *p)
|
|
|
|
|
{
|
|
|
|
|
p[0] = (v >> 8) & 0xff;
|
|
|
|
|
p[1] = v & 0xff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void put_unaligned_be32 (uint32_t v, unsigned char *p)
|
|
|
|
|
{
|
|
|
|
|
p[0] = (v >> 24) & 0xff;
|
|
|
|
|
p[1] = (v >> 16) & 0xff;
|
|
|
|
|
p[2] = (v >> 8) & 0xff;
|
|
|
|
|
p[3] = v & 0xff;
|
|
|
|
|
}
|
2009-09-28 19:14:46 +09:30
|
|
|
|
|
|
|
|
/* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static inline int cairo_const
|
|
|
|
|
_cairo_isspace (int c)
|
|
|
|
|
{
|
|
|
|
|
return (c == 0x20 || (c >= 0x09 && c <= 0x0d));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int cairo_const
|
|
|
|
|
_cairo_isdigit (int c)
|
|
|
|
|
{
|
|
|
|
|
return (c >= '0' && c <= '9');
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-01 22:05:42 +09:30
|
|
|
static inline int cairo_const
|
|
|
|
|
_cairo_isalpha (int c)
|
|
|
|
|
{
|
|
|
|
|
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-20 02:25:55 -04:00
|
|
|
#include "cairo-types-private.h"
|
2005-08-31 15:08:02 +00:00
|
|
|
#include "cairo-cache-private.h"
|
2007-09-23 21:08:09 +01:00
|
|
|
#include "cairo-reference-count-private.h"
|
2008-10-24 17:37:30 +03:00
|
|
|
#include "cairo-spans-private.h"
|
2011-08-04 00:19:42 +01:00
|
|
|
#include "cairo-surface-private.h"
|
2005-08-05 22:29:06 +00:00
|
|
|
|
2005-08-04 22:45:59 +00:00
|
|
|
cairo_private void
|
2008-05-09 13:10:44 +02:00
|
|
|
_cairo_box_from_doubles (cairo_box_t *box,
|
|
|
|
|
double *x1, double *y1,
|
|
|
|
|
double *x2, double *y2);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_box_to_doubles (const cairo_box_t *box,
|
|
|
|
|
double *x1, double *y1,
|
|
|
|
|
double *x2, double *y2);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_box_from_rectangle (cairo_box_t *box,
|
|
|
|
|
const cairo_rectangle_int_t *rectangle);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_box_round_to_rectangle (const cairo_box_t *box,
|
|
|
|
|
cairo_rectangle_int_t *rectangle);
|
2005-08-04 22:45:59 +00:00
|
|
|
|
2010-10-22 13:43:01 +02:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_box_add_curve_to (cairo_box_t *extents,
|
|
|
|
|
const cairo_point_t *a,
|
|
|
|
|
const cairo_point_t *b,
|
|
|
|
|
const cairo_point_t *c,
|
|
|
|
|
const cairo_point_t *d);
|
|
|
|
|
|
2009-08-28 10:05:52 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_boxes_get_extents (const cairo_box_t *boxes,
|
|
|
|
|
int num_boxes,
|
|
|
|
|
cairo_box_t *extents);
|
|
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private extern const cairo_rectangle_int_t _cairo_empty_rectangle;
|
|
|
|
|
cairo_private extern const cairo_rectangle_int_t _cairo_unbounded_rectangle;
|
|
|
|
|
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
static inline void
|
|
|
|
|
_cairo_unbounded_rectangle_init (cairo_rectangle_int_t *rect)
|
|
|
|
|
{
|
2011-07-30 17:28:21 +01:00
|
|
|
*rect = _cairo_unbounded_rectangle;
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
}
|
|
|
|
|
|
2011-03-18 16:57:04 +01:00
|
|
|
cairo_private_no_warn cairo_bool_t
|
2008-10-23 13:37:41 +01:00
|
|
|
_cairo_rectangle_intersect (cairo_rectangle_int_t *dst,
|
|
|
|
|
const cairo_rectangle_int_t *src);
|
2005-08-04 22:45:59 +00:00
|
|
|
|
2011-07-26 08:33:09 +01:00
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_rectangle_intersects (const cairo_rectangle_int_t *dst,
|
|
|
|
|
const cairo_rectangle_int_t *src)
|
|
|
|
|
{
|
2011-07-26 12:00:53 +01:00
|
|
|
return !(src->x >= dst->x + (int) dst->width ||
|
|
|
|
|
src->x + (int) src->width <= dst->x ||
|
|
|
|
|
src->y >= dst->y + (int) dst->height ||
|
|
|
|
|
src->y + (int) src->height <= dst->y);
|
2011-07-26 08:33:09 +01:00
|
|
|
}
|
|
|
|
|
|
2012-01-07 16:19:43 +01:00
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_rectangle_contains_rectangle (const cairo_rectangle_int_t *a,
|
|
|
|
|
const cairo_rectangle_int_t *b)
|
|
|
|
|
{
|
|
|
|
|
return (a->x <= b->x &&
|
|
|
|
|
a->x + (int) a->width >= b->x + (int) b->width &&
|
|
|
|
|
a->y <= b->y &&
|
|
|
|
|
a->y + (int) a->height >= b->y + (int) b->height);
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-22 00:36:03 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_rectangle_int_from_double (cairo_rectangle_int_t *recti,
|
|
|
|
|
const cairo_rectangle_t *rectf);
|
|
|
|
|
|
2010-10-12 22:35:36 +02:00
|
|
|
/* Extends the dst rectangle to also contain src.
|
|
|
|
|
* If one of the rectangles is empty, the result is undefined
|
|
|
|
|
*/
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_rectangle_union (cairo_rectangle_int_t *dst,
|
|
|
|
|
const cairo_rectangle_int_t *src);
|
|
|
|
|
|
2008-02-04 03:55:55 -08:00
|
|
|
cairo_private cairo_bool_t
|
2012-08-24 17:22:34 +01:00
|
|
|
_cairo_box_intersects_line_segment (const cairo_box_t *box,
|
2009-05-27 15:59:16 +01:00
|
|
|
cairo_line_t *line) cairo_pure;
|
2008-02-04 03:55:55 -08:00
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_spline_intersects (const cairo_point_t *a,
|
|
|
|
|
const cairo_point_t *b,
|
|
|
|
|
const cairo_point_t *c,
|
|
|
|
|
const cairo_point_t *d,
|
|
|
|
|
const cairo_box_t *box) cairo_pure;
|
2006-09-07 17:33:35 -07:00
|
|
|
|
2009-05-25 23:25:38 +01:00
|
|
|
typedef struct {
|
|
|
|
|
const cairo_user_data_key_t *key;
|
|
|
|
|
void *user_data;
|
|
|
|
|
cairo_destroy_func_t destroy;
|
|
|
|
|
} cairo_user_data_slot_t;
|
|
|
|
|
|
2005-04-08 13:14:17 +00:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_user_data_array_init (cairo_user_data_array_t *array);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
2005-06-03 16:16:44 +00:00
|
|
|
_cairo_user_data_array_fini (cairo_user_data_array_t *array);
|
2005-04-08 13:14:17 +00:00
|
|
|
|
|
|
|
|
cairo_private void *
|
|
|
|
|
_cairo_user_data_array_get_data (cairo_user_data_array_t *array,
|
|
|
|
|
const cairo_user_data_key_t *key);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_user_data_array_set_data (cairo_user_data_array_t *array,
|
|
|
|
|
const cairo_user_data_key_t *key,
|
|
|
|
|
void *user_data,
|
|
|
|
|
cairo_destroy_func_t destroy);
|
|
|
|
|
|
2009-02-13 12:56:46 +00:00
|
|
|
cairo_private cairo_status_t
|
2010-11-24 12:08:03 +01:00
|
|
|
_cairo_user_data_array_copy (cairo_user_data_array_t *dst,
|
|
|
|
|
const cairo_user_data_array_t *src);
|
2009-02-13 12:56:46 +00:00
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_user_data_array_foreach (cairo_user_data_array_t *array,
|
2009-02-18 18:43:29 -05:00
|
|
|
void (*func) (const void *key,
|
2009-02-13 12:56:46 +00:00
|
|
|
void *elt,
|
|
|
|
|
void *closure),
|
|
|
|
|
void *closure);
|
|
|
|
|
|
2008-11-04 10:45:34 +00:00
|
|
|
#define _CAIRO_HASH_INIT_VALUE 5381
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private unsigned long
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
_cairo_hash_string (const char *c);
|
|
|
|
|
|
2008-11-04 10:45:34 +00:00
|
|
|
cairo_private unsigned long
|
|
|
|
|
_cairo_hash_bytes (unsigned long hash,
|
|
|
|
|
const void *bytes,
|
|
|
|
|
unsigned int length);
|
|
|
|
|
|
2009-03-16 19:31:38 +00:00
|
|
|
#define _cairo_scaled_glyph_index(g) ((g)->hash_entry.hash)
|
|
|
|
|
#define _cairo_scaled_glyph_set_index(g, i) ((g)->hash_entry.hash = (i))
|
2005-08-31 15:08:02 +00:00
|
|
|
|
2007-04-21 03:24:31 -04:00
|
|
|
#include "cairo-scaled-font-private.h"
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
|
2005-04-07 11:03:59 +00:00
|
|
|
struct _cairo_font_face {
|
2006-02-24 15:32:26 -08:00
|
|
|
/* hash_entry must be first */
|
2005-08-11 14:59:27 +00:00
|
|
|
cairo_hash_entry_t hash_entry;
|
2005-07-28 09:29:46 +00:00
|
|
|
cairo_status_t status;
|
2007-09-23 21:08:09 +01:00
|
|
|
cairo_reference_count_t ref_count;
|
2005-04-08 13:14:17 +00:00
|
|
|
cairo_user_data_array_t user_data;
|
2005-04-07 11:03:59 +00:00
|
|
|
const cairo_font_face_backend_t *backend;
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
};
|
|
|
|
|
|
2010-06-12 10:41:09 +01:00
|
|
|
cairo_private void
|
2010-04-23 19:45:26 +01:00
|
|
|
_cairo_default_context_reset_static_data (void);
|
2010-06-12 10:41:09 +01:00
|
|
|
|
2005-08-01 13:33:47 +00:00
|
|
|
cairo_private void
|
2008-12-20 01:18:12 -05:00
|
|
|
_cairo_toy_font_face_reset_static_data (void);
|
2005-08-01 13:33:47 +00:00
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_ft_font_reset_static_data (void);
|
|
|
|
|
|
2010-11-16 23:48:39 +10:30
|
|
|
cairo_private void
|
|
|
|
|
_cairo_win32_font_reset_static_data (void);
|
|
|
|
|
|
2011-07-21 12:15:05 +01:00
|
|
|
#if CAIRO_HAS_COGL_SURFACE
|
|
|
|
|
void
|
|
|
|
|
_cairo_cogl_context_reset_static_data (void);
|
|
|
|
|
#endif
|
|
|
|
|
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
/* the font backend interface */
|
2003-09-30 18:56:22 +00:00
|
|
|
|
2005-04-07 11:03:59 +00:00
|
|
|
struct _cairo_unscaled_font_backend {
|
2013-09-17 16:28:19 +01:00
|
|
|
cairo_bool_t (*destroy) (void *unscaled_font);
|
2005-04-07 11:03:59 +00:00
|
|
|
};
|
|
|
|
|
|
2008-01-28 22:10:20 -05:00
|
|
|
/* #cairo_toy_font_face_t - simple family/slant/weight font faces used for
|
2005-08-05 16:44:20 +00:00
|
|
|
* the built-in font API
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
typedef struct _cairo_toy_font_face {
|
|
|
|
|
cairo_font_face_t base;
|
2005-08-11 14:59:27 +00:00
|
|
|
const char *family;
|
|
|
|
|
cairo_bool_t owns_family;
|
2005-08-05 16:44:20 +00:00
|
|
|
cairo_font_slant_t slant;
|
|
|
|
|
cairo_font_weight_t weight;
|
2008-12-17 06:25:50 -05:00
|
|
|
|
|
|
|
|
cairo_font_face_t *impl_face; /* The non-toy font face this actually uses */
|
2005-08-05 16:44:20 +00:00
|
|
|
} cairo_toy_font_face_t;
|
|
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
typedef enum _cairo_scaled_glyph_info {
|
2008-05-09 15:56:35 +02:00
|
|
|
CAIRO_SCALED_GLYPH_INFO_METRICS = (1 << 0),
|
|
|
|
|
CAIRO_SCALED_GLYPH_INFO_SURFACE = (1 << 1),
|
|
|
|
|
CAIRO_SCALED_GLYPH_INFO_PATH = (1 << 2),
|
2016-04-07 20:38:09 -04:00
|
|
|
CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE = (1 << 3),
|
|
|
|
|
CAIRO_SCALED_GLYPH_INFO_COLOR_SURFACE = (1 << 4)
|
2005-08-31 15:08:02 +00:00
|
|
|
} cairo_scaled_glyph_info_t;
|
|
|
|
|
|
2007-02-07 22:35:59 +10:30
|
|
|
typedef struct _cairo_scaled_font_subset {
|
|
|
|
|
cairo_scaled_font_t *scaled_font;
|
|
|
|
|
unsigned int font_id;
|
|
|
|
|
unsigned int subset_id;
|
|
|
|
|
|
|
|
|
|
/* Index of glyphs array is subset_glyph_index.
|
|
|
|
|
* Value of glyphs array is scaled_font_glyph_index.
|
|
|
|
|
*/
|
|
|
|
|
unsigned long *glyphs;
|
2008-06-29 19:33:58 +09:30
|
|
|
char **utf8;
|
2007-10-14 00:04:21 +09:30
|
|
|
char **glyph_names;
|
2010-10-04 23:11:56 +10:30
|
|
|
int *to_latin_char;
|
2010-10-01 17:55:53 +09:30
|
|
|
unsigned long *latin_to_subset_glyph_index;
|
2007-02-07 22:35:59 +10:30
|
|
|
unsigned int num_glyphs;
|
2007-04-20 22:45:12 +09:30
|
|
|
cairo_bool_t is_composite;
|
2009-07-28 20:54:58 +09:30
|
|
|
cairo_bool_t is_scaled;
|
2010-10-01 17:55:53 +09:30
|
|
|
cairo_bool_t is_latin;
|
2007-02-07 22:35:59 +10:30
|
|
|
} cairo_scaled_font_subset_t;
|
|
|
|
|
|
2005-04-07 11:03:59 +00:00
|
|
|
struct _cairo_scaled_font_backend {
|
2006-02-27 17:22:45 -08:00
|
|
|
cairo_font_type_t type;
|
|
|
|
|
|
2005-08-05 20:30:43 +00:00
|
|
|
void
|
|
|
|
|
(*fini) (void *scaled_font);
|
|
|
|
|
|
2007-04-08 22:59:10 +01:00
|
|
|
cairo_warn cairo_int_status_t
|
2005-08-31 15:08:02 +00:00
|
|
|
(*scaled_glyph_init) (void *scaled_font,
|
|
|
|
|
cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_glyph_info_t info);
|
2005-08-05 20:30:43 +00:00
|
|
|
|
2005-08-31 19:11:22 +00:00
|
|
|
/* A backend only needs to implement this or ucs4_to_index(), not
|
|
|
|
|
* both. This allows the backend to do something more sophisticated
|
|
|
|
|
* then just converting characters one by one.
|
|
|
|
|
*/
|
2007-04-08 22:59:10 +01:00
|
|
|
cairo_warn cairo_int_status_t
|
2008-09-18 00:26:07 -04:00
|
|
|
(*text_to_glyphs) (void *scaled_font,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
const char *utf8,
|
|
|
|
|
int utf8_len,
|
|
|
|
|
cairo_glyph_t **glyphs,
|
|
|
|
|
int *num_glyphs,
|
|
|
|
|
cairo_text_cluster_t **clusters,
|
|
|
|
|
int *num_clusters,
|
|
|
|
|
cairo_text_cluster_flags_t *cluster_flags);
|
2006-06-06 15:25:49 -07:00
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
unsigned long
|
|
|
|
|
(*ucs4_to_index) (void *scaled_font,
|
|
|
|
|
uint32_t ucs4);
|
2006-06-06 15:25:49 -07:00
|
|
|
|
2010-11-23 21:44:31 +10:30
|
|
|
/* Read data from a sfnt font table.
|
|
|
|
|
* @scaled_font: font
|
|
|
|
|
* @tag: 4 byte table name specifying the table to read.
|
|
|
|
|
* @offset: offset into the table
|
|
|
|
|
* @buffer: buffer to write data into. Caller must ensure there is sufficient space.
|
|
|
|
|
* If NULL, return the size of the table in @length.
|
|
|
|
|
* @length: If @buffer is NULL, the size of the table will be returned in @length.
|
|
|
|
|
* If @buffer is not null, @length specifies the number of bytes to read.
|
|
|
|
|
*
|
|
|
|
|
* If less than @length bytes are available to read this function
|
|
|
|
|
* returns CAIRO_INT_STATUS_UNSUPPORTED. Note that requesting more
|
|
|
|
|
* bytes than are available in the table may continue reading data
|
|
|
|
|
* from the following table and return success. If this is
|
|
|
|
|
* undesirable the caller should first query the table size. If an
|
|
|
|
|
* error occurs the output value of @length is undefined.
|
|
|
|
|
*
|
|
|
|
|
* Returns CAIRO_INT_STATUS_UNSUPPORTED if not a sfnt style font or table not found.
|
|
|
|
|
*/
|
2007-04-08 22:59:10 +01:00
|
|
|
cairo_warn cairo_int_status_t
|
2006-08-02 19:12:51 -04:00
|
|
|
(*load_truetype_table)(void *scaled_font,
|
|
|
|
|
unsigned long tag,
|
|
|
|
|
long offset,
|
|
|
|
|
unsigned char *buffer,
|
|
|
|
|
unsigned long *length);
|
2007-02-07 22:35:59 +10:30
|
|
|
|
2009-05-17 18:14:28 +09:30
|
|
|
/* ucs4 is set to -1 if the unicode character could not be found
|
|
|
|
|
* for the glyph */
|
2008-06-29 19:30:14 +09:30
|
|
|
cairo_warn cairo_int_status_t
|
|
|
|
|
(*index_to_ucs4)(void *scaled_font,
|
|
|
|
|
unsigned long index,
|
|
|
|
|
uint32_t *ucs4);
|
2010-11-22 22:46:54 +10:30
|
|
|
|
2017-05-28 09:07:54 +09:30
|
|
|
/* Determine if this scaled font differs from the outlines in the font tables.
|
|
|
|
|
* eg synthesized bold/italic or a non default variant of a variable font.
|
|
|
|
|
*/
|
|
|
|
|
cairo_warn cairo_int_status_t
|
|
|
|
|
(*is_synthetic)(void *scaled_font,
|
|
|
|
|
cairo_bool_t *is_synthetic);
|
2011-07-18 21:55:37 +09:30
|
|
|
|
|
|
|
|
/* For type 1 fonts, return the glyph name for a given glyph index.
|
|
|
|
|
* A glyph index and list of glyph names in the Type 1 fonts is provided.
|
|
|
|
|
* The function returns the index of the glyph in the list of glyph names.
|
|
|
|
|
* @scaled_font: font
|
|
|
|
|
* @glyph_names: the names of each glyph in the Type 1 font in the
|
|
|
|
|
* order they appear in the CharStrings array
|
|
|
|
|
* @num_glyph_names: the number of names in the glyph_names array
|
|
|
|
|
* @glyph_index: the given glyph index
|
|
|
|
|
* @glyph_array_index: (index into glyph_names) the glyph name corresponding
|
|
|
|
|
* to the glyph_index
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
cairo_warn cairo_int_status_t
|
|
|
|
|
(*index_to_glyph_name)(void *scaled_font,
|
|
|
|
|
char **glyph_names,
|
|
|
|
|
int num_glyph_names,
|
|
|
|
|
unsigned long glyph_index,
|
|
|
|
|
unsigned long *glyph_array_index);
|
2011-07-18 22:23:21 +09:30
|
|
|
|
|
|
|
|
/* Read data from a PostScript font.
|
|
|
|
|
* @scaled_font: font
|
|
|
|
|
* @offset: offset into the table
|
|
|
|
|
* @buffer: buffer to write data into. Caller must ensure there is sufficient space.
|
|
|
|
|
* If NULL, return the size of the table in @length.
|
|
|
|
|
* @length: If @buffer is NULL, the size of the table will be returned in @length.
|
|
|
|
|
* If @buffer is not null, @length specifies the number of bytes to read.
|
|
|
|
|
*
|
|
|
|
|
* If less than @length bytes are available to read this function
|
|
|
|
|
* returns CAIRO_INT_STATUS_UNSUPPORTED. If an error occurs the
|
|
|
|
|
* output value of @length is undefined.
|
|
|
|
|
*
|
|
|
|
|
* Returns CAIRO_INT_STATUS_UNSUPPORTED if not a Type 1 font.
|
|
|
|
|
*/
|
|
|
|
|
cairo_warn cairo_int_status_t
|
|
|
|
|
(*load_type1_data) (void *scaled_font,
|
|
|
|
|
long offset,
|
|
|
|
|
unsigned char *buffer,
|
|
|
|
|
unsigned long *length);
|
2016-04-08 13:21:47 -04:00
|
|
|
|
|
|
|
|
cairo_bool_t
|
|
|
|
|
(*has_color_glyphs) (void *scaled_font);
|
2005-04-07 11:03:59 +00:00
|
|
|
};
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
|
2005-04-07 11:03:59 +00:00
|
|
|
struct _cairo_font_face_backend {
|
2006-02-24 15:32:26 -08:00
|
|
|
cairo_font_type_t type;
|
|
|
|
|
|
2008-12-17 06:25:50 -05:00
|
|
|
cairo_warn cairo_status_t
|
|
|
|
|
(*create_for_toy) (cairo_toy_font_face_t *toy_face,
|
|
|
|
|
cairo_font_face_t **font_face);
|
|
|
|
|
|
2005-04-08 13:14:17 +00:00
|
|
|
/* The destroy() function is allowed to resurrect the font face
|
|
|
|
|
* by re-referencing. This is needed for the FreeType backend.
|
|
|
|
|
*/
|
2013-09-17 16:28:19 +01:00
|
|
|
cairo_bool_t
|
2005-08-05 20:30:43 +00:00
|
|
|
(*destroy) (void *font_face);
|
|
|
|
|
|
2007-04-08 22:59:10 +01:00
|
|
|
cairo_warn cairo_status_t
|
2005-08-05 20:53:09 +00:00
|
|
|
(*scaled_font_create) (void *font_face,
|
|
|
|
|
const cairo_matrix_t *font_matrix,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_font_options_t *options,
|
|
|
|
|
cairo_scaled_font_t **scaled_font);
|
2009-06-07 18:59:36 +01:00
|
|
|
|
|
|
|
|
cairo_font_face_t *
|
|
|
|
|
(*get_implementation) (void *font_face,
|
|
|
|
|
const cairo_matrix_t *font_matrix,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_font_options_t *options);
|
2005-04-07 11:03:59 +00:00
|
|
|
};
|
2003-10-23 15:22:28 +00:00
|
|
|
|
2008-12-17 06:25:50 -05:00
|
|
|
extern const cairo_private struct _cairo_font_face_backend _cairo_user_font_face_backend;
|
2008-09-25 04:27:11 -04:00
|
|
|
|
2003-10-23 15:22:28 +00:00
|
|
|
/* concrete font backends */
|
2005-05-06 21:33:22 +00:00
|
|
|
#if CAIRO_HAS_FT_FONT
|
2005-01-16 08:35:14 +00:00
|
|
|
|
2008-12-17 06:25:50 -05:00
|
|
|
extern const cairo_private struct _cairo_font_face_backend _cairo_ft_font_face_backend;
|
2003-10-23 15:22:28 +00:00
|
|
|
|
2005-01-17 09:18:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
2005-05-06 21:33:22 +00:00
|
|
|
#if CAIRO_HAS_WIN32_FONT
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2008-12-17 06:25:50 -05:00
|
|
|
extern const cairo_private struct _cairo_font_face_backend _cairo_win32_font_face_backend;
|
2005-01-31 16:11:37 +00:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-03-17 17:37:19 -07:00
|
|
|
#if CAIRO_HAS_QUARTZ_FONT
|
2005-01-16 08:35:14 +00:00
|
|
|
|
2008-12-17 06:25:50 -05:00
|
|
|
extern const cairo_private struct _cairo_font_face_backend _cairo_quartz_font_face_backend;
|
2005-01-16 08:35:14 +00:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-10-09 09:18:16 +00:00
|
|
|
#define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE
|
2005-10-10 12:45:15 +00:00
|
|
|
#define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD
|
2008-04-06 01:07:32 -07:00
|
|
|
#define CAIRO_FILTER_DEFAULT CAIRO_FILTER_GOOD
|
2004-04-06 09:36:12 +00:00
|
|
|
|
2010-01-22 16:19:31 +00:00
|
|
|
extern const cairo_private cairo_solid_pattern_t _cairo_pattern_clear;
|
2008-10-22 22:02:05 +01:00
|
|
|
extern const cairo_private cairo_solid_pattern_t _cairo_pattern_black;
|
2010-01-22 16:19:31 +00:00
|
|
|
extern const cairo_private cairo_solid_pattern_t _cairo_pattern_white;
|
2005-03-03 17:40:04 +00:00
|
|
|
|
2011-07-30 18:14:51 +02:00
|
|
|
struct _cairo_surface_attributes {
|
2005-03-03 17:40:04 +00:00
|
|
|
cairo_matrix_t matrix;
|
|
|
|
|
cairo_extend_t extend;
|
|
|
|
|
cairo_filter_t filter;
|
2009-10-16 16:48:54 +01:00
|
|
|
cairo_bool_t has_component_alpha;
|
2005-03-03 17:40:04 +00:00
|
|
|
int x_offset;
|
|
|
|
|
int y_offset;
|
|
|
|
|
void *extra;
|
2011-07-30 18:14:51 +02:00
|
|
|
};
|
2005-01-31 08:50:22 +00:00
|
|
|
|
2003-10-23 15:22:28 +00:00
|
|
|
#define CAIRO_FONT_SLANT_DEFAULT CAIRO_FONT_SLANT_NORMAL
|
|
|
|
|
#define CAIRO_FONT_WEIGHT_DEFAULT CAIRO_FONT_WEIGHT_NORMAL
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2005-06-11 00:06:04 +00:00
|
|
|
#define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial"
|
2008-03-17 17:37:19 -07:00
|
|
|
#define CAIRO_QUARTZ_FONT_FAMILY_DEFAULT "Helvetica"
|
2005-06-11 00:06:04 +00:00
|
|
|
#define CAIRO_FT_FONT_FAMILY_DEFAULT ""
|
2008-12-17 17:30:34 -05:00
|
|
|
#define CAIRO_USER_FONT_FAMILY_DEFAULT "@cairo:"
|
2005-06-11 00:06:04 +00:00
|
|
|
|
2005-05-06 21:33:22 +00:00
|
|
|
#if CAIRO_HAS_WIN32_FONT
|
2005-01-16 08:35:14 +00:00
|
|
|
|
2005-06-11 00:06:04 +00:00
|
|
|
#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT
|
2008-12-17 06:25:50 -05:00
|
|
|
#define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_win32_font_face_backend
|
2003-10-24 10:01:34 +00:00
|
|
|
|
2008-03-17 17:37:19 -07:00
|
|
|
#elif CAIRO_HAS_QUARTZ_FONT
|
2005-01-16 08:35:14 +00:00
|
|
|
|
2008-03-17 17:37:19 -07:00
|
|
|
#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_QUARTZ_FONT_FAMILY_DEFAULT
|
2008-12-17 06:25:50 -05:00
|
|
|
#define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_quartz_font_face_backend
|
2005-01-16 08:35:14 +00:00
|
|
|
|
2005-05-06 21:33:22 +00:00
|
|
|
#elif CAIRO_HAS_FT_FONT
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2005-06-11 00:06:04 +00:00
|
|
|
#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT
|
2008-12-17 06:25:50 -05:00
|
|
|
#define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_ft_font_face_backend
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2008-01-11 17:25:33 +00:00
|
|
|
#else
|
|
|
|
|
|
2008-09-25 04:27:11 -04:00
|
|
|
#define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT
|
2008-12-17 06:25:50 -05:00
|
|
|
#define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_user_font_face_backend
|
2008-01-11 17:25:33 +00:00
|
|
|
|
2005-01-16 08:35:14 +00:00
|
|
|
#endif
|
2003-07-18 11:34:19 +00:00
|
|
|
|
|
|
|
|
#define CAIRO_GSTATE_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER
|
|
|
|
|
#define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.1
|
|
|
|
|
#define CAIRO_GSTATE_FILL_RULE_DEFAULT CAIRO_FILL_RULE_WINDING
|
|
|
|
|
#define CAIRO_GSTATE_LINE_WIDTH_DEFAULT 2.0
|
|
|
|
|
#define CAIRO_GSTATE_LINE_CAP_DEFAULT CAIRO_LINE_CAP_BUTT
|
|
|
|
|
#define CAIRO_GSTATE_LINE_JOIN_DEFAULT CAIRO_LINE_JOIN_MITER
|
|
|
|
|
#define CAIRO_GSTATE_MITER_LIMIT_DEFAULT 10.0
|
2005-04-07 13:29:32 +00:00
|
|
|
#define CAIRO_GSTATE_DEFAULT_FONT_SIZE 10.0
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2007-08-29 15:34:04 -07:00
|
|
|
#define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0
|
2006-06-09 16:52:17 -07:00
|
|
|
#define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0
|
|
|
|
|
|
2005-01-13 06:50:23 +00:00
|
|
|
typedef struct _cairo_stroke_face {
|
2003-07-30 08:30:50 +00:00
|
|
|
cairo_point_t ccw;
|
2003-10-04 09:06:15 +00:00
|
|
|
cairo_point_t point;
|
2003-07-30 08:30:50 +00:00
|
|
|
cairo_point_t cw;
|
|
|
|
|
cairo_slope_t dev_vector;
|
2011-08-15 09:44:03 +01:00
|
|
|
cairo_point_double_t dev_slope;
|
2003-07-30 08:30:50 +00:00
|
|
|
cairo_point_double_t usr_vector;
|
2011-08-15 09:44:03 +01:00
|
|
|
double length;
|
2003-07-18 11:34:19 +00:00
|
|
|
} cairo_stroke_face_t;
|
|
|
|
|
|
2004-04-06 09:36:12 +00:00
|
|
|
/* cairo.c */
|
2009-01-31 00:56:45 +00:00
|
|
|
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline double cairo_const
|
2009-01-31 00:56:45 +00:00
|
|
|
_cairo_restrict_value (double value, double min, double max)
|
|
|
|
|
{
|
|
|
|
|
if (value < min)
|
|
|
|
|
return min;
|
|
|
|
|
else if (value > max)
|
|
|
|
|
return max;
|
|
|
|
|
else
|
|
|
|
|
return value;
|
|
|
|
|
}
|
2004-04-06 09:36:12 +00:00
|
|
|
|
2009-02-10 17:53:39 -05:00
|
|
|
/* C99 round() rounds to the nearest integral value with halfway cases rounded
|
2010-10-22 16:33:55 +02:00
|
|
|
* away from 0. _cairo_round rounds halfway cases toward positive infinity.
|
2009-02-10 17:53:39 -05:00
|
|
|
* This matches the rounding behaviour of _cairo_lround. */
|
2009-05-27 15:59:16 +01:00
|
|
|
static inline double cairo_const
|
2009-02-10 17:53:39 -05:00
|
|
|
_cairo_round (double r)
|
|
|
|
|
{
|
|
|
|
|
return floor (r + .5);
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-22 21:35:23 +00:00
|
|
|
#if DISABLE_SOME_FLOATING_POINT
|
2006-11-02 22:22:17 -08:00
|
|
|
cairo_private int
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_lround (double d) cairo_const;
|
2010-01-22 21:35:23 +00:00
|
|
|
#else
|
2010-10-22 11:54:57 +02:00
|
|
|
static inline int cairo_const
|
|
|
|
|
_cairo_lround (double r)
|
|
|
|
|
{
|
|
|
|
|
return _cairo_round (r);
|
|
|
|
|
}
|
2010-01-22 21:35:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
2010-01-22 20:48:54 +00:00
|
|
|
cairo_private uint16_t
|
|
|
|
|
_cairo_half_from_float (float f) cairo_const;
|
2006-11-02 22:22:17 -08:00
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_bool_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_operator_bounded_by_mask (cairo_operator_t op) cairo_const;
|
2005-10-28 20:41:22 +00:00
|
|
|
|
|
|
|
|
cairo_private cairo_bool_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_operator_bounded_by_source (cairo_operator_t op) cairo_const;
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2010-01-19 17:11:55 +00:00
|
|
|
enum {
|
|
|
|
|
CAIRO_OPERATOR_BOUND_BY_MASK = 1 << 1,
|
|
|
|
|
CAIRO_OPERATOR_BOUND_BY_SOURCE = 1 << 2,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cairo_private uint32_t
|
|
|
|
|
_cairo_operator_bounded_by_either (cairo_operator_t op) cairo_const;
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-color.c */
|
2005-04-14 14:42:26 +00:00
|
|
|
cairo_private const cairo_color_t *
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_stock_color (cairo_stock_t stock) cairo_pure;
|
2005-04-14 14:42:26 +00:00
|
|
|
|
|
|
|
|
#define CAIRO_COLOR_WHITE _cairo_stock_color (CAIRO_STOCK_WHITE)
|
|
|
|
|
#define CAIRO_COLOR_BLACK _cairo_stock_color (CAIRO_STOCK_BLACK)
|
|
|
|
|
#define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT)
|
|
|
|
|
|
2007-03-13 16:13:35 -04:00
|
|
|
cairo_private uint16_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_color_double_to_short (double d) cairo_const;
|
2007-03-13 16:13:35 -04:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-04-14 14:42:26 +00:00
|
|
|
_cairo_color_init_rgba (cairo_color_t *color,
|
|
|
|
|
double red, double green, double blue,
|
|
|
|
|
double alpha);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-04-14 14:42:26 +00:00
|
|
|
_cairo_color_multiply_alpha (cairo_color_t *color,
|
|
|
|
|
double alpha);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-04-14 14:42:26 +00:00
|
|
|
_cairo_color_get_rgba (cairo_color_t *color,
|
|
|
|
|
double *red,
|
|
|
|
|
double *green,
|
|
|
|
|
double *blue,
|
|
|
|
|
double *alpha);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_color_get_rgba_premultiplied (cairo_color_t *color,
|
|
|
|
|
double *red,
|
|
|
|
|
double *green,
|
|
|
|
|
double *blue,
|
|
|
|
|
double *alpha);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2007-03-13 22:51:12 +00:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_color_equal (const cairo_color_t *color_a,
|
2009-05-27 15:59:16 +01:00
|
|
|
const cairo_color_t *color_b) cairo_pure;
|
2007-03-13 22:51:12 +00:00
|
|
|
|
2010-05-13 09:52:39 +01:00
|
|
|
cairo_private cairo_bool_t
|
2010-05-13 10:00:18 +01:00
|
|
|
_cairo_color_stop_equal (const cairo_color_stop_t *color_a,
|
|
|
|
|
const cairo_color_stop_t *color_b) cairo_pure;
|
2010-05-13 09:52:39 +01:00
|
|
|
|
2010-06-11 12:17:19 +01:00
|
|
|
cairo_private cairo_content_t
|
2010-04-19 09:53:00 +02:00
|
|
|
_cairo_color_get_content (const cairo_color_t *color) cairo_pure;
|
|
|
|
|
|
2007-04-18 18:24:09 -04:00
|
|
|
/* cairo-font-face.c */
|
2003-10-23 15:22:28 +00:00
|
|
|
|
2008-12-19 20:46:36 -05:00
|
|
|
extern const cairo_private cairo_font_face_t _cairo_font_face_nil;
|
2015-04-21 14:31:53 -07:00
|
|
|
extern const cairo_private cairo_font_face_t _cairo_font_face_nil_file_not_found;
|
2005-07-28 09:29:46 +00:00
|
|
|
|
2005-04-07 11:03:59 +00:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_face_init (cairo_font_face_t *font_face,
|
|
|
|
|
const cairo_font_face_backend_t *backend);
|
|
|
|
|
|
2013-09-17 16:28:19 +01:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_font_face_destroy (void *abstract_face);
|
|
|
|
|
|
2007-10-04 15:26:09 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_font_face_set_error (cairo_font_face_t *font_face,
|
|
|
|
|
cairo_status_t status);
|
|
|
|
|
|
Change cairo_font_t to refer to a font scaled to a particular output device resolution.
src/cairoint.h src/cairo_font.c src/cairo_ft_font.c src/cairo_xlib_surface.c src/cairo_pdf_surface.c src/cairo_gstate.c src/cairo.c: Switch many internal methods from handling cairo_unscaled_font_t and cairo_font_scale_t pairs to handling cairo_font_t.
src/cairo-ft-private.h src/cairo_ft_fontc: Add some internal interfaces for use by the FreeType backend.
Clear the gstate's current font when the transform or target surface changes.
src/cairo.h src/cairo_ft_font.c: Rename cairo_ft_font_pattern to cairo_ft_font_get_pattern().
src/cairo.h src/cairo_ft_font.c: Make cairo_ft_font_create() and cairo_ft_font_create_for_ft_face() take a font scale; make the latter take load_flags for FT_Load_Glyph() as well. Change cairo_ft_font_face() to Xft-style cairo_ft_font_lock_face, cairo_ft_font_unlock_face.
Remove the name/slant/weight=>unscaled font cache, it didn't work with the new cairo_font_t setup. If it turns out to be needed, it can be added back in some other form.
src/cairoint.h src/cairo_font.c: Add a 'flags' field to cairo_glyph_cache_key_t, we use it for load flags with freetype backend.
Switch the caching to be from resolved fontconfig pattern => file; keep only a fixed number of FT_Face objects open at once, similar to FreeType.
src/cairo_gstate.c src/cairoint.h: Add public cairo_font_glyph_extents, use it to implement _cairo_gstate_glyph_extents().
Add refcounting for glyph cache elements; there was an bug where elements got ejected from the cache and freed before they could be used.
src/cairoint.h src/cairo_cache.c (_cairo_cache_random_entry()) New function to return a random entry in the cache matching a predicate; reuse the internals for the previous _random_live_entry().
src/cairoint.h src/cairo_cache.c (_cairo_cache_lookup()): Add an optional created_entry return value.
src/cairo_ft_font.c src/cairo_xlib_surface.c: Adapt to _cairo_cache_lookup() change.
Support max_memory == 0 to indicate an unbounded cache.
src/cairoint.h src/cairo_cache.c (_cairo_cache_remove()): Add a function to manually remove entries from the cache.
Update for changes, document cairo_matrix_t, cairo_glyph_t, etc.
src/cairo.h src/cairo-atsui.h src/cairo-ft.h src/cairo-glitz.h src/cairo-pdf.h src/cairo-png.h src/cairo-ps.h src/cairo-quartz.h src/cairo-xcb.h src/cairo-xlib.h: Add CAIRO_BEGIN/END_DECLS for extern "C", use it on all public headers. Move header guards outermost.
Fix encoding.
2005-01-21 14:33:47 +00:00
|
|
|
cairo_private void
|
2006-06-06 15:41:31 -07:00
|
|
|
_cairo_unscaled_font_init (cairo_unscaled_font_t *font,
|
2005-04-07 11:03:59 +00:00
|
|
|
const cairo_unscaled_font_backend_t *backend);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2007-04-10 21:09:36 +01:00
|
|
|
cairo_private_no_warn cairo_unscaled_font_t *
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
_cairo_unscaled_font_reference (cairo_unscaled_font_t *font);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
Add cairo_cache.c
Rewrite using temporary glyph arrays
New file.
Remove old glyph cache code. (_cairo_font_scale) (_cairo_font_transform): Remove font-transforming code. (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_cache_key_t): New structure type. (_font_cache_hash) (_font_cache_keys_equal) (_font_cache_create_entry) (_font_cache_destroy_entry) (_font_cache_destroy_cache): New font cache code. (_global_font_cache) (_lock_global_font_cache) (_unlock_global_font_cache) (_get_global_font_cache): New global font cache. (_cairo_font_text_to_glyphs) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal) (_image_glyph_cache_create_entry) (_image_glyph_cache_destroy_entry) (_image_glyph_cache_destroy_cache): New glyph cache code. (_global_image_glyph_cache) (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache): New global glyph cache. (_cairo_font_cache_backend): New structure. (_cairo_image_cache_backend): Likewise. (_cairo_font_create): Reimplement in terms of font cache. (_cairo_font_init): Remove matrix and glyph cache related code. (_cairo_font_copy): Likewise. (_cairo_font_show_glyphs): Delegate to surface when possible. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Rename to as cairo_unscaled_font_XXX, and add scale parameter.
New structure types. (_create_from_face) (_reference_font_val) (_destroy_font_val) (_create_from_library_and_pattern): New functions. (_ft_font_cache_hash) (_ft_font_cache_keys_equal) (_ft_font_cache_create_entry) (_ft_font_cache_destroy_entry) (_ft_font_cache_destroy_cache): New ft font cache code. (_global_ft_cache) (_lock_global_ft_cache) (_unlock_global_ft_cache) (_get_global_ft_cache): New global ft font cache. (_ft_font_cache_backend): New structure. (_cairo_ft_font_create): Rewrite to use cache. (_cairo_ft_font_destroy): Likewise. (_cairo_ft_font_copy): Remove. (_install_font_matrix): Rename as _install_font_scale. (_utf8_to_glyphs): Rename as _cairo_ft_font_text_to_glyphs. (_cairo_ft_font_text_to_glyphs): Use cache for metrics. (_cairo_ft_font_extents): Accept size, use scaled metrics. (_cairo_ft_font_glyph_extents) (_cairo_ft_font_glyph_bbox) (_cairo_ft_font_show_glyphs) (_cairo_ft_font_glyph_path): Modify to use size, cache. (_cairo_ft_font_text_extents) (_cairo_ft_font_text_bbox) (_cairo_ft_font_show_text) (_cairo_ft_font_text_path): Remove text-API code. (cairo_ft_font_create) (cairo_ft_font_create_for_ft_face) (cairo_ft_font_face) (cairo_ft_font_pattern): Rewrite using ft_font_val_t.
Just reference font. (_cairo_gstate_fini): Finalize font matrix. (_cairo_gstate_default_matrix): Initialize font matrix. (_cairo_gstate_clip): Re-enable clipping rectangle. (_cairo_gstate_select_font) (_cairo_gstate_set_font): Set font matrix to identity. (_cairo_gstate_scale_font): Scale font matrix, not font. (_cairo_gstate_transform_font): Transform font matrix, not font. (_cairo_gstate_set_font_transform): Install as font matrix, not in font. (_build_font_scale): New helper function. (_cairo_gstate_text_to_glyphs): New function. (_cairo_gstate_current_font_extents) (_cairo_gstate_glyph_extents) (_cairo_gstate_show_glyphs) (_cairo_gstate_glyph_path): Rewrite using font matrix and size. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text): Remove text-API code.
Minor bug fix. (_cairo_xlib_surface_show_glyphs): New function. (_cairo_xlib_surface_backend): Add reference to new function. (glyphset_cache_t) (glyphset_cache_entry_t): New structure types. (_next_xlib_glyph): New helper function. (_xlib_glyphset_cache_create_value) (_xlib_glyphset_cache_destroy_cache) (_xlib_glyphset_cache_destroy_value) (_xlib_glyphset_cache_backend): New glyphset cache code. (_xlib_glyphset_caches) (_lock_xlib_glyphset_caches) (_unlock_xlib_glyphset_caches) (_get_glyphset_cache): New global glyphset cache.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
Add NULL entry for show_glyphs.
New structure type. (cairo_cache_entry_base_t) (cairo_cache_arrangement_t) (cairo_cache_t): New structure types. (_cairo_cache_init) (_cairo_cache_reference) (_cairo_cache_destroy) (_cairo_cache_lookup) (_cairo_hash_string): New cache functions. (CAIRO_IMAGE_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_XLIB_GLYPH_CACHE_MEMORY_DEFAULT) (CAIRO_FONT_CACHE_NUM_FONTS_DEFAULT) (CAIRO_FT_CACHE_NUM_FONTS_DEFAULT): New constants. (cairo_font_scale_t) (cairo_glyph_cache_key_t) (cairo_image_glyph_cache_entry_t): New structure types. (_cairo_lock_global_image_glyph_cache) (_cairo_unlock_global_image_glyph_cache) (_cairo_get_global_image_glyph_cache) (_cairo_glyph_cache_hash) (_cairo_glyph_cache_keys_equal): New functions for glyph caches. (cairo_font_backend_t): Remove text-API calls, add scale params, remove copy call. (cairo_surface_backend_t): Add show_glyphs entry. (cairo_glyph_surface_t) (cairo_glyph_surface_node_t): Remove old glyph cache structures. (cairo_unscaled_font_t): New structure type. (cairo_font): Remove glyph cache member, add pointer to unscaled. (cairo_gstate): Add font_matrix member, change to hold unscaled. (_cairo_gstate_set_font_transform) (_cairo_gstate_current_font_transform) (_cairo_gstate_text_to_glyphs): New functions. (_cairo_gstate_text_path (_cairo_gstate_text_extents) (_cairo_gstate_show_text) (_cairo_font_text_extents) (_cairo_font_text_bbox) (_cairo_font_show_text) (_cairo_font_text_path): Remove text-API code. (_cairo_font_glyph_extents) (_cairo_font_glyph_bbox) (_cairo_font_glyph_path) (_cairo_font_font_extents) (_cairo_font_show_glyphs): Add scale parameter.
2004-10-08 12:09:49 +00:00
|
|
|
_cairo_unscaled_font_destroy (cairo_unscaled_font_t *font);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-09-25 04:27:11 -04:00
|
|
|
/* cairo-font-face-twin.c */
|
|
|
|
|
|
2009-06-19 11:15:30 +01:00
|
|
|
cairo_private cairo_font_face_t *
|
|
|
|
|
_cairo_font_face_twin_create_fallback (void);
|
|
|
|
|
|
2008-12-20 19:39:58 -05:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_font_face_twin_create_for_toy (cairo_toy_font_face_t *toy_face,
|
|
|
|
|
cairo_font_face_t **font_face);
|
2008-09-25 04:27:11 -04:00
|
|
|
|
|
|
|
|
/* cairo-font-face-twin-data.c */
|
|
|
|
|
|
|
|
|
|
extern const cairo_private int8_t _cairo_twin_outlines[];
|
|
|
|
|
extern const cairo_private uint16_t _cairo_twin_charmap[128];
|
|
|
|
|
|
2005-07-21 06:52:13 +00:00
|
|
|
/* cairo-font-options.c */
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_options_init_default (cairo_font_options_t *options);
|
|
|
|
|
|
2005-11-07 09:49:51 +00:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_options_init_copy (cairo_font_options_t *options,
|
|
|
|
|
const cairo_font_options_t *other);
|
|
|
|
|
|
2018-01-05 09:09:01 -05:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_options_fini (cairo_font_options_t *options);
|
|
|
|
|
|
2010-06-17 08:56:30 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_options_set_lcd_filter (cairo_font_options_t *options,
|
|
|
|
|
cairo_lcd_filter_t lcd_filter);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_lcd_filter_t
|
|
|
|
|
_cairo_font_options_get_lcd_filter (const cairo_font_options_t *options);
|
|
|
|
|
|
2010-10-21 13:52:33 +02:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_font_options_set_round_glyph_positions (cairo_font_options_t *options,
|
|
|
|
|
cairo_round_glyph_positions_t round);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_round_glyph_positions_t
|
|
|
|
|
_cairo_font_options_get_round_glyph_positions (const cairo_font_options_t *options);
|
|
|
|
|
|
2008-05-09 13:14:23 +02:00
|
|
|
/* cairo-hull.c */
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2003-10-04 14:34:42 +00:00
|
|
|
_cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices);
|
|
|
|
|
|
2006-06-17 15:52:05 +08:00
|
|
|
/* cairo-lzw.c */
|
|
|
|
|
cairo_private unsigned char *
|
|
|
|
|
_cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out);
|
|
|
|
|
|
2008-08-08 00:56:36 -04:00
|
|
|
/* cairo-misc.c */
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_validate_text_clusters (const char *utf8,
|
|
|
|
|
int utf8_len,
|
|
|
|
|
const cairo_glyph_t *glyphs,
|
|
|
|
|
int num_glyphs,
|
|
|
|
|
const cairo_text_cluster_t *clusters,
|
|
|
|
|
int num_clusters,
|
2008-09-18 00:26:07 -04:00
|
|
|
cairo_text_cluster_flags_t cluster_flags);
|
2008-08-08 00:56:36 -04:00
|
|
|
|
2017-09-17 10:20:06 -04:00
|
|
|
cairo_private unsigned long
|
|
|
|
|
_cairo_string_hash (const char *str, int len);
|
|
|
|
|
|
2008-11-03 11:01:22 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_intern_string (const char **str_inout, int len);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_intern_string_reset_static_data (void);
|
|
|
|
|
|
2014-03-24 19:08:10 +10:30
|
|
|
cairo_private const char *
|
2017-09-17 14:15:25 +09:30
|
|
|
_cairo_get_locale_decimal_point (void);
|
|
|
|
|
|
|
|
|
|
cairo_private double
|
|
|
|
|
_cairo_strtod (const char *nptr, char **endptr);
|
2014-03-24 19:08:10 +10:30
|
|
|
|
2008-05-09 13:14:23 +02:00
|
|
|
/* cairo-path-fixed.c */
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
cairo_private cairo_path_fixed_t *
|
|
|
|
|
_cairo_path_fixed_create (void);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_init (cairo_path_fixed_t *path);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_init_copy (cairo_path_fixed_t *path,
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
const cairo_path_fixed_t *other);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_fini (cairo_path_fixed_t *path);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2006-02-24 00:04:05 +01:00
|
|
|
cairo_private void
|
2005-08-31 15:08:02 +00:00
|
|
|
_cairo_path_fixed_destroy (cairo_path_fixed_t *path);
|
|
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-04-26 12:38:06 +00:00
|
|
|
_cairo_path_fixed_move_to (cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fixed_t x,
|
|
|
|
|
cairo_fixed_t y);
|
2003-09-25 15:01:28 +00:00
|
|
|
|
2006-02-23 22:01:07 -08:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_path_fixed_new_sub_path (cairo_path_fixed_t *path);
|
|
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_rel_move_to (cairo_path_fixed_t *path,
|
2005-04-26 12:38:06 +00:00
|
|
|
cairo_fixed_t dx,
|
|
|
|
|
cairo_fixed_t dy);
|
2003-12-16 07:10:48 +00:00
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-04-26 12:38:06 +00:00
|
|
|
_cairo_path_fixed_line_to (cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fixed_t x,
|
|
|
|
|
cairo_fixed_t y);
|
2003-09-25 15:01:28 +00:00
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_rel_line_to (cairo_path_fixed_t *path,
|
2005-04-26 12:38:06 +00:00
|
|
|
cairo_fixed_t dx,
|
|
|
|
|
cairo_fixed_t dy);
|
2003-12-16 07:10:48 +00:00
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-04-26 12:38:06 +00:00
|
|
|
_cairo_path_fixed_curve_to (cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fixed_t x0, cairo_fixed_t y0,
|
|
|
|
|
cairo_fixed_t x1, cairo_fixed_t y1,
|
|
|
|
|
cairo_fixed_t x2, cairo_fixed_t y2);
|
2003-09-25 15:01:28 +00:00
|
|
|
|
2005-08-09 13:01:14 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path,
|
2005-04-26 12:38:06 +00:00
|
|
|
cairo_fixed_t dx0, cairo_fixed_t dy0,
|
|
|
|
|
cairo_fixed_t dx1, cairo_fixed_t dy1,
|
|
|
|
|
cairo_fixed_t dx2, cairo_fixed_t dy2);
|
2003-12-16 07:10:48 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-03-23 13:52:54 +00:00
|
|
|
_cairo_path_fixed_close_path (cairo_path_fixed_t *path);
|
2003-09-25 15:01:28 +00:00
|
|
|
|
2007-10-30 10:42:22 +00:00
|
|
|
cairo_private cairo_bool_t
|
2005-04-26 12:38:06 +00:00
|
|
|
_cairo_path_fixed_get_current_point (cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fixed_t *x,
|
|
|
|
|
cairo_fixed_t *y);
|
2004-02-12 19:02:33 +00:00
|
|
|
|
2005-03-23 13:52:54 +00:00
|
|
|
typedef cairo_status_t
|
|
|
|
|
(cairo_path_fixed_move_to_func_t) (void *closure,
|
2008-12-09 20:44:25 +00:00
|
|
|
const cairo_point_t *point);
|
2004-02-12 19:02:33 +00:00
|
|
|
|
2005-03-23 13:52:54 +00:00
|
|
|
typedef cairo_status_t
|
|
|
|
|
(cairo_path_fixed_line_to_func_t) (void *closure,
|
2008-12-09 20:44:25 +00:00
|
|
|
const cairo_point_t *point);
|
2004-02-12 19:02:33 +00:00
|
|
|
|
2005-03-23 13:52:54 +00:00
|
|
|
typedef cairo_status_t
|
|
|
|
|
(cairo_path_fixed_curve_to_func_t) (void *closure,
|
2008-12-09 20:44:25 +00:00
|
|
|
const cairo_point_t *p0,
|
|
|
|
|
const cairo_point_t *p1,
|
|
|
|
|
const cairo_point_t *p2);
|
2004-02-12 19:02:33 +00:00
|
|
|
|
2005-03-23 13:52:54 +00:00
|
|
|
typedef cairo_status_t
|
|
|
|
|
(cairo_path_fixed_close_path_func_t) (void *closure);
|
2003-12-16 07:10:48 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-05-09 13:13:15 +02:00
|
|
|
_cairo_path_fixed_interpret (const cairo_path_fixed_t *path,
|
2005-03-23 13:52:54 +00:00
|
|
|
cairo_path_fixed_move_to_func_t *move_to,
|
|
|
|
|
cairo_path_fixed_line_to_func_t *line_to,
|
|
|
|
|
cairo_path_fixed_curve_to_func_t *curve_to,
|
|
|
|
|
cairo_path_fixed_close_path_func_t *close_path,
|
|
|
|
|
void *closure);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-01-19 22:31:10 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-05-09 13:13:15 +02:00
|
|
|
_cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path,
|
2008-01-19 22:31:10 +00:00
|
|
|
cairo_path_fixed_move_to_func_t *move_to,
|
|
|
|
|
cairo_path_fixed_line_to_func_t *line_to,
|
|
|
|
|
cairo_path_fixed_close_path_func_t *close_path,
|
|
|
|
|
void *closure,
|
|
|
|
|
double tolerance);
|
|
|
|
|
|
2010-10-22 12:35:40 +02:00
|
|
|
|
|
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_path_bounder_extents (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_box_t *box);
|
|
|
|
|
|
2010-01-22 15:54:45 +00:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_path_fixed_extents (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_box_t *box);
|
|
|
|
|
|
2008-11-25 10:04:50 +00:00
|
|
|
cairo_private void
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_approximate_clip_extents (const cairo_path_fixed_t *path,
|
2009-01-14 18:55:32 +00:00
|
|
|
cairo_rectangle_int_t *extents);
|
2008-12-18 14:52:03 +00:00
|
|
|
|
|
|
|
|
cairo_private void
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_approximate_fill_extents (const cairo_path_fixed_t *path,
|
2008-12-18 14:52:03 +00:00
|
|
|
cairo_rectangle_int_t *extents);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_fill_extents (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_rectangle_int_t *extents);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_path_fixed_approximate_stroke_extents (const cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *style,
|
2008-12-18 14:52:03 +00:00
|
|
|
const cairo_matrix_t *ctm,
|
2015-09-21 21:35:05 +09:30
|
|
|
cairo_bool_t vector,
|
2008-12-18 14:52:03 +00:00
|
|
|
cairo_rectangle_int_t *extents);
|
2008-11-25 10:04:50 +00:00
|
|
|
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_stroke_extents (const cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *style,
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_rectangle_int_t *extents);
|
|
|
|
|
|
2006-05-04 01:45:41 -07:00
|
|
|
cairo_private void
|
2008-05-13 16:10:28 -04:00
|
|
|
_cairo_path_fixed_transform (cairo_path_fixed_t *path,
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
const cairo_matrix_t *matrix);
|
2008-02-25 21:06:23 -05:00
|
|
|
|
|
|
|
|
cairo_private cairo_bool_t
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_is_box (const cairo_path_fixed_t *path,
|
2008-02-25 21:06:23 -05:00
|
|
|
cairo_box_t *box);
|
|
|
|
|
|
2008-02-26 23:17:04 +10:30
|
|
|
cairo_private cairo_bool_t
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_is_rectangle (const cairo_path_fixed_t *path,
|
2008-02-26 23:17:04 +10:30
|
|
|
cairo_box_t *box);
|
|
|
|
|
|
2008-11-05 23:48:52 +00:00
|
|
|
/* cairo-path-in-fill.c */
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_path_fixed_in_fill (const cairo_path_fixed_t *path,
|
2008-11-05 23:48:52 +00:00
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
double tolerance,
|
|
|
|
|
double x,
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
double y);
|
2008-11-05 23:48:52 +00:00
|
|
|
|
2008-05-09 13:14:23 +02:00
|
|
|
/* cairo-path-fill.c */
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-12-17 09:32:16 +00:00
|
|
|
_cairo_path_fixed_fill_to_polygon (const cairo_path_fixed_t *path,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_polygon_t *polygon);
|
|
|
|
|
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_fill_rectilinear_to_polygon (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_antialias_t antialias,
|
|
|
|
|
cairo_polygon_t *polygon);
|
|
|
|
|
|
2010-01-22 16:02:07 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_fill_rectilinear_to_boxes (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_antialias_t antialias,
|
2010-01-22 16:02:07 +00:00
|
|
|
cairo_boxes_t *boxes);
|
|
|
|
|
|
2009-07-25 21:25:07 +01:00
|
|
|
cairo_private cairo_region_t *
|
|
|
|
|
_cairo_path_fixed_fill_rectilinear_to_region (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
const cairo_rectangle_int_t *extents);
|
|
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t *path,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_traps_t *traps);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-05-09 13:14:23 +02:00
|
|
|
/* cairo-path-stroke.c */
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-12-17 09:32:16 +00:00
|
|
|
_cairo_path_fixed_stroke_to_polygon (const cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *stroke_style,
|
2008-12-17 09:32:16 +00:00
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_polygon_t *polygon);
|
|
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private cairo_int_status_t
|
|
|
|
|
_cairo_path_fixed_stroke_to_tristrip (const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_stroke_style_t*style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_tristrip_t *strip);
|
|
|
|
|
|
2011-08-15 08:23:38 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_stroke_dashed_to_polygon (const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_polygon_t *polygon);
|
|
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
cairo_private cairo_int_status_t
|
2010-01-22 16:07:25 +00:00
|
|
|
_cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_antialias_t antialias,
|
2010-01-22 16:07:25 +00:00
|
|
|
cairo_boxes_t *boxes);
|
|
|
|
|
|
2010-04-23 19:45:26 +01:00
|
|
|
cairo_private cairo_int_status_t
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *stroke_style,
|
2008-11-30 13:49:24 +00:00
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
double tolerance,
|
|
|
|
|
cairo_traps_t *traps);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2012-08-24 17:22:34 +01:00
|
|
|
cairo_private cairo_int_status_t
|
|
|
|
|
_cairo_path_fixed_stroke_polygon_to_traps (const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
double tolerance,
|
|
|
|
|
cairo_traps_t *traps);
|
|
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_path_fixed_stroke_to_shaper (cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
2008-12-17 09:32:16 +00:00
|
|
|
double tolerance,
|
|
|
|
|
cairo_status_t (*add_triangle) (void *closure,
|
|
|
|
|
const cairo_point_t triangle[3]),
|
|
|
|
|
cairo_status_t (*add_triangle_fan) (void *closure,
|
|
|
|
|
const cairo_point_t *midpt,
|
|
|
|
|
const cairo_point_t *points,
|
|
|
|
|
int npoints),
|
|
|
|
|
cairo_status_t (*add_quad) (void *closure,
|
|
|
|
|
const cairo_point_t quad[4]),
|
|
|
|
|
void *closure);
|
|
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
/* cairo-scaled-font.c */
|
|
|
|
|
|
2008-05-24 14:57:06 -04:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_freeze_cache (cairo_scaled_font_t *scaled_font);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_thaw_cache (cairo_scaled_font_t *scaled_font);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_reset_cache (cairo_scaled_font_t *scaled_font);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_scaled_font_set_error (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_status_t status);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_scaled_font_t *
|
|
|
|
|
_cairo_scaled_font_create_in_error (cairo_status_t status);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_reset_static_data (void);
|
|
|
|
|
|
2008-10-18 00:37:38 +01:00
|
|
|
cairo_private cairo_status_t
|
2008-05-25 01:51:05 -04:00
|
|
|
_cairo_scaled_font_register_placeholder_and_unlock_font_map (cairo_scaled_font_t *scaled_font);
|
2008-05-25 00:17:43 -04:00
|
|
|
|
|
|
|
|
cairo_private void
|
2008-05-25 01:51:05 -04:00
|
|
|
_cairo_scaled_font_unregister_placeholder_and_lock_font_map (cairo_scaled_font_t *scaled_font);
|
2008-05-24 14:57:06 -04:00
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_private cairo_status_t
|
2006-06-06 15:41:31 -07:00
|
|
|
_cairo_scaled_font_init (cairo_scaled_font_t *scaled_font,
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_font_face_t *font_face,
|
|
|
|
|
const cairo_matrix_t *font_matrix,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_font_options_t *options,
|
|
|
|
|
const cairo_scaled_font_backend_t *backend);
|
|
|
|
|
|
2008-01-29 08:41:21 -08:00
|
|
|
cairo_private cairo_status_t
|
2005-08-31 15:08:02 +00:00
|
|
|
_cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_font_extents_t *fs_metrics);
|
|
|
|
|
|
2008-10-21 22:48:17 +01:00
|
|
|
/* This should only be called on an error path by a scaled_font constructor */
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_fini (cairo_scaled_font_t *scaled_font);
|
|
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_private cairo_status_t
|
2006-06-06 15:41:31 -07:00
|
|
|
_cairo_scaled_font_font_extents (cairo_scaled_font_t *scaled_font,
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_font_extents_t *extents);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
2006-05-04 03:43:34 -07:00
|
|
|
_cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
const cairo_glyph_t *glyphs,
|
|
|
|
|
int num_glyphs,
|
2009-07-28 15:58:54 +01:00
|
|
|
cairo_rectangle_int_t *extents,
|
|
|
|
|
cairo_bool_t *overlap);
|
2005-08-31 15:08:02 +00:00
|
|
|
|
2012-06-04 20:16:12 +01:00
|
|
|
cairo_private cairo_bool_t
|
2009-09-11 14:56:17 +01:00
|
|
|
_cairo_scaled_font_glyph_approximate_extents (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
const cairo_glyph_t *glyphs,
|
|
|
|
|
int num_glyphs,
|
|
|
|
|
cairo_rectangle_int_t *extents);
|
|
|
|
|
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
|
2005-12-16 03:02:35 +00:00
|
|
|
cairo_operator_t op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *source,
|
2005-08-31 15:08:02 +00:00
|
|
|
cairo_surface_t *surface,
|
|
|
|
|
int source_x,
|
|
|
|
|
int source_y,
|
|
|
|
|
int dest_x,
|
|
|
|
|
int dest_y,
|
|
|
|
|
unsigned int width,
|
|
|
|
|
unsigned int height,
|
2007-08-31 16:53:21 +01:00
|
|
|
cairo_glyph_t *glyphs,
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
int num_glyphs,
|
|
|
|
|
cairo_region_t *clip_region);
|
2005-08-31 15:08:02 +00:00
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font,
|
2006-06-06 15:41:31 -07:00
|
|
|
const cairo_glyph_t *glyphs,
|
2005-08-31 15:08:02 +00:00
|
|
|
int num_glyphs,
|
|
|
|
|
cairo_path_fixed_t *path);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_glyph_set_metrics (cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_text_extents_t *fs_metrics);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_glyph_set_surface (cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_image_surface_t *surface);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_path_fixed_t *path);
|
|
|
|
|
|
2008-05-09 15:56:35 +02:00
|
|
|
cairo_private void
|
2009-10-22 02:13:36 +03:00
|
|
|
_cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_surface_t *recording_surface);
|
2008-05-09 15:56:35 +02:00
|
|
|
|
2016-04-07 20:38:09 -04:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_glyph_set_color_surface (cairo_scaled_glyph_t *scaled_glyph,
|
|
|
|
|
cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_image_surface_t *surface);
|
|
|
|
|
|
2006-06-13 12:45:16 -07:00
|
|
|
cairo_private cairo_int_status_t
|
2005-08-31 15:08:02 +00:00
|
|
|
_cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
unsigned long index,
|
|
|
|
|
cairo_scaled_glyph_info_t info,
|
|
|
|
|
cairo_scaled_glyph_t **scaled_glyph_ret);
|
|
|
|
|
|
2008-05-24 14:57:31 -04:00
|
|
|
cairo_private double
|
|
|
|
|
_cairo_scaled_font_get_max_scale (cairo_scaled_font_t *scaled_font);
|
|
|
|
|
|
2008-12-26 00:05:19 -05:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_scaled_font_map_destroy (void);
|
|
|
|
|
|
2005-11-07 09:49:51 +00:00
|
|
|
/* cairo-stroke-style.c */
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_init (cairo_stroke_style_t *style);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_stroke_style_init_copy (cairo_stroke_style_t *style,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *other);
|
2005-11-07 09:49:51 +00:00
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_fini (cairo_stroke_style_t *style);
|
|
|
|
|
|
2008-02-06 13:01:52 -08:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_max_distance_from_path (const cairo_stroke_style_t *style,
|
2011-07-30 17:28:21 +01:00
|
|
|
const cairo_path_fixed_t *path,
|
2008-02-06 13:01:52 -08:00
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
double *dx, double *dy);
|
2012-08-24 17:22:34 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_max_line_distance_from_path (const cairo_stroke_style_t *style,
|
|
|
|
|
const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
double *dx, double *dy);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_max_join_distance_from_path (const cairo_stroke_style_t *style,
|
|
|
|
|
const cairo_path_fixed_t *path,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
double *dx, double *dy);
|
2008-02-06 13:01:52 -08:00
|
|
|
|
2009-11-10 23:09:56 +01:00
|
|
|
cairo_private double
|
|
|
|
|
_cairo_stroke_style_dash_period (const cairo_stroke_style_t *style);
|
|
|
|
|
|
|
|
|
|
cairo_private double
|
|
|
|
|
_cairo_stroke_style_dash_stroked (const cairo_stroke_style_t *style);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_stroke_style_dash_can_approximate (const cairo_stroke_style_t *style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
double tolerance);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_stroke_style_dash_approximate (const cairo_stroke_style_t *style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
double tolerance,
|
|
|
|
|
double *dash_offset,
|
|
|
|
|
double *dashes,
|
|
|
|
|
unsigned int *num_dashes);
|
|
|
|
|
|
|
|
|
|
|
2005-05-26 11:35:44 +00:00
|
|
|
/* cairo-surface.c */
|
2005-07-27 15:39:34 +00:00
|
|
|
|
2017-11-09 20:52:36 +10:30
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_surface_has_mime_image (cairo_surface_t *surface);
|
|
|
|
|
|
2008-11-03 23:45:12 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_surface_copy_mime_data (cairo_surface_t *dst,
|
2009-02-13 12:56:46 +00:00
|
|
|
cairo_surface_t *src);
|
2008-11-03 23:45:12 +00:00
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private_no_warn cairo_int_status_t
|
2006-05-01 15:44:58 -07:00
|
|
|
_cairo_surface_set_error (cairo_surface_t *surface,
|
2011-08-13 11:30:25 +01:00
|
|
|
cairo_int_status_t status);
|
2006-05-01 15:44:58 -07:00
|
|
|
|
2007-08-29 15:34:04 -07:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_surface_set_resolution (cairo_surface_t *surface,
|
|
|
|
|
double x_res,
|
|
|
|
|
double y_res);
|
|
|
|
|
|
2011-07-22 00:36:03 +01:00
|
|
|
cairo_private cairo_surface_t *
|
|
|
|
|
_cairo_surface_create_for_rectangle_int (cairo_surface_t *target,
|
2011-07-27 09:10:34 +02:00
|
|
|
const cairo_rectangle_int_t *extents);
|
2011-07-22 00:36:03 +01:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_surface_t *
|
2013-08-27 14:46:16 +02:00
|
|
|
_cairo_surface_create_scratch (cairo_surface_t *other,
|
|
|
|
|
cairo_content_t content,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
const cairo_color_t *color);
|
2008-06-13 21:36:14 -04:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2003-09-30 18:56:22 +00:00
|
|
|
_cairo_surface_init (cairo_surface_t *surface,
|
2006-05-24 17:05:51 -07:00
|
|
|
const cairo_surface_backend_t *backend,
|
2010-01-18 21:53:42 +00:00
|
|
|
cairo_device_t *device,
|
2015-09-21 21:35:05 +09:30
|
|
|
cairo_content_t content,
|
|
|
|
|
cairo_bool_t is_vector);
|
2003-09-30 18:56:22 +00:00
|
|
|
|
2006-09-05 16:48:49 -07:00
|
|
|
cairo_private void
|
2006-07-31 14:44:42 -04:00
|
|
|
_cairo_surface_set_font_options (cairo_surface_t *surface,
|
|
|
|
|
cairo_font_options_t *options);
|
|
|
|
|
|
2005-10-27 17:16:46 +00:00
|
|
|
cairo_private cairo_status_t
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
_cairo_surface_paint (cairo_surface_t *surface,
|
2005-12-16 03:02:35 +00:00
|
|
|
cairo_operator_t op,
|
2008-10-01 20:50:53 +09:30
|
|
|
const cairo_pattern_t *source,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2005-10-27 15:06:53 +00:00
|
|
|
|
2012-01-08 15:30:03 +01:00
|
|
|
cairo_private cairo_image_surface_t *
|
|
|
|
|
_cairo_surface_map_to_image (cairo_surface_t *surface,
|
|
|
|
|
const cairo_rectangle_int_t *extents);
|
|
|
|
|
|
2014-05-19 14:59:29 +05:30
|
|
|
cairo_private_no_warn cairo_int_status_t
|
2012-01-08 15:30:03 +01:00
|
|
|
_cairo_surface_unmap_image (cairo_surface_t *surface,
|
|
|
|
|
cairo_image_surface_t *image);
|
|
|
|
|
|
2005-10-27 17:16:46 +00:00
|
|
|
cairo_private cairo_status_t
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
_cairo_surface_mask (cairo_surface_t *surface,
|
2005-12-16 03:02:35 +00:00
|
|
|
cairo_operator_t op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *source,
|
2008-10-01 20:50:53 +09:30
|
|
|
const cairo_pattern_t *mask,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2005-10-27 17:16:46 +00:00
|
|
|
|
2007-08-25 20:49:50 +02:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_surface_fill_stroke (cairo_surface_t *surface,
|
|
|
|
|
cairo_operator_t fill_op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *fill_source,
|
2007-08-25 20:49:50 +02:00
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
double fill_tolerance,
|
|
|
|
|
cairo_antialias_t fill_antialias,
|
|
|
|
|
cairo_path_fixed_t *path,
|
|
|
|
|
cairo_operator_t stroke_op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *stroke_source,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *stroke_ctm,
|
|
|
|
|
const cairo_matrix_t *stroke_ctm_inverse,
|
2007-08-25 20:49:50 +02:00
|
|
|
double stroke_tolerance,
|
2008-10-01 20:50:53 +09:30
|
|
|
cairo_antialias_t stroke_antialias,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2007-08-25 20:49:50 +02:00
|
|
|
|
2005-10-31 16:55:21 +00:00
|
|
|
cairo_private cairo_status_t
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
_cairo_surface_stroke (cairo_surface_t *surface,
|
2005-12-16 03:02:35 +00:00
|
|
|
cairo_operator_t op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *source,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_path_fixed_t *path,
|
2010-01-18 18:20:16 +00:00
|
|
|
const cairo_stroke_style_t *style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
double tolerance,
|
2008-10-01 20:50:53 +09:30
|
|
|
cairo_antialias_t antialias,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2005-10-31 16:55:21 +00:00
|
|
|
|
2005-10-13 16:55:14 +00:00
|
|
|
cairo_private cairo_status_t
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
_cairo_surface_fill (cairo_surface_t *surface,
|
2005-12-16 03:02:35 +00:00
|
|
|
cairo_operator_t op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *source,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_path_fixed_t *path,
|
Rework support in the surface backend for the five basic drawing operations (paint, mask, stroke, fill, and show_glyphs). Now, all 5 operations have backend functions, and all use a consistent convention for argument naming and ordering. The old fill_path has been replaced with a new fill. The old show_glyphs function was recently renamed to old_show_glyphs and has not yet been ported to the new show_glyphs, (so all backends have a NULL show_glyphs function). In fact, of the 5 new backend functions, fill is the only one that has an implementation in any backend. As part of this cleanup a new cairo_stroke_style_t object is introduced to capture the many settings unique to the stroke operation, (line_width, line_cap, line_join, miter_limit, dash, num_dashes, and dash_offset).
Track changes in surface backend from fill_path to fill.
Track the new canonical argument naming and ordering for the 5 drawing operations.
Move various stroke style settings into new cairo_stroke_style_t.
Drop NULL fill_path backend function which no longer exists.
2005-11-04 11:16:38 +00:00
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
double tolerance,
|
2008-10-01 20:50:53 +09:30
|
|
|
cairo_antialias_t antialias,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2005-11-01 16:40:37 +00:00
|
|
|
|
2008-06-26 16:15:12 -04:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_surface_show_text_glyphs (cairo_surface_t *surface,
|
|
|
|
|
cairo_operator_t op,
|
2008-10-22 19:24:44 +01:00
|
|
|
const cairo_pattern_t *source,
|
2008-06-26 16:15:12 -04:00
|
|
|
const char *utf8,
|
|
|
|
|
int utf8_len,
|
|
|
|
|
cairo_glyph_t *glyphs,
|
|
|
|
|
int num_glyphs,
|
|
|
|
|
const cairo_text_cluster_t *clusters,
|
|
|
|
|
int num_clusters,
|
2008-09-18 00:26:07 -04:00
|
|
|
cairo_text_cluster_flags_t cluster_flags,
|
2008-10-01 20:50:53 +09:30
|
|
|
cairo_scaled_font_t *scaled_font,
|
2011-07-14 21:19:54 +01:00
|
|
|
const cairo_clip_t *clip);
|
2008-06-26 16:15:12 -04:00
|
|
|
|
2016-10-01 17:14:28 +09:30
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_surface_tag (cairo_surface_t *surface,
|
|
|
|
|
cairo_bool_t begin,
|
|
|
|
|
const char *tag_name,
|
|
|
|
|
const char *attributes,
|
|
|
|
|
const cairo_pattern_t *source,
|
|
|
|
|
const cairo_stroke_style_t *stroke_style,
|
|
|
|
|
const cairo_matrix_t *ctm,
|
|
|
|
|
const cairo_matrix_t *ctm_inverse,
|
|
|
|
|
const cairo_clip_t *clip);
|
|
|
|
|
|
2005-01-31 08:50:22 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-02-24 07:39:20 +00:00
|
|
|
_cairo_surface_acquire_source_image (cairo_surface_t *surface,
|
2005-01-31 08:50:22 +00:00
|
|
|
cairo_image_surface_t **image_out,
|
|
|
|
|
void **image_extra);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_surface_release_source_image (cairo_surface_t *surface,
|
|
|
|
|
cairo_image_surface_t *image,
|
|
|
|
|
void *image_extra);
|
|
|
|
|
|
2005-10-13 21:00:52 +00:00
|
|
|
cairo_private cairo_surface_t *
|
|
|
|
|
_cairo_surface_snapshot (cairo_surface_t *surface);
|
|
|
|
|
|
2010-04-29 15:19:18 +01:00
|
|
|
cairo_private void
|
2009-05-26 21:07:07 +01:00
|
|
|
_cairo_surface_attach_snapshot (cairo_surface_t *surface,
|
|
|
|
|
cairo_surface_t *snapshot,
|
|
|
|
|
cairo_surface_func_t detach_func);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_surface_t *
|
|
|
|
|
_cairo_surface_has_snapshot (cairo_surface_t *surface,
|
2010-01-18 19:12:25 +00:00
|
|
|
const cairo_surface_backend_t *backend);
|
2009-05-26 21:07:07 +01:00
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_surface_detach_snapshot (cairo_surface_t *snapshot);
|
|
|
|
|
|
2012-08-13 01:34:12 +01:00
|
|
|
cairo_private cairo_status_t
|
2011-12-05 22:48:56 +01:00
|
|
|
_cairo_surface_begin_modification (cairo_surface_t *surface);
|
|
|
|
|
|
2011-08-04 00:19:42 +01:00
|
|
|
cairo_private_no_warn cairo_bool_t
|
2006-05-04 03:43:34 -07:00
|
|
|
_cairo_surface_get_extents (cairo_surface_t *surface,
|
2008-05-09 14:46:22 +02:00
|
|
|
cairo_rectangle_int_t *extents);
|
2004-04-06 09:36:12 +00:00
|
|
|
|
2006-05-04 01:45:41 -07:00
|
|
|
cairo_private cairo_bool_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure;
|
2006-05-04 01:45:41 -07:00
|
|
|
|
2010-05-18 12:02:54 +02:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_surface_release_device_reference (cairo_surface_t *surface);
|
|
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-image-surface.c */
|
2003-10-31 10:41:37 +00:00
|
|
|
|
2008-01-28 20:48:48 -05:00
|
|
|
/* XXX: In cairo 1.2.0 we added a new %CAIRO_FORMAT_RGB16_565 but
|
2006-08-04 16:06:59 -07:00
|
|
|
* neglected to adjust this macro. The net effect is that it's
|
|
|
|
|
* impossible to externally create an image surface with this
|
|
|
|
|
* format. This is perhaps a good thing since we also neglected to fix
|
2008-01-28 21:49:57 -05:00
|
|
|
* up things like cairo_surface_write_to_png() for the new format
|
2006-08-04 16:06:59 -07:00
|
|
|
* (-Wswitch-enum will tell you where). Is it obvious that format was
|
|
|
|
|
* added in haste?
|
|
|
|
|
*
|
|
|
|
|
* The reason for the new format was to allow the xlib backend to be
|
|
|
|
|
* used on X servers with a 565 visual. So the new format did its job
|
|
|
|
|
* for that, even without being considered "valid" for the sake of
|
2008-01-28 21:49:57 -05:00
|
|
|
* things like cairo_image_surface_create().
|
2006-08-04 16:06:59 -07:00
|
|
|
*
|
2017-11-09 09:43:02 -05:00
|
|
|
* Since 1.2.0 we ran into the same situation with X servers with BGR
|
2008-01-28 20:49:44 -05:00
|
|
|
* visuals. This time we invented #cairo_internal_format_t instead,
|
2006-08-04 16:06:59 -07:00
|
|
|
* (see it for more discussion).
|
|
|
|
|
*
|
2018-10-20 14:11:30 -04:00
|
|
|
* The punchline is that %CAIRO_FORMAT_VALID must not consider any
|
2006-08-04 16:06:59 -07:00
|
|
|
* internal format to be valid. Also we need to decide if the
|
|
|
|
|
* RGB16_565 should be moved to instead be an internal format. If so,
|
|
|
|
|
* this macro need not change for it. (We probably will need to leave
|
|
|
|
|
* an RGB16_565 value in the header files for the sake of code that
|
|
|
|
|
* might have that value in it.)
|
|
|
|
|
*
|
|
|
|
|
* If we do decide to start fully supporting RGB16_565 as an external
|
2008-01-28 20:48:48 -05:00
|
|
|
* format, then %CAIRO_FORMAT_VALID needs to be adjusted to include
|
2006-08-04 16:06:59 -07:00
|
|
|
* it. But that should not happen before all necessary code is fixed
|
2008-01-28 21:49:57 -05:00
|
|
|
* to support it (at least cairo_surface_write_to_png() and a few spots
|
2006-08-04 16:06:59 -07:00
|
|
|
* in cairo-xlib-surface.c--again see -Wswitch-enum).
|
|
|
|
|
*/
|
2010-02-28 23:31:06 +02:00
|
|
|
#define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \
|
2011-04-20 10:34:05 -07:00
|
|
|
(format) <= CAIRO_FORMAT_RGB30)
|
2005-08-23 13:57:00 +00:00
|
|
|
|
2008-03-14 16:51:24 +01:00
|
|
|
/* pixman-required stride alignment in bytes. */
|
|
|
|
|
#define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
|
|
|
|
|
#define CAIRO_STRIDE_FOR_WIDTH_BPP(w,bpp) \
|
2008-12-17 17:32:07 +00:00
|
|
|
((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
|
2008-03-14 16:51:24 +01:00
|
|
|
|
2005-08-23 13:57:00 +00:00
|
|
|
#define CAIRO_CONTENT_VALID(content) ((content) && \
|
|
|
|
|
(((content) & ~(CAIRO_CONTENT_COLOR | \
|
|
|
|
|
CAIRO_CONTENT_ALPHA | \
|
|
|
|
|
CAIRO_CONTENT_COLOR_ALPHA))\
|
|
|
|
|
== 0))
|
|
|
|
|
|
2008-01-26 16:42:26 -08:00
|
|
|
cairo_private int
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_format_bits_per_pixel (cairo_format_t format) cairo_const;
|
2008-01-14 16:14:02 -05:00
|
|
|
|
2005-07-08 10:12:28 +00:00
|
|
|
cairo_private cairo_format_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_format_from_content (cairo_content_t content) cairo_const;
|
2005-07-08 10:12:28 +00:00
|
|
|
|
2010-01-22 17:57:41 +00:00
|
|
|
cairo_private cairo_format_t
|
|
|
|
|
_cairo_format_from_pixman_format (pixman_format_code_t pixman_format);
|
|
|
|
|
|
2005-07-08 10:12:28 +00:00
|
|
|
cairo_private cairo_content_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_content_from_format (cairo_format_t format) cairo_const;
|
2005-07-08 10:12:28 +00:00
|
|
|
|
2010-01-22 17:57:41 +00:00
|
|
|
cairo_private cairo_content_t
|
|
|
|
|
_cairo_content_from_pixman_format (pixman_format_code_t pixman_format);
|
|
|
|
|
|
2006-02-24 00:04:05 +01:00
|
|
|
cairo_private cairo_surface_t *
|
2007-08-17 08:15:50 -07:00
|
|
|
_cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image,
|
|
|
|
|
pixman_format_code_t pixman_format);
|
2006-01-04 17:59:03 +00:00
|
|
|
|
2010-05-16 10:11:02 +01:00
|
|
|
cairo_private pixman_format_code_t
|
2010-03-26 19:37:08 +00:00
|
|
|
_cairo_format_to_pixman_format_code (cairo_format_t format);
|
|
|
|
|
|
2008-10-15 10:21:05 +01:00
|
|
|
cairo_private cairo_bool_t
|
2008-01-27 10:31:58 -08:00
|
|
|
_pixman_format_from_masks (cairo_format_masks_t *masks,
|
|
|
|
|
pixman_format_code_t *format_ret);
|
2007-08-17 10:29:37 -07:00
|
|
|
|
2009-09-24 22:57:39 +02:00
|
|
|
cairo_private cairo_bool_t
|
2007-08-17 10:29:37 -07:00
|
|
|
_pixman_format_to_masks (pixman_format_code_t pixman_format,
|
2008-03-14 16:48:41 +01:00
|
|
|
cairo_format_masks_t *masks);
|
2007-08-17 10:29:37 -07:00
|
|
|
|
2012-04-30 09:41:44 -04:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_image_scaled_glyph_fini (cairo_scaled_font_t *scaled_font,
|
|
|
|
|
cairo_scaled_glyph_t *scaled_glyph);
|
|
|
|
|
|
2010-08-26 11:15:46 +02:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_image_reset_static_data (void);
|
|
|
|
|
|
2018-01-13 11:34:19 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_image_compositor_reset_static_data (void);
|
|
|
|
|
|
2007-08-17 10:29:37 -07:00
|
|
|
cairo_private cairo_surface_t *
|
|
|
|
|
_cairo_image_surface_create_with_pixman_format (unsigned char *data,
|
|
|
|
|
pixman_format_code_t pixman_format,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int stride);
|
|
|
|
|
|
Big change to the test infrastructure and supporting internals. The goal now is to test both a COLOR_ALPHA and a COLOR content for each surface backend, (since the semantics are different and we probably need to support both in each backend.
The PS/PDF backends don't allow a content to be passed in right now, so they fail against the rgb24 tests, but the trivial addition to the constructors will allow them to pass all tests with both content values.
And new constructors (currently internal only) to create an image surface with a cairo_content_t rather than a cairo_format_t.
Add a cairo_content_t argument to the constructor.
Add a cairo_content_t to the constructor and use this content value when constructing intermediate image surfaces in acquire_source, show_page, copy_page, and snapshot.
Add image flattening by compositing over white, as is done in cairo-ps-surface.c.
Track changes to cairo-paginates-surface which now requires a cairo_content_t value (no change to public PS/PDF constructors yet).
Track change in meta-surface and paginated-surface interfaces by now accepting a cairo_content_t rather than a cairo_format_t.
Ignore new output files (argb32 from pdf and ps as well as rgb24 from test-fallback, test-meta, and test-paginated).
Add new utility for flattening PNG images in order to generate the -argbf-ref.png images.
Add image_diff_flattened for comparing flattened output from PS and PDF backend with ARGB reference images by first blending the reference images over white.
Get rid of conditional, format-specific background-color initialization before running tests. Now uses ARGB(0,0,0,0) in all cases. Switch from specifying tests with a format value to specifying tests with a content value. Add support for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and PDF output against a flattened version of the argb32 reference images (first blended over white).
Track change in cairo_ps_surface_create (now requires cairo_content_t value).
Adjust tests that draw in default (black) to first paint white so that the results are visible.
Adjust ARGB32 reference images for new white background for changed tests.
Adjust RGB24 reference images for new black background due to changed initialization (and the tests themselves being unchanged).
2006-01-17 16:59:08 +00:00
|
|
|
cairo_private cairo_surface_t *
|
|
|
|
|
_cairo_image_surface_create_with_content (cairo_content_t content,
|
|
|
|
|
int width,
|
|
|
|
|
int height);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2003-10-31 10:41:37 +00:00
|
|
|
_cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface);
|
2003-07-30 08:30:50 +00:00
|
|
|
|
2006-09-05 16:48:49 -07:00
|
|
|
cairo_private cairo_image_surface_t *
|
2010-02-23 21:01:13 +01:00
|
|
|
_cairo_image_surface_coerce (cairo_image_surface_t *surface);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_image_surface_t *
|
|
|
|
|
_cairo_image_surface_coerce_to_format (cairo_image_surface_t *surface,
|
|
|
|
|
cairo_format_t format);
|
|
|
|
|
|
2008-03-12 17:54:54 +00:00
|
|
|
cairo_private cairo_image_transparency_t
|
2008-02-16 22:13:43 +10:30
|
|
|
_cairo_image_analyze_transparency (cairo_image_surface_t *image);
|
|
|
|
|
|
2011-08-02 23:10:17 +09:30
|
|
|
cairo_private cairo_image_color_t
|
|
|
|
|
_cairo_image_analyze_color (cairo_image_surface_t *image);
|
|
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-pen.c */
|
2012-08-25 08:39:30 +01:00
|
|
|
cairo_private int
|
|
|
|
|
_cairo_pen_vertices_needed (double tolerance,
|
|
|
|
|
double radius,
|
|
|
|
|
const cairo_matrix_t *matrix);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2005-10-31 16:55:21 +00:00
|
|
|
_cairo_pen_init (cairo_pen_t *pen,
|
|
|
|
|
double radius,
|
|
|
|
|
double tolerance,
|
2008-11-30 13:49:24 +00:00
|
|
|
const cairo_matrix_t *ctm);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2007-04-09 17:12:11 -07:00
|
|
|
cairo_private void
|
2003-07-18 11:34:19 +00:00
|
|
|
_cairo_pen_init_empty (cairo_pen_t *pen);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-11-14 17:18:47 +00:00
|
|
|
_cairo_pen_init_copy (cairo_pen_t *pen, const cairo_pen_t *other);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2003-07-18 11:34:19 +00:00
|
|
|
_cairo_pen_fini (cairo_pen_t *pen);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private cairo_status_t
|
2003-10-04 09:06:15 +00:00
|
|
|
_cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-11-14 17:18:47 +00:00
|
|
|
cairo_private int
|
|
|
|
|
_cairo_pen_find_active_cw_vertex_index (const cairo_pen_t *pen,
|
|
|
|
|
const cairo_slope_t *slope);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-11-14 17:18:47 +00:00
|
|
|
cairo_private int
|
|
|
|
|
_cairo_pen_find_active_ccw_vertex_index (const cairo_pen_t *pen,
|
|
|
|
|
const cairo_slope_t *slope);
|
|
|
|
|
|
2012-08-25 23:29:21 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_pen_find_active_cw_vertices (const cairo_pen_t *pen,
|
|
|
|
|
const cairo_slope_t *in,
|
|
|
|
|
const cairo_slope_t *out,
|
|
|
|
|
int *start, int *stop);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_pen_find_active_ccw_vertices (const cairo_pen_t *pen,
|
|
|
|
|
const cairo_slope_t *in,
|
|
|
|
|
const cairo_slope_t *out,
|
|
|
|
|
int *start, int *stop);
|
|
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-polygon.c */
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2010-12-09 22:00:15 +01:00
|
|
|
_cairo_polygon_init (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_box_t *boxes,
|
|
|
|
|
int num_boxes);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_polygon_init_with_clip (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_clip_t *clip);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_polygon_init_boxes (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_boxes_t *boxes);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_polygon_init_box_array (cairo_polygon_t *polygon,
|
|
|
|
|
cairo_box_t *boxes,
|
|
|
|
|
int num_boxes);
|
|
|
|
|
|
2011-10-12 17:04:16 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_polygon_limit (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_box_t *limits,
|
|
|
|
|
int num_limits);
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_polygon_limit_to_clip (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_clip_t *clip);
|
|
|
|
|
|
2008-11-14 17:18:47 +00:00
|
|
|
cairo_private void
|
2008-12-17 09:32:16 +00:00
|
|
|
_cairo_polygon_fini (cairo_polygon_t *polygon);
|
|
|
|
|
|
2014-05-19 14:59:29 +05:30
|
|
|
cairo_private_no_warn cairo_status_t
|
2009-08-28 10:05:52 +01:00
|
|
|
_cairo_polygon_add_line (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_line_t *line,
|
|
|
|
|
int top, int bottom,
|
|
|
|
|
int dir);
|
|
|
|
|
|
2014-05-19 14:59:29 +05:30
|
|
|
cairo_private_no_warn cairo_status_t
|
2008-12-17 09:32:16 +00:00
|
|
|
_cairo_polygon_add_external_edge (void *polygon,
|
|
|
|
|
const cairo_point_t *p1,
|
|
|
|
|
const cairo_point_t *p2);
|
2008-11-14 17:18:47 +00:00
|
|
|
|
2014-05-19 14:59:29 +05:30
|
|
|
cairo_private_no_warn cairo_status_t
|
2011-08-15 09:44:03 +01:00
|
|
|
_cairo_polygon_add_contour (cairo_polygon_t *polygon,
|
|
|
|
|
const cairo_contour_t *contour);
|
|
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_polygon_translate (cairo_polygon_t *polygon, int dx, int dy);
|
|
|
|
|
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_polygon_reduce (cairo_polygon_t *polygon,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_polygon_intersect (cairo_polygon_t *a, int winding_a,
|
|
|
|
|
cairo_polygon_t *b, int winding_b);
|
|
|
|
|
|
2011-07-30 17:28:21 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_polygon_intersect_with_boxes (cairo_polygon_t *polygon,
|
|
|
|
|
cairo_fill_rule_t *winding,
|
|
|
|
|
cairo_box_t *boxes,
|
|
|
|
|
int num_boxes);
|
|
|
|
|
|
2011-07-24 13:05:55 +01:00
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_polygon_is_empty (const cairo_polygon_t *polygon)
|
|
|
|
|
{
|
|
|
|
|
return
|
|
|
|
|
polygon->num_edges == 0 ||
|
|
|
|
|
polygon->extents.p2.x <= polygon->extents.p1.x;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
#define _cairo_polygon_status(P) ((cairo_polygon_t *) (P))->status
|
2008-09-18 09:04:01 +01:00
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-spline.c */
|
2008-11-14 17:18:47 +00:00
|
|
|
cairo_private cairo_bool_t
|
2003-07-18 11:34:19 +00:00
|
|
|
_cairo_spline_init (cairo_spline_t *spline,
|
2008-12-09 20:15:34 +00:00
|
|
|
cairo_spline_add_point_func_t add_point_func,
|
2008-11-14 17:18:47 +00:00
|
|
|
void *closure,
|
|
|
|
|
const cairo_point_t *a, const cairo_point_t *b,
|
|
|
|
|
const cairo_point_t *c, const cairo_point_t *d);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-12-09 20:15:34 +00:00
|
|
|
cairo_private cairo_status_t
|
2003-07-18 11:34:19 +00:00
|
|
|
_cairo_spline_decompose (cairo_spline_t *spline, double tolerance);
|
|
|
|
|
|
2008-12-29 16:11:29 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-12-27 23:13:45 -05:00
|
|
|
_cairo_spline_bound (cairo_spline_add_point_func_t add_point_func,
|
|
|
|
|
void *closure,
|
|
|
|
|
const cairo_point_t *p0, const cairo_point_t *p1,
|
|
|
|
|
const cairo_point_t *p2, const cairo_point_t *p3);
|
|
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-matrix.c */
|
2005-05-06 13:32:53 +00:00
|
|
|
cairo_private void
|
2005-05-09 09:12:52 +00:00
|
|
|
_cairo_matrix_get_affine (const cairo_matrix_t *matrix,
|
2005-05-06 13:32:53 +00:00
|
|
|
double *xx, double *yx,
|
|
|
|
|
double *xy, double *yy,
|
|
|
|
|
double *x0, double *y0);
|
|
|
|
|
|
2004-12-21 13:22:44 +00:00
|
|
|
cairo_private void
|
2005-05-09 09:12:52 +00:00
|
|
|
_cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix,
|
2006-11-07 01:42:21 -08:00
|
|
|
double *x1, double *y1,
|
|
|
|
|
double *x2, double *y2,
|
2006-09-25 23:14:43 -07:00
|
|
|
cairo_bool_t *is_tight);
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-05-09 13:17:30 +02:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_matrix_transform_bounding_box_fixed (const cairo_matrix_t *matrix,
|
|
|
|
|
cairo_box_t *bbox,
|
|
|
|
|
cairo_bool_t *is_tight);
|
|
|
|
|
|
2007-10-04 15:58:21 +01:00
|
|
|
cairo_private cairo_bool_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_matrix_is_invertible (const cairo_matrix_t *matrix) cairo_pure;
|
2007-10-04 15:58:21 +01:00
|
|
|
|
2010-06-29 09:58:54 +02:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_matrix_is_scale_0 (const cairo_matrix_t *matrix) cairo_pure;
|
|
|
|
|
|
2008-08-08 09:11:10 +01:00
|
|
|
cairo_private double
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_matrix_compute_determinant (const cairo_matrix_t *matrix) cairo_pure;
|
2003-07-18 11:34:19 +00:00
|
|
|
|
2008-01-29 08:41:21 -08:00
|
|
|
cairo_private cairo_status_t
|
2008-08-27 20:08:49 -04:00
|
|
|
_cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t *matrix,
|
2008-11-30 13:49:24 +00:00
|
|
|
double *sx, double *sy, int x_major);
|
2003-12-15 18:26:51 +00:00
|
|
|
|
2012-03-19 19:42:01 +00:00
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_matrix_is_identity (const cairo_matrix_t *matrix)
|
|
|
|
|
{
|
|
|
|
|
return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
|
|
|
|
|
matrix->xy == 0.0 && matrix->yy == 1.0 &&
|
|
|
|
|
matrix->x0 == 0.0 && matrix->y0 == 0.0);
|
|
|
|
|
}
|
2006-06-10 00:12:51 -07:00
|
|
|
|
2012-03-19 19:42:01 +00:00
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_matrix_is_translation (const cairo_matrix_t *matrix)
|
|
|
|
|
{
|
|
|
|
|
return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
|
|
|
|
|
matrix->xy == 0.0 && matrix->yy == 1.0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline cairo_bool_t
|
|
|
|
|
_cairo_matrix_is_scale (const cairo_matrix_t *matrix)
|
|
|
|
|
{
|
|
|
|
|
return matrix->yx == 0.0 && matrix->xy == 0.0;
|
|
|
|
|
}
|
2006-11-20 10:42:50 -08:00
|
|
|
|
2005-02-25 13:31:00 +00:00
|
|
|
cairo_private cairo_bool_t
|
2005-05-09 09:12:52 +00:00
|
|
|
_cairo_matrix_is_integer_translation(const cairo_matrix_t *matrix,
|
|
|
|
|
int *itx, int *ity);
|
2004-05-20 16:42:56 +00:00
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_matrix_has_unity_scale (const cairo_matrix_t *matrix);
|
|
|
|
|
|
2008-09-29 00:53:59 +01:00
|
|
|
cairo_private cairo_bool_t
|
2009-05-27 15:59:16 +01:00
|
|
|
_cairo_matrix_is_pixel_exact (const cairo_matrix_t *matrix) cairo_pure;
|
2008-09-29 00:53:59 +01:00
|
|
|
|
2005-08-22 16:48:28 +00:00
|
|
|
cairo_private double
|
2008-11-30 13:49:24 +00:00
|
|
|
_cairo_matrix_transformed_circle_major_axis (const cairo_matrix_t *matrix,
|
2009-05-27 15:59:16 +01:00
|
|
|
double radius) cairo_pure;
|
2005-08-22 16:48:28 +00:00
|
|
|
|
2010-12-17 11:04:41 +01:00
|
|
|
cairo_private cairo_bool_t
|
|
|
|
|
_cairo_matrix_is_pixman_translation (const cairo_matrix_t *matrix,
|
|
|
|
|
cairo_filter_t filter,
|
|
|
|
|
int *out_x_offset,
|
|
|
|
|
int *out_y_offset);
|
|
|
|
|
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_matrix_to_pixman_matrix_offset (const cairo_matrix_t *matrix,
|
|
|
|
|
cairo_filter_t filter,
|
|
|
|
|
double xc,
|
|
|
|
|
double yc,
|
|
|
|
|
pixman_transform_t *out_transform,
|
|
|
|
|
int *out_x_offset,
|
|
|
|
|
int *out_y_offset);
|
2006-01-04 17:59:03 +00:00
|
|
|
|
2016-06-04 14:43:43 +09:30
|
|
|
cairo_private void
|
|
|
|
|
_cairo_debug_print_matrix (FILE *file, const cairo_matrix_t *matrix);
|
|
|
|
|
|
2016-06-04 14:43:43 +09:30
|
|
|
cairo_private void
|
|
|
|
|
_cairo_debug_print_rect (FILE *file, const cairo_rectangle_int_t *rect);
|
|
|
|
|
|
2009-08-25 20:51:06 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_bentley_ottmann_tessellate_rectilinear_polygon (cairo_traps_t *traps,
|
|
|
|
|
const cairo_polygon_t *polygon,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
|
|
|
|
|
2006-11-22 18:42:48 -08:00
|
|
|
cairo_private cairo_status_t
|
2008-05-09 13:16:13 +02:00
|
|
|
_cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps,
|
|
|
|
|
const cairo_polygon_t *polygon,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
2006-09-20 10:47:58 -07:00
|
|
|
|
2008-12-17 09:32:16 +00:00
|
|
|
cairo_private cairo_status_t
|
2009-08-25 20:51:06 +01:00
|
|
|
_cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
|
|
|
|
|
2009-08-28 10:06:04 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
|
|
|
|
|
2010-01-19 19:09:10 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
cairo_boxes_t *out);
|
|
|
|
|
|
2009-08-25 20:51:06 +01:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_bentley_ottmann_tessellate_rectilinear_traps (cairo_traps_t *traps,
|
|
|
|
|
cairo_fill_rule_t fill_rule);
|
2008-12-17 09:32:16 +00:00
|
|
|
|
2010-01-19 19:11:31 +00:00
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_bentley_ottmann_tessellate_rectilinear_polygon_to_boxes (const cairo_polygon_t *polygon,
|
|
|
|
|
cairo_fill_rule_t fill_rule,
|
|
|
|
|
cairo_boxes_t *boxes);
|
|
|
|
|
|
2006-05-04 01:45:41 -07:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_trapezoid_array_translate_and_scale (cairo_trapezoid_t *offset_traps,
|
|
|
|
|
cairo_trapezoid_t *src_traps,
|
|
|
|
|
int num_traps,
|
|
|
|
|
double tx, double ty,
|
|
|
|
|
double sx, double sy);
|
|
|
|
|
|
2009-06-11 15:18:55 +01:00
|
|
|
#if CAIRO_HAS_DRM_SURFACE
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_drm_device_reset_static_data (void);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-04-03 09:23:58 +01:00
|
|
|
cairo_private void
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
_cairo_clip_reset_static_data (void);
|
2009-04-03 09:23:58 +01:00
|
|
|
|
2011-07-14 18:35:32 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_pattern_reset_static_data (void);
|
|
|
|
|
|
2008-06-01 19:14:13 -04:00
|
|
|
/* cairo-unicode.c */
|
2005-02-01 15:06:33 +00:00
|
|
|
|
2008-08-07 20:45:54 -04:00
|
|
|
cairo_private int
|
|
|
|
|
_cairo_utf8_get_char_validated (const char *p,
|
|
|
|
|
uint32_t *unicode);
|
|
|
|
|
|
2005-02-01 15:06:33 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-05-28 16:48:13 -04:00
|
|
|
_cairo_utf8_to_ucs4 (const char *str,
|
|
|
|
|
int len,
|
|
|
|
|
uint32_t **result,
|
|
|
|
|
int *items_written);
|
2005-02-01 15:06:33 +00:00
|
|
|
|
2008-06-29 19:32:19 +09:30
|
|
|
cairo_private int
|
|
|
|
|
_cairo_ucs4_to_utf8 (uint32_t unicode,
|
|
|
|
|
char *utf8);
|
|
|
|
|
|
2017-03-18 08:55:11 +01:00
|
|
|
cairo_private int
|
|
|
|
|
_cairo_ucs4_to_utf16 (uint32_t unicode,
|
|
|
|
|
uint16_t *utf16);
|
|
|
|
|
|
2008-09-24 15:01:06 -04:00
|
|
|
#if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS
|
2007-12-20 12:30:35 -05:00
|
|
|
# define CAIRO_HAS_UTF8_TO_UTF16 1
|
|
|
|
|
#endif
|
|
|
|
|
#if CAIRO_HAS_UTF8_TO_UTF16
|
2005-02-01 15:06:33 +00:00
|
|
|
cairo_private cairo_status_t
|
2008-05-28 16:48:13 -04:00
|
|
|
_cairo_utf8_to_utf16 (const char *str,
|
|
|
|
|
int len,
|
|
|
|
|
uint16_t **result,
|
|
|
|
|
int *items_written);
|
2007-12-20 12:30:35 -05:00
|
|
|
#endif
|
2005-02-01 15:06:33 +00:00
|
|
|
|
2012-02-28 18:11:22 +00:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_matrix_multiply (cairo_matrix_t *r,
|
|
|
|
|
const cairo_matrix_t *a,
|
|
|
|
|
const cairo_matrix_t *b);
|
|
|
|
|
|
2010-06-11 16:04:41 +01:00
|
|
|
/* cairo-observer.c */
|
|
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_observers_notify (cairo_list_t *observers, void *arg);
|
|
|
|
|
|
2017-11-02 16:55:22 +00:00
|
|
|
/* Open a file with a UTF-8 filename */
|
|
|
|
|
cairo_private cairo_status_t
|
|
|
|
|
_cairo_fopen (const char *filename, const char *mode, FILE **file_out);
|
|
|
|
|
|
2003-07-31 22:41:44 +00:00
|
|
|
/* Avoid unnecessary PLT entries. */
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_clip_preserve);
|
|
|
|
|
slim_hidden_proto (cairo_close_path);
|
|
|
|
|
slim_hidden_proto (cairo_create);
|
|
|
|
|
slim_hidden_proto (cairo_curve_to);
|
|
|
|
|
slim_hidden_proto (cairo_destroy);
|
|
|
|
|
slim_hidden_proto (cairo_fill_preserve);
|
|
|
|
|
slim_hidden_proto (cairo_font_face_destroy);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_font_face_get_user_data);
|
2007-04-10 21:09:36 +01:00
|
|
|
slim_hidden_proto_no_warn (cairo_font_face_reference);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_font_face_set_user_data);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_font_options_equal);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_hash);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_merge);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_set_antialias);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_set_hint_metrics);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_set_hint_style);
|
|
|
|
|
slim_hidden_proto (cairo_font_options_set_subpixel_order);
|
2007-05-08 17:26:22 +01:00
|
|
|
slim_hidden_proto (cairo_font_options_status);
|
2008-11-13 11:21:26 +00:00
|
|
|
slim_hidden_proto (cairo_format_stride_for_width);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_get_current_point);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_get_line_width);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_get_matrix);
|
2010-04-23 19:45:26 +01:00
|
|
|
slim_hidden_proto (cairo_get_scaled_font);
|
2008-08-08 00:56:36 -04:00
|
|
|
slim_hidden_proto (cairo_get_target);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_get_tolerance);
|
2008-08-08 00:56:36 -04:00
|
|
|
slim_hidden_proto (cairo_glyph_allocate);
|
|
|
|
|
slim_hidden_proto (cairo_glyph_free);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_image_surface_create);
|
|
|
|
|
slim_hidden_proto (cairo_image_surface_create_for_data);
|
2008-03-20 15:55:28 -07:00
|
|
|
slim_hidden_proto (cairo_image_surface_get_data);
|
2009-06-11 15:18:55 +01:00
|
|
|
slim_hidden_proto (cairo_image_surface_get_format);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_image_surface_get_height);
|
2008-03-20 15:55:28 -07:00
|
|
|
slim_hidden_proto (cairo_image_surface_get_stride);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_image_surface_get_width);
|
|
|
|
|
slim_hidden_proto (cairo_line_to);
|
|
|
|
|
slim_hidden_proto (cairo_mask);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_init);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_init_identity);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_init_rotate);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_init_scale);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_init_translate);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_invert);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_multiply);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_scale);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_transform_distance);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_transform_point);
|
|
|
|
|
slim_hidden_proto (cairo_matrix_translate);
|
|
|
|
|
slim_hidden_proto (cairo_move_to);
|
|
|
|
|
slim_hidden_proto (cairo_new_path);
|
|
|
|
|
slim_hidden_proto (cairo_paint);
|
2011-07-06 15:14:55 +02:00
|
|
|
slim_hidden_proto (cairo_pattern_add_color_stop_rgba);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_pattern_create_for_surface);
|
|
|
|
|
slim_hidden_proto (cairo_pattern_create_rgb);
|
|
|
|
|
slim_hidden_proto (cairo_pattern_create_rgba);
|
|
|
|
|
slim_hidden_proto (cairo_pattern_destroy);
|
|
|
|
|
slim_hidden_proto (cairo_pattern_get_extend);
|
2011-02-03 22:55:53 +01:00
|
|
|
slim_hidden_proto (cairo_mesh_pattern_curve_to);
|
2011-02-12 14:51:30 +01:00
|
|
|
slim_hidden_proto (cairo_mesh_pattern_get_control_point);
|
|
|
|
|
slim_hidden_proto (cairo_mesh_pattern_get_corner_color_rgba);
|
|
|
|
|
slim_hidden_proto (cairo_mesh_pattern_get_patch_count);
|
|
|
|
|
slim_hidden_proto (cairo_mesh_pattern_get_path);
|
2011-02-03 22:55:53 +01:00
|
|
|
slim_hidden_proto (cairo_mesh_pattern_line_to);
|
|
|
|
|
slim_hidden_proto (cairo_mesh_pattern_move_to);
|
|
|
|
|
slim_hidden_proto (cairo_mesh_pattern_set_corner_color_rgba);
|
2007-04-10 21:09:36 +01:00
|
|
|
slim_hidden_proto_no_warn (cairo_pattern_reference);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_pattern_set_matrix);
|
|
|
|
|
slim_hidden_proto (cairo_pop_group);
|
|
|
|
|
slim_hidden_proto (cairo_push_group_with_content);
|
2011-02-12 14:51:30 +01:00
|
|
|
slim_hidden_proto_no_warn (cairo_path_destroy);
|
2013-01-03 13:46:20 +00:00
|
|
|
slim_hidden_proto (cairo_recording_surface_create);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_rel_line_to);
|
|
|
|
|
slim_hidden_proto (cairo_restore);
|
|
|
|
|
slim_hidden_proto (cairo_save);
|
2007-02-27 20:18:16 -05:00
|
|
|
slim_hidden_proto (cairo_scale);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_scaled_font_create);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_destroy);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_extents);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_get_ctm);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_get_font_face);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_get_font_matrix);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_get_font_options);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_glyph_extents);
|
2007-04-10 21:09:36 +01:00
|
|
|
slim_hidden_proto_no_warn (cairo_scaled_font_reference);
|
2007-04-11 09:51:58 +01:00
|
|
|
slim_hidden_proto (cairo_scaled_font_status);
|
2008-12-29 12:54:13 +00:00
|
|
|
slim_hidden_proto (cairo_scaled_font_get_user_data);
|
|
|
|
|
slim_hidden_proto (cairo_scaled_font_set_user_data);
|
2008-11-13 11:21:26 +00:00
|
|
|
slim_hidden_proto (cairo_scaled_font_text_to_glyphs);
|
2011-03-21 09:58:29 +01:00
|
|
|
slim_hidden_proto (cairo_set_font_matrix);
|
2008-05-15 17:19:53 -04:00
|
|
|
slim_hidden_proto (cairo_set_font_options);
|
2008-11-13 11:21:26 +00:00
|
|
|
slim_hidden_proto (cairo_set_font_size);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_set_line_cap);
|
|
|
|
|
slim_hidden_proto (cairo_set_line_join);
|
|
|
|
|
slim_hidden_proto (cairo_set_line_width);
|
2008-05-15 17:19:53 -04:00
|
|
|
slim_hidden_proto (cairo_set_matrix);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_set_operator);
|
|
|
|
|
slim_hidden_proto (cairo_set_source);
|
2009-06-02 18:47:07 +01:00
|
|
|
slim_hidden_proto (cairo_set_source_rgb);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_set_source_surface);
|
2008-11-18 10:49:27 +00:00
|
|
|
slim_hidden_proto (cairo_set_tolerance);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_status);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_stroke);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_stroke_preserve);
|
2008-11-13 11:21:26 +00:00
|
|
|
slim_hidden_proto (cairo_surface_copy_page);
|
2011-07-30 17:28:21 +01:00
|
|
|
slim_hidden_proto (cairo_surface_create_similar_image);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_destroy);
|
|
|
|
|
slim_hidden_proto (cairo_surface_finish);
|
2008-05-24 20:31:24 -04:00
|
|
|
slim_hidden_proto (cairo_surface_flush);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_get_device_offset);
|
2013-05-30 19:45:59 +02:00
|
|
|
slim_hidden_proto (cairo_surface_get_device_scale);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_get_font_options);
|
2008-11-03 11:01:22 +00:00
|
|
|
slim_hidden_proto (cairo_surface_get_mime_data);
|
2008-08-18 14:52:43 -04:00
|
|
|
slim_hidden_proto (cairo_surface_has_show_text_glyphs);
|
2010-01-15 13:44:04 +01:00
|
|
|
slim_hidden_proto (cairo_surface_mark_dirty);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_mark_dirty_rectangle);
|
2007-04-10 21:09:36 +01:00
|
|
|
slim_hidden_proto_no_warn (cairo_surface_reference);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_set_device_offset);
|
2013-05-30 19:45:59 +02:00
|
|
|
slim_hidden_proto (cairo_surface_set_device_scale);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_set_fallback_resolution);
|
2008-11-13 11:21:26 +00:00
|
|
|
slim_hidden_proto (cairo_surface_set_mime_data);
|
2007-09-11 13:30:35 -07:00
|
|
|
slim_hidden_proto (cairo_surface_show_page);
|
2006-09-05 16:52:34 -07:00
|
|
|
slim_hidden_proto (cairo_surface_status);
|
2012-01-18 22:13:10 +10:30
|
|
|
slim_hidden_proto (cairo_surface_supports_mime_type);
|
2008-08-08 00:56:36 -04:00
|
|
|
slim_hidden_proto (cairo_text_cluster_allocate);
|
|
|
|
|
slim_hidden_proto (cairo_text_cluster_free);
|
2008-08-06 21:37:36 -04:00
|
|
|
slim_hidden_proto (cairo_toy_font_face_create);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_toy_font_face_get_slant);
|
|
|
|
|
slim_hidden_proto (cairo_toy_font_face_get_weight);
|
2008-12-29 12:54:13 +00:00
|
|
|
slim_hidden_proto (cairo_translate);
|
|
|
|
|
slim_hidden_proto (cairo_transform);
|
2008-09-26 10:55:44 -04:00
|
|
|
slim_hidden_proto (cairo_user_font_face_create);
|
|
|
|
|
slim_hidden_proto (cairo_user_font_face_set_init_func);
|
|
|
|
|
slim_hidden_proto (cairo_user_font_face_set_render_glyph_func);
|
|
|
|
|
slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func);
|
2010-04-23 19:45:26 +01:00
|
|
|
slim_hidden_proto (cairo_device_to_user);
|
2008-12-29 12:54:13 +00:00
|
|
|
slim_hidden_proto (cairo_user_to_device);
|
|
|
|
|
slim_hidden_proto (cairo_user_to_device_distance);
|
2006-10-15 17:23:58 -07:00
|
|
|
slim_hidden_proto (cairo_version_string);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_create);
|
2009-02-21 08:13:25 -05:00
|
|
|
slim_hidden_proto (cairo_region_create_rectangle);
|
2009-05-26 17:53:37 -04:00
|
|
|
slim_hidden_proto (cairo_region_create_rectangles);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_copy);
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
slim_hidden_proto (cairo_region_reference);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_destroy);
|
Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)
In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.
Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:
ppc:
Speedups
========
image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup
▌
image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup
▎
image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup
▏
image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup
▏
Slowdowns
=========
image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown
▏
2009-07-23 15:32:13 +01:00
|
|
|
slim_hidden_proto (cairo_region_equal);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_status);
|
|
|
|
|
slim_hidden_proto (cairo_region_get_extents);
|
|
|
|
|
slim_hidden_proto (cairo_region_num_rectangles);
|
|
|
|
|
slim_hidden_proto (cairo_region_get_rectangle);
|
2009-03-31 05:47:44 -04:00
|
|
|
slim_hidden_proto (cairo_region_is_empty);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_contains_rectangle);
|
|
|
|
|
slim_hidden_proto (cairo_region_contains_point);
|
|
|
|
|
slim_hidden_proto (cairo_region_translate);
|
|
|
|
|
slim_hidden_proto (cairo_region_subtract);
|
2009-03-27 08:48:42 -04:00
|
|
|
slim_hidden_proto (cairo_region_subtract_rectangle);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_intersect);
|
2009-03-27 08:48:42 -04:00
|
|
|
slim_hidden_proto (cairo_region_intersect_rectangle);
|
2009-02-18 00:20:46 -05:00
|
|
|
slim_hidden_proto (cairo_region_union);
|
2009-02-21 08:13:25 -05:00
|
|
|
slim_hidden_proto (cairo_region_union_rectangle);
|
2010-07-06 17:27:18 +02:00
|
|
|
slim_hidden_proto (cairo_region_xor);
|
|
|
|
|
slim_hidden_proto (cairo_region_xor_rectangle);
|
2003-07-31 22:41:44 +00:00
|
|
|
|
2007-02-08 15:07:45 -08:00
|
|
|
#if CAIRO_HAS_PNG_FUNCTIONS
|
|
|
|
|
|
|
|
|
|
slim_hidden_proto (cairo_surface_write_to_png_stream);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-12-18 16:37:14 +00:00
|
|
|
CAIRO_END_DECLS
|
|
|
|
|
|
2007-08-22 02:58:37 -04:00
|
|
|
#include "cairo-mutex-private.h"
|
2008-01-20 02:54:16 -05:00
|
|
|
#include "cairo-fixed-private.h"
|
2007-08-22 02:58:37 -04:00
|
|
|
#include "cairo-wideint-private.h"
|
|
|
|
|
#include "cairo-malloc-private.h"
|
|
|
|
|
#include "cairo-hash-private.h"
|
|
|
|
|
|
2009-05-15 17:40:26 +01:00
|
|
|
#if HAVE_VALGRIND
|
2009-06-04 14:12:20 +01:00
|
|
|
#include <memcheck.h>
|
|
|
|
|
|
|
|
|
|
#define VG(x) x
|
2009-05-15 17:40:26 +01:00
|
|
|
|
|
|
|
|
cairo_private void
|
|
|
|
|
_cairo_debug_check_image_surface_is_defined (const cairo_surface_t *surface);
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2009-06-04 14:12:20 +01:00
|
|
|
#define VG(x)
|
2009-05-15 17:40:26 +01:00
|
|
|
#define _cairo_debug_check_image_surface_is_defined(X)
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-08-21 10:29:39 +01:00
|
|
|
cairo_private void
|
2016-06-04 14:43:43 +09:30
|
|
|
_cairo_debug_print_path (FILE *stream, const cairo_path_fixed_t *path);
|
2009-08-11 17:01:07 +01:00
|
|
|
|
2009-08-21 10:29:39 +01:00
|
|
|
cairo_private void
|
2011-07-14 21:19:54 +01:00
|
|
|
_cairo_debug_print_polygon (FILE *stream, cairo_polygon_t *polygon);
|
|
|
|
|
|
2011-10-09 19:53:56 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_debug_print_traps (FILE *file, const cairo_traps_t *traps);
|
|
|
|
|
|
2011-07-14 21:19:54 +01:00
|
|
|
cairo_private void
|
|
|
|
|
_cairo_debug_print_clip (FILE *stream, const cairo_clip_t *clip);
|
2009-08-24 08:04:12 +01:00
|
|
|
|
2012-02-12 11:25:07 +00:00
|
|
|
#if 0
|
2012-11-07 14:30:35 -08:00
|
|
|
#define TRACE(x) fprintf (stderr, "%s: ", __FILE__), fprintf x
|
2012-05-14 17:50:54 +01:00
|
|
|
#define TRACE_(x) x
|
2012-02-12 11:25:07 +00:00
|
|
|
#else
|
|
|
|
|
#define TRACE(x)
|
2012-05-14 17:50:54 +01:00
|
|
|
#define TRACE_(x)
|
2012-02-12 11:25:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
2003-07-18 11:34:19 +00:00
|
|
|
#endif
|