Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright © 2008 Red Hat, Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Permission to use, copy, modify, distribute, and sell this software |
michael@0 | 5 | * and its documentation for any purpose is hereby granted without |
michael@0 | 6 | * fee, provided that the above copyright notice appear in all copies |
michael@0 | 7 | * and that both that copyright notice and this permission notice |
michael@0 | 8 | * appear in supporting documentation, and that the name of |
michael@0 | 9 | * Red Hat, Inc. not be used in advertising or publicity pertaining to |
michael@0 | 10 | * distribution of the software without specific, written prior |
michael@0 | 11 | * permission. Red Hat, Inc. makes no representations about the |
michael@0 | 12 | * suitability of this software for any purpose. It is provided "as |
michael@0 | 13 | * is" without express or implied warranty. |
michael@0 | 14 | * |
michael@0 | 15 | * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS |
michael@0 | 16 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
michael@0 | 17 | * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, |
michael@0 | 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER |
michael@0 | 19 | * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
michael@0 | 20 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR |
michael@0 | 21 | * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
michael@0 | 22 | * |
michael@0 | 23 | * Author: Soren Sandmann <sandmann@redhat.com> |
michael@0 | 24 | */ |
michael@0 | 25 | #ifdef HAVE_CONFIG_H |
michael@0 | 26 | #include <config.h> |
michael@0 | 27 | #endif |
michael@0 | 28 | |
michael@0 | 29 | #undef PIXMAN_DISABLE_DEPRECATED |
michael@0 | 30 | |
michael@0 | 31 | #include "pixman-private.h" |
michael@0 | 32 | |
michael@0 | 33 | #include <stdlib.h> |
michael@0 | 34 | |
michael@0 | 35 | typedef pixman_box16_t box_type_t; |
michael@0 | 36 | typedef pixman_region16_data_t region_data_type_t; |
michael@0 | 37 | typedef pixman_region16_t region_type_t; |
michael@0 | 38 | typedef int32_t overflow_int_t; |
michael@0 | 39 | |
michael@0 | 40 | typedef struct { |
michael@0 | 41 | int x, y; |
michael@0 | 42 | } point_type_t; |
michael@0 | 43 | |
michael@0 | 44 | #define PREFIX(x) pixman_region##x |
michael@0 | 45 | |
michael@0 | 46 | #define PIXMAN_REGION_MAX INT16_MAX |
michael@0 | 47 | #define PIXMAN_REGION_MIN INT16_MIN |
michael@0 | 48 | |
michael@0 | 49 | #include "pixman-region.c" |
michael@0 | 50 | |
michael@0 | 51 | /* This function exists only to make it possible to preserve the X ABI - |
michael@0 | 52 | * it should go away at first opportunity. |
michael@0 | 53 | * |
michael@0 | 54 | * The problem is that the X ABI exports the three structs and has used |
michael@0 | 55 | * them through macros. So the X server calls this function with |
michael@0 | 56 | * the addresses of those structs which makes the existing code continue to |
michael@0 | 57 | * work. |
michael@0 | 58 | */ |
michael@0 | 59 | PIXMAN_EXPORT void |
michael@0 | 60 | pixman_region_set_static_pointers (pixman_box16_t *empty_box, |
michael@0 | 61 | pixman_region16_data_t *empty_data, |
michael@0 | 62 | pixman_region16_data_t *broken_data) |
michael@0 | 63 | { |
michael@0 | 64 | pixman_region_empty_box = empty_box; |
michael@0 | 65 | pixman_region_empty_data = empty_data; |
michael@0 | 66 | pixman_broken_data = broken_data; |
michael@0 | 67 | } |