pixman: Branch 'master' - 10 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Nov 20 21:24:19 UTC 2019
demos/meson.build | 6
meson.build | 95 ++++++++++++---
pixman/meson.build | 8 +
pixman/pixman-compiler.h | 2
pixman/pixman-private.h | 3
pixman/pixman-version.h.in | 4
pixman/pixman.h | 274 +++++++++++++++++++++++++++++++++++++++++++++
test/meson.build | 7 -
test/solid-test.c | 1
9 files changed, 381 insertions(+), 19 deletions(-)
New commits:
commit 1dd3bc0a35035d96124f11b8fbb915c669489bb1
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 14:51:10 2019 +0800
demos: Define _USE_MATH_DEFINES on MSVC-style compilers
This is required for the use of M_PI.
diff --git a/demos/meson.build b/demos/meson.build
index 70f7c1f..3f9d306 100644
--- a/demos/meson.build
+++ b/demos/meson.build
@@ -18,6 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+extra_demo_cflags = []
+if cc.get_argument_syntax() == 'msvc'
+ extra_demo_cflags = ['-D_USE_MATH_DEFINES']
+endif
+
demos = [
'gradient-test',
'alpha-test',
@@ -51,6 +56,7 @@ if dep_gtk.found()
executable(
d,
[d + '.c', config_h, version_h],
+ c_args : extra_demo_cflags,
link_with : [libdemo, libtestutils],
dependencies : [dep_glib, dep_gtk, dep_openmp, idep_pixman],
)
commit 3bceb3a9d3d0d6ec5409f751feb69fd10ccdfb16
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 14:50:22 2019 +0800
test/solid-test.c: Include stdint.h
We need that to make sure we have UINT16_MAX.
diff --git a/test/solid-test.c b/test/solid-test.c
index c6ea397..b118d37 100644
--- a/test/solid-test.c
+++ b/test/solid-test.c
@@ -26,6 +26,7 @@
#include "utils.h"
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#define WIDTH 32
commit c608e9663ef69a992131da5db8fc153fd8723058
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 11:19:29 2019 +0800
pixman/meson.build: Define PIXMAN_API on MSVC-style compilers
This will make the public APIs exported from the DLL, so that we have an
import libary that we can use.
diff --git a/pixman/meson.build b/pixman/meson.build
index 31be9d2..f48357f 100644
--- a/pixman/meson.build
+++ b/pixman/meson.build
@@ -30,6 +30,11 @@ version_h = configure_file(
install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'pixman-1')
)
+libpixman_extra_cargs = []
+if cc.has_function_attribute('dllexport')
+ libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)']
+endif
+
pixman_simd_libs = []
simds = [
# the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on
@@ -107,7 +112,8 @@ endforeach
libpixman = library(
'pixman-1',
[pixman_files, config_h, version_h],
- objects: _obs,
+ objects : _obs,
+ c_args : libpixman_extra_cargs,
dependencies : [dep_m, dep_threads],
version : meson.project_version(),
install : true,
commit 9d8dd17ada6ab7933d8f108a1e8605d2646c1791
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 14:48:03 2019 +0800
pixman-[compiler|private].h: Export symbols for tests
Define the existing PIXMAN_EXPORT to be PIXMAN_API, which can overriden
to be __declspec(dllexport) during the build of the pixman DLL on MSVC
builds, which will be in the next patch.
Also, export more private symbols as they are needed for the test
programs.
diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h
index 2489adc..dd0da7c 100644
--- a/pixman/pixman-compiler.h
+++ b/pixman/pixman-compiler.h
@@ -95,6 +95,8 @@
/* Sun Studio 8 visibility */
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define PIXMAN_EXPORT __global
+#elif defined (_MSC_VER)
+# define PIXMAN_EXPORT PIXMAN_API
#else
# define PIXMAN_EXPORT
#endif
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 41f430d..d836cc5 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -1106,16 +1106,19 @@ _pixman_log_error (const char *function, const char *message);
typedef struct { pixman_fixed_48_16_t v[3]; } pixman_vector_48_16_t;
+PIXMAN_EXPORT
pixman_bool_t
pixman_transform_point_31_16 (const pixman_transform_t *t,
const pixman_vector_48_16_t *v,
pixman_vector_48_16_t *result);
+PIXMAN_EXPORT
void
pixman_transform_point_31_16_3d (const pixman_transform_t *t,
const pixman_vector_48_16_t *v,
pixman_vector_48_16_t *result);
+PIXMAN_EXPORT
void
pixman_transform_point_31_16_affine (const pixman_transform_t *t,
const pixman_vector_48_16_t *v,
commit 21d8ded56640f4005c82f3cfef4eb9cbede6911e
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 11:09:51 2019 +0800
pixman/pixman.h: Mark public APIs with PIXMAN_API
We can override PIXMAN_API with a CFLAG or config.h define to export
the symbols with compiler directives, if needed.
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 8b38ba7..08303b5 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -184,42 +184,73 @@ struct pixman_transform
struct pixman_box16;
typedef union pixman_image pixman_image_t;
+PIXMAN_API
void pixman_transform_init_identity (struct pixman_transform *matrix);
+
+PIXMAN_API
pixman_bool_t pixman_transform_point_3d (const struct pixman_transform *transform,
struct pixman_vector *vector);
+
+PIXMAN_API
pixman_bool_t pixman_transform_point (const struct pixman_transform *transform,
struct pixman_vector *vector);
+
+PIXMAN_API
pixman_bool_t pixman_transform_multiply (struct pixman_transform *dst,
const struct pixman_transform *l,
const struct pixman_transform *r);
+
+PIXMAN_API
void pixman_transform_init_scale (struct pixman_transform *t,
pixman_fixed_t sx,
pixman_fixed_t sy);
+
+PIXMAN_API
pixman_bool_t pixman_transform_scale (struct pixman_transform *forward,
struct pixman_transform *reverse,
pixman_fixed_t sx,
pixman_fixed_t sy);
+
+PIXMAN_API
void pixman_transform_init_rotate (struct pixman_transform *t,
pixman_fixed_t cos,
pixman_fixed_t sin);
+
+PIXMAN_API
pixman_bool_t pixman_transform_rotate (struct pixman_transform *forward,
struct pixman_transform *reverse,
pixman_fixed_t c,
pixman_fixed_t s);
+
+PIXMAN_API
void pixman_transform_init_translate (struct pixman_transform *t,
pixman_fixed_t tx,
pixman_fixed_t ty);
+
+PIXMAN_API
pixman_bool_t pixman_transform_translate (struct pixman_transform *forward,
struct pixman_transform *reverse,
pixman_fixed_t tx,
pixman_fixed_t ty);
+
+PIXMAN_API
pixman_bool_t pixman_transform_bounds (const struct pixman_transform *matrix,
struct pixman_box16 *b);
+
+PIXMAN_API
pixman_bool_t pixman_transform_invert (struct pixman_transform *dst,
const struct pixman_transform *src);
+
+PIXMAN_API
pixman_bool_t pixman_transform_is_identity (const struct pixman_transform *t);
+
+PIXMAN_API
pixman_bool_t pixman_transform_is_scale (const struct pixman_transform *t);
+
+PIXMAN_API
pixman_bool_t pixman_transform_is_int_translate (const struct pixman_transform *t);
+
+PIXMAN_API
pixman_bool_t pixman_transform_is_inverse (const struct pixman_transform *a,
const struct pixman_transform *b);
@@ -239,42 +270,70 @@ struct pixman_f_transform
double m[3][3];
};
+
+PIXMAN_API
pixman_bool_t pixman_transform_from_pixman_f_transform (struct pixman_transform *t,
const struct pixman_f_transform *ft);
+
+PIXMAN_API
void pixman_f_transform_from_pixman_transform (struct pixman_f_transform *ft,
const struct pixman_transform *t);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_invert (struct pixman_f_transform *dst,
const struct pixman_f_transform *src);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_point (const struct pixman_f_transform *t,
struct pixman_f_vector *v);
+
+PIXMAN_API
void pixman_f_transform_point_3d (const struct pixman_f_transform *t,
struct pixman_f_vector *v);
+
+PIXMAN_API
void pixman_f_transform_multiply (struct pixman_f_transform *dst,
const struct pixman_f_transform *l,
const struct pixman_f_transform *r);
+
+PIXMAN_API
void pixman_f_transform_init_scale (struct pixman_f_transform *t,
double sx,
double sy);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_scale (struct pixman_f_transform *forward,
struct pixman_f_transform *reverse,
double sx,
double sy);
+
+PIXMAN_API
void pixman_f_transform_init_rotate (struct pixman_f_transform *t,
double cos,
double sin);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_rotate (struct pixman_f_transform *forward,
struct pixman_f_transform *reverse,
double c,
double s);
+
+PIXMAN_API
void pixman_f_transform_init_translate (struct pixman_f_transform *t,
double tx,
double ty);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_translate (struct pixman_f_transform *forward,
struct pixman_f_transform *reverse,
double tx,
double ty);
+
+PIXMAN_API
pixman_bool_t pixman_f_transform_bounds (const struct pixman_f_transform *t,
struct pixman_box16 *b);
+
+PIXMAN_API
void pixman_f_transform_init_identity (struct pixman_f_transform *t);
typedef enum
@@ -433,73 +492,120 @@ typedef enum
/* This function exists only to make it possible to preserve
* the X ABI - it should go away at first opportunity.
*/
+PIXMAN_API
void pixman_region_set_static_pointers (pixman_box16_t *empty_box,
pixman_region16_data_t *empty_data,
pixman_region16_data_t *broken_data);
/* creation/destruction */
+PIXMAN_API
void pixman_region_init (pixman_region16_t *region);
+
+PIXMAN_API
void pixman_region_init_rect (pixman_region16_t *region,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region_init_rects (pixman_region16_t *region,
const pixman_box16_t *boxes,
int count);
+
+PIXMAN_API
void pixman_region_init_with_extents (pixman_region16_t *region,
pixman_box16_t *extents);
+
+PIXMAN_API
void pixman_region_init_from_image (pixman_region16_t *region,
pixman_image_t *image);
+
+PIXMAN_API
void pixman_region_fini (pixman_region16_t *region);
/* manipulation */
+PIXMAN_API
void pixman_region_translate (pixman_region16_t *region,
int x,
int y);
+
+PIXMAN_API
pixman_bool_t pixman_region_copy (pixman_region16_t *dest,
pixman_region16_t *source);
+
+PIXMAN_API
pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
+
+PIXMAN_API
pixman_bool_t pixman_region_union (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
+
+PIXMAN_API
pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest,
pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest,
pixman_region16_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d,
pixman_region16_t *reg_m,
pixman_region16_t *reg_s);
+
+PIXMAN_API
pixman_bool_t pixman_region_inverse (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_box16_t *inv_rect);
+
+PIXMAN_API
pixman_bool_t pixman_region_contains_point (pixman_region16_t *region,
int x,
int y,
pixman_box16_t *box);
+
+PIXMAN_API
pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *region,
pixman_box16_t *prect);
+
+PIXMAN_API
pixman_bool_t pixman_region_not_empty (pixman_region16_t *region);
+
+PIXMAN_API
pixman_box16_t * pixman_region_extents (pixman_region16_t *region);
+
+PIXMAN_API
int pixman_region_n_rects (pixman_region16_t *region);
+
+PIXMAN_API
pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region,
int *n_rects);
+
+PIXMAN_API
pixman_bool_t pixman_region_equal (pixman_region16_t *region1,
pixman_region16_t *region2);
+
+PIXMAN_API
pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region);
+
+PIXMAN_API
void pixman_region_reset (pixman_region16_t *region,
pixman_box16_t *box);
+
+PIXMAN_API
void pixman_region_clear (pixman_region16_t *region);
/*
* 32 bit regions
@@ -533,72 +639,119 @@ struct pixman_region32
};
/* creation/destruction */
+PIXMAN_API
void pixman_region32_init (pixman_region32_t *region);
+
+PIXMAN_API
void pixman_region32_init_rect (pixman_region32_t *region,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region32_init_rects (pixman_region32_t *region,
const pixman_box32_t *boxes,
int count);
+
+PIXMAN_API
void pixman_region32_init_with_extents (pixman_region32_t *region,
pixman_box32_t *extents);
+
+PIXMAN_API
void pixman_region32_init_from_image (pixman_region32_t *region,
pixman_image_t *image);
+
+PIXMAN_API
void pixman_region32_fini (pixman_region32_t *region);
/* manipulation */
+PIXMAN_API
void pixman_region32_translate (pixman_region32_t *region,
int x,
int y);
+
+PIXMAN_API
pixman_bool_t pixman_region32_copy (pixman_region32_t *dest,
pixman_region32_t *source);
+
+PIXMAN_API
pixman_bool_t pixman_region32_intersect (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_region32_t *reg2);
+
+PIXMAN_API
pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_region32_t *reg2);
+
+PIXMAN_API
pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest,
pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest,
pixman_region32_t *source,
int x,
int y,
unsigned int width,
unsigned int height);
+
+PIXMAN_API
pixman_bool_t pixman_region32_subtract (pixman_region32_t *reg_d,
pixman_region32_t *reg_m,
pixman_region32_t *reg_s);
+
+PIXMAN_API
pixman_bool_t pixman_region32_inverse (pixman_region32_t *new_reg,
pixman_region32_t *reg1,
pixman_box32_t *inv_rect);
+
+PIXMAN_API
pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region,
int x,
int y,
pixman_box32_t *box);
+
+PIXMAN_API
pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region,
pixman_box32_t *prect);
+
+PIXMAN_API
pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region);
+
+PIXMAN_API
pixman_box32_t * pixman_region32_extents (pixman_region32_t *region);
+
+PIXMAN_API
int pixman_region32_n_rects (pixman_region32_t *region);
+
+PIXMAN_API
pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region,
int *n_rects);
+
+PIXMAN_API
pixman_bool_t pixman_region32_equal (pixman_region32_t *region1,
pixman_region32_t *region2);
+
+PIXMAN_API
pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region);
+
+PIXMAN_API
void pixman_region32_reset (pixman_region32_t *region,
pixman_box32_t *box);
+
+PIXMAN_API
void pixman_region32_clear (pixman_region32_t *region);
/* Copy / Fill / Misc */
+PIXMAN_API
pixman_bool_t pixman_blt (uint32_t *src_bits,
uint32_t *dst_bits,
int src_stride,
@@ -611,6 +764,8 @@ pixman_bool_t pixman_blt (uint32_t *src_bits,
int dest_y,
int width,
int height);
+
+PIXMAN_API
pixman_bool_t pixman_fill (uint32_t *bits,
int stride,
int bpp,
@@ -620,7 +775,11 @@ pixman_bool_t pixman_fill (uint32_t *bits,
int height,
uint32_t _xor);
+
+PIXMAN_API
int pixman_version (void);
+
+PIXMAN_API
const char* pixman_version_string (void);
/*
@@ -786,30 +945,44 @@ typedef enum {
} pixman_format_code_t;
/* Querying supported format values. */
+PIXMAN_API
pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format);
+
+PIXMAN_API
pixman_bool_t pixman_format_supported_source (pixman_format_code_t format);
/* Constructors */
+PIXMAN_API
pixman_image_t *pixman_image_create_solid_fill (const pixman_color_t *color);
+
+PIXMAN_API
pixman_image_t *pixman_image_create_linear_gradient (const pixman_point_fixed_t *p1,
const pixman_point_fixed_t *p2,
const pixman_gradient_stop_t *stops,
int n_stops);
+
+PIXMAN_API
pixman_image_t *pixman_image_create_radial_gradient (const pixman_point_fixed_t *inner,
const pixman_point_fixed_t *outer,
pixman_fixed_t inner_radius,
pixman_fixed_t outer_radius,
const pixman_gradient_stop_t *stops,
int n_stops);
+
+PIXMAN_API
pixman_image_t *pixman_image_create_conical_gradient (const pixman_point_fixed_t *center,
pixman_fixed_t angle,
const pixman_gradient_stop_t *stops,
int n_stops);
+
+PIXMAN_API
pixman_image_t *pixman_image_create_bits (pixman_format_code_t format,
int width,
int height,
uint32_t *bits,
int rowstride_bytes);
+
+PIXMAN_API
pixman_image_t *pixman_image_create_bits_no_clear (pixman_format_code_t format,
int width,
int height,
@@ -817,53 +990,99 @@ pixman_image_t *pixman_image_create_bits_no_clear (pixman_format_code_t forma
int rowstride_bytes);
/* Destructor */
+PIXMAN_API
pixman_image_t *pixman_image_ref (pixman_image_t *image);
+
+PIXMAN_API
pixman_bool_t pixman_image_unref (pixman_image_t *image);
+
+PIXMAN_API
void pixman_image_set_destroy_function (pixman_image_t *image,
pixman_image_destroy_func_t function,
void *data);
+
+PIXMAN_API
void * pixman_image_get_destroy_data (pixman_image_t *image);
/* Set properties */
+PIXMAN_API
pixman_bool_t pixman_image_set_clip_region (pixman_image_t *image,
pixman_region16_t *region);
+
+PIXMAN_API
pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image,
pixman_region32_t *region);
+
+PIXMAN_API
void pixman_image_set_has_client_clip (pixman_image_t *image,
pixman_bool_t clien_clip);
+
+PIXMAN_API
pixman_bool_t pixman_image_set_transform (pixman_image_t *image,
const pixman_transform_t *transform);
+
+PIXMAN_API
void pixman_image_set_repeat (pixman_image_t *image,
pixman_repeat_t repeat);
+
+PIXMAN_API
void pixman_image_set_dither (pixman_image_t *image,
pixman_dither_t dither);
+
+PIXMAN_API
void pixman_image_set_dither_offset (pixman_image_t *image,
int offset_x,
int offset_y);
+
+PIXMAN_API
pixman_bool_t pixman_image_set_filter (pixman_image_t *image,
pixman_filter_t filter,
const pixman_fixed_t *filter_params,
int n_filter_params);
+
+PIXMAN_API
void pixman_image_set_source_clipping (pixman_image_t *image,
pixman_bool_t source_clipping);
+
+PIXMAN_API
void pixman_image_set_alpha_map (pixman_image_t *image,
pixman_image_t *alpha_map,
int16_t x,
int16_t y);
+
+PIXMAN_API
void pixman_image_set_component_alpha (pixman_image_t *image,
pixman_bool_t component_alpha);
+
+PIXMAN_API
pixman_bool_t pixman_image_get_component_alpha (pixman_image_t *image);
+
+PIXMAN_API
void pixman_image_set_accessors (pixman_image_t *image,
pixman_read_memory_func_t read_func,
pixman_write_memory_func_t write_func);
+
+PIXMAN_API
void pixman_image_set_indexed (pixman_image_t *image,
const pixman_indexed_t *indexed);
+
+PIXMAN_API
uint32_t *pixman_image_get_data (pixman_image_t *image);
+
+PIXMAN_API
int pixman_image_get_width (pixman_image_t *image);
+
+PIXMAN_API
int pixman_image_get_height (pixman_image_t *image);
+
+PIXMAN_API
int pixman_image_get_stride (pixman_image_t *image); /* in bytes */
+
+PIXMAN_API
int pixman_image_get_depth (pixman_image_t *image);
+
+PIXMAN_API
pixman_format_code_t pixman_image_get_format (pixman_image_t *image);
typedef enum
@@ -881,6 +1100,7 @@ typedef enum
/* Create the parameter list for a SEPARABLE_CONVOLUTION filter
* with the given kernels and scale parameters.
*/
+PIXMAN_API
pixman_fixed_t *
pixman_filter_create_separable_convolution (int *n_values,
pixman_fixed_t scale_x,
@@ -892,11 +1112,15 @@ pixman_filter_create_separable_convolution (int *n_values,
int subsample_bits_x,
int subsample_bits_y);
+
+PIXMAN_API
pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op,
pixman_image_t *image,
const pixman_color_t *color,
int n_rects,
const pixman_rectangle16_t *rects);
+
+PIXMAN_API
pixman_bool_t pixman_image_fill_boxes (pixman_op_t op,
pixman_image_t *dest,
const pixman_color_t *color,
@@ -904,6 +1128,7 @@ pixman_bool_t pixman_image_fill_boxes (pixman_op_t
const pixman_box32_t *boxes);
/* Composite */
+PIXMAN_API
pixman_bool_t pixman_compute_composite_region (pixman_region16_t *region,
pixman_image_t *src_image,
pixman_image_t *mask_image,
@@ -916,6 +1141,8 @@ pixman_bool_t pixman_compute_composite_region (pixman_region16_t *region,
int16_t dest_y,
uint16_t width,
uint16_t height);
+
+PIXMAN_API
void pixman_image_composite (pixman_op_t op,
pixman_image_t *src,
pixman_image_t *mask,
@@ -928,6 +1155,8 @@ void pixman_image_composite (pixman_op_t op,
int16_t dest_y,
uint16_t width,
uint16_t height);
+
+PIXMAN_API
void pixman_image_composite32 (pixman_op_t op,
pixman_image_t *src,
pixman_image_t *mask,
@@ -959,6 +1188,7 @@ void pixman_image_composite32 (pixman_op_t op,
* Since 0.21.2, pixman doesn't do these workarounds anymore, so now this
* function is a no-op.
*/
+PIXMAN_API
void pixman_disable_out_of_bounds_workaround (void);
/*
@@ -971,29 +1201,48 @@ typedef struct
const void *glyph;
} pixman_glyph_t;
+PIXMAN_API
pixman_glyph_cache_t *pixman_glyph_cache_create (void);
+
+PIXMAN_API
void pixman_glyph_cache_destroy (pixman_glyph_cache_t *cache);
+
+PIXMAN_API
void pixman_glyph_cache_freeze (pixman_glyph_cache_t *cache);
+
+PIXMAN_API
void pixman_glyph_cache_thaw (pixman_glyph_cache_t *cache);
+
+PIXMAN_API
const void * pixman_glyph_cache_lookup (pixman_glyph_cache_t *cache,
void *font_key,
void *glyph_key);
+
+PIXMAN_API
const void * pixman_glyph_cache_insert (pixman_glyph_cache_t *cache,
void *font_key,
void *glyph_key,
int origin_x,
int origin_y,
pixman_image_t *glyph_image);
+
+PIXMAN_API
void pixman_glyph_cache_remove (pixman_glyph_cache_t *cache,
void *font_key,
void *glyph_key);
+
+PIXMAN_API
void pixman_glyph_get_extents (pixman_glyph_cache_t *cache,
int n_glyphs,
pixman_glyph_t *glyphs,
pixman_box32_t *extents);
+
+PIXMAN_API
pixman_format_code_t pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache,
int n_glyphs,
const pixman_glyph_t *glyphs);
+
+PIXMAN_API
void pixman_composite_glyphs (pixman_op_t op,
pixman_image_t *src,
pixman_image_t *dest,
@@ -1009,6 +1258,8 @@ void pixman_composite_glyphs (pixman_op_t op,
pixman_glyph_cache_t *cache,
int n_glyphs,
const pixman_glyph_t *glyphs);
+
+PIXMAN_API
void pixman_composite_glyphs_no_mask (pixman_op_t op,
pixman_image_t *src,
pixman_image_t *dest,
@@ -1076,12 +1327,19 @@ struct pixman_trap
pixman_span_fix_t top, bot;
};
+PIXMAN_API
pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y,
int bpp);
+
+PIXMAN_API
pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y,
int bpp);
+
+PIXMAN_API
void pixman_edge_step (pixman_edge_t *e,
int n);
+
+PIXMAN_API
void pixman_edge_init (pixman_edge_t *e,
int bpp,
pixman_fixed_t y_start,
@@ -1089,31 +1347,43 @@ void pixman_edge_init (pixman_edge_t *e,
pixman_fixed_t y_top,
pixman_fixed_t x_bot,
pixman_fixed_t y_bot);
+
+PIXMAN_API
void pixman_line_fixed_edge_init (pixman_edge_t *e,
int bpp,
pixman_fixed_t y,
const pixman_line_fixed_t *line,
int x_off,
int y_off);
+
+PIXMAN_API
void pixman_rasterize_edges (pixman_image_t *image,
pixman_edge_t *l,
pixman_edge_t *r,
pixman_fixed_t t,
pixman_fixed_t b);
+
+PIXMAN_API
void pixman_add_traps (pixman_image_t *image,
int16_t x_off,
int16_t y_off,
int ntrap,
const pixman_trap_t *traps);
+
+PIXMAN_API
void pixman_add_trapezoids (pixman_image_t *image,
int16_t x_off,
int y_off,
int ntraps,
const pixman_trapezoid_t *traps);
+
+PIXMAN_API
void pixman_rasterize_trapezoid (pixman_image_t *image,
const pixman_trapezoid_t *trap,
int x_off,
int y_off);
+
+PIXMAN_API
void pixman_composite_trapezoids (pixman_op_t op,
pixman_image_t * src,
pixman_image_t * dst,
@@ -1124,6 +1394,8 @@ void pixman_composite_trapezoids (pixman_op_t op,
int y_dst,
int n_traps,
const pixman_trapezoid_t * traps);
+
+PIXMAN_API
void pixman_composite_triangles (pixman_op_t op,
pixman_image_t * src,
pixman_image_t * dst,
@@ -1134,6 +1406,8 @@ void pixman_composite_triangles (pixman_op_t op,
int y_dst,
int n_tris,
const pixman_triangle_t * tris);
+
+PIXMAN_API
void pixman_add_triangles (pixman_image_t *image,
int32_t x_off,
int32_t y_off,
commit b7eea54028a10a32bb269fb16f1c169defd6a3ea
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 11:01:10 2019 +0800
pixman/pixman-version.h.in: Add a PIXMAN_API macro
This prepares to mark the public APIs that we have in pixman.h so that
we can use compiler directives such as __declspec(dllexport) to export
those symbols.
diff --git a/pixman/pixman-version.h.in b/pixman/pixman-version.h.in
index 256b2e6..64778a5 100644
--- a/pixman/pixman-version.h.in
+++ b/pixman/pixman-version.h.in
@@ -47,4 +47,8 @@
PIXMAN_VERSION_MINOR, \
PIXMAN_VERSION_MICRO)
+#ifndef PIXMAN_API
+# define PIXMAN_API
+#endif
+
#endif /* PIXMAN_VERSION_H__ */
commit 06a3f6e60b7cc0c2c76053b95b98abe3189573c2
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 16:27:29 2019 +0800
meson.build: Improve libpng search on MSVC
The build system for libpng for MSVC does not generate a pkg-config file
for us, and CMake support in Meson does not work very well. So, look
for libpng manually on MSVC builds if depedency discovery did not work
out via pkg-config or the CMake config files.
diff --git a/meson.build b/meson.build
index 5e9f221..72d7e3d 100644
--- a/meson.build
+++ b/meson.build
@@ -387,7 +387,24 @@ dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk
dep_glib = dependency('glib-2.0', required : get_option('gtk'))
dep_pixman = dependency('pixman-1', required : get_option('gtk'),
version : '>= ' + meson.project_version())
-dep_png = dependency('libpng', required : get_option('libpng'))
+
+dep_png = null_dep
+if not get_option('libpng').disabled()
+ dep_png = dependency('libpng', required : false)
+
+ # We need to look for the right library to link to for libpng,
+ # when looking for libpng manually
+ foreach png_ver : [ '16', '15', '14', '13', '12', '10' ]
+ if not dep_png.found()
+ dep_png = cc.find_library('libpng at 0@'.format(png_ver), has_headers : ['png.h'], required : false)
+ endif
+ endforeach
+
+ if get_option('libpng').enabled() and not dep_png.found()
+ error('libpng support requested but libpng library not found')
+ endif
+endif
+
if dep_png.found()
config.set('HAVE_LIBPNG', 1)
endif
commit 7661b1fae982da029ef56e58a1df2a4d6fd48444
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 14:44:39 2019 +0800
build: Don't assume PThreads if threading support is found
Look also for pthread.h if threading support is found by Meson, as the
underlying threading support may not be PThreads, depending on platform.
For now, disable the thread-test test program if pthread.h and if
necessary, the PThreads library, cannot be found, as the current
implementation assumes the use of PThreads.
Also bump the required Meson version to 0.50.0 since we need it for
-cc.get_argument_syntax()
-For a later commit, the has_headers sub-method for cc.find_library()
diff --git a/meson.build b/meson.build
index 8f062bc..5e9f221 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ project(
['c'],
version : '0.38.5',
license : 'MIT',
- meson_version : '>= 0.47.2',
+ meson_version : '>= 0.50.0',
default_options : ['buildtype=debugoptimized'],
)
@@ -393,7 +393,29 @@ if dep_png.found()
endif
dep_m = cc.find_library('m', required : false)
dep_threads = dependency('threads')
-if dep_threads.found()
+
+# MSVC-style compilers do not come with pthreads, so we must link
+# to it explicitly, currently pthreads-win32 is supported
+pthreads_found = false
+
+if dep_threads.found() and cc.has_header('pthread.h')
+ if cc.get_argument_syntax() == 'msvc'
+ pthread_lib = null_dep
+ foreach pthread_type : ['VC3', 'VSE3', 'VCE3', 'VC2', 'VSE2', 'VCE2']
+ if not pthread_lib.found()
+ pthread_lib = cc.find_library('pthread at 0@'.format(pthread_type), required : false)
+ endif
+ endforeach
+ if pthread_lib.found()
+ pthreads_found = true
+ dep_threads = pthread_lib
+ endif
+ else
+ pthreads_found = true
+ endif
+endif
+
+if pthreads_found
config.set('HAVE_PTHREADS', 1)
endif
diff --git a/test/meson.build b/test/meson.build
index a2da108..a2c7554 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -34,7 +34,6 @@ tests = [
'scaling-crash-test',
'alpha-loop',
'scaling-helpers-test',
- 'thread-test',
'rotate-test',
'alphamap',
'gradient-crash-test',
@@ -54,6 +53,12 @@ tests = [
'tolerance-test',
]
+# Remove/update this once thread-test.c supports threading methods
+# other than PThreads
+if pthreads_found
+ tests += 'thread-test'
+endif
+
progs = [
'lowlevel-blt-bench',
'radial-perf-test',
commit e9db26898b8aae8737dddb11f5ba2abb6ec6ca5f
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 13:36:12 2019 +0800
meson.build: Disable OpenMP on MSVC builds
The implementation of OpenMP is not compliant for our uses, so disable
it for now by just not checking for it on MSVC builds, as we implicitly
add an /openmp switch to the build, which will cause linking the tests
programs to fail, as the OpenMP implementation is not enough.
diff --git a/meson.build b/meson.build
index 966058c..8f062bc 100644
--- a/meson.build
+++ b/meson.build
@@ -365,14 +365,21 @@ if get_option('gnuplot')
config.set('PIXMAN_GNUPLOT', 1)
endif
-dep_openmp = dependency('openmp', required : get_option('openmp'))
-if dep_openmp.found()
- config.set10('USE_OPENMP', true)
-elif meson.version().version_compare('<0.51.0')
-# In versions of meson before 0.51 the openmp dependency can still
-# inject arguments in the the auto case when it is not found, the
-# detection does work correctly in that case however, so we just
-# replace dep_openmp with null_dep to work around this.
+if cc.get_id() != 'msvc'
+ dep_openmp = dependency('openmp', required : get_option('openmp'))
+ if dep_openmp.found()
+ config.set10('USE_OPENMP', true)
+ elif meson.version().version_compare('<0.51.0')
+ # In versions of meson before 0.51 the openmp dependency can still
+ # inject arguments in the the auto case when it is not found, the
+ # detection does work correctly in that case however, so we just
+ # replace dep_openmp with null_dep to work around this.
+ dep_openmp = null_dep
+ endif
+else
+ # the MSVC implementation of openmp is not compliant enough for our
+ # uses here, so we disable it here.
+ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio
dep_openmp = null_dep
endif
commit f251c12f8a64146ae698fc640b243c3d57450197
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date: Wed Jul 24 11:31:14 2019 +0800
meson.build: Fix MMX, SSE2 and SSSE3 checks on MSVC
-For MSVC builds, do not use the GCC-specific CFlags when checking for
these features.
-For the MMX check, assume that we have good enough MMX intrinsics and
inline assembly support (on ix86), since MSVC provides sufficient
support for those since before the times of MSVC 2008, and 2008 is the
oldest version that we can support, as with the pre-C99 GTK+ stack.
Unfortunately due to x64 compiler issues, pre-Visual Studio 2010 will
crash when building SSSE3 code, so we do not enable building SSSE3 code
on pre-2010 Visual Studio.
Also, for all x64 Visual Studio builds, we do not enable USE_X86_MMX
as inline assembly is not allowed for x64 Visual Studio builds, and
instead use the compatibility instrinsics that we already have in the
code.
diff --git a/meson.build b/meson.build
index 2118abf..966058c 100644
--- a/meson.build
+++ b/meson.build
@@ -85,9 +85,12 @@ endif
use_mmx = get_option('mmx')
have_mmx = false
-mmx_flags = ['-mmmx', '-Winline']
+mmx_flags = []
+if cc.get_id() != 'msvc'
+ mmx_flags = ['-mmmx', '-Winline']
+endif
if not use_mmx.disabled()
- if host_machine.cpu_family() == 'x86_64'
+ if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc'
have_mmx = true
elif host_machine.cpu_family() == 'x86' and cc.compiles('''
#include <mmintrin.h>
@@ -128,14 +131,21 @@ if not use_mmx.disabled()
endif
if have_mmx
- config.set10('USE_X86_MMX', true)
+ # Inline assembly do not work on X64 MSVC, so we use
+ # compatibility intrinsics there
+ if cc.get_id() != 'msvc' or host_machine.cpu_family() != 'x86_64'
+ config.set10('USE_X86_MMX', true)
+ endif
elif use_mmx.enabled()
error('MMX Support unavailable, but required')
endif
use_sse2 = get_option('sse2')
have_sse2 = false
-sse2_flags = ['-msse2', '-Winline']
+sse2_flags = []
+if cc.get_id() != 'msvc'
+ sse2_flags = ['-msse2', '-Winline']
+endif
if not use_sse2.disabled()
if host_machine.cpu_family() == 'x86'
if cc.compiles('''
@@ -170,8 +180,13 @@ endif
use_ssse3 = get_option('ssse3')
have_ssse3 = false
-ssse3_flags =['-mssse3', '-Winline']
-if not use_ssse3.disabled()
+ssse3_flags = []
+if cc.get_id() != 'msvc'
+ ssse3_flags = ['-mssse3', '-Winline']
+endif
+
+# x64 pre-2010 MSVC compilers crashes when building the ssse3 code
+if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64')
if host_machine.cpu_family().startswith('x86')
if cc.compiles('''
#include <mmintrin.h>
More information about the xorg-commit
mailing list