当前位置: 首页 > 工具软件 > Pixman > 使用案例 >

Where is the implementation of pixman_region32_init()?

养焱
2023-12-01

https://stackoverflow.com/questions/48434760/where-is-the-implementation-of-pixman-region32-init

It's in pixman-region32.c. You don't see it because those functions are generated by the PREFIX macro and then the code in pixman-region.c is used. See here:

typedef pixman_box32_t      box_type_t;
typedef pixman_region32_data_t  region_data_type_t;
typedef pixman_region32_t   region_type_t;
typedef int64_t                 overflow_int_t;

typedef struct {
    int x, y;
} point_type_t;

#define PREFIX(x) pixman_region32##x

#define PIXMAN_REGION_MAX INT32_MAX
#define PIXMAN_REGION_MIN INT32_MIN

#include "pixman-region.c"

It first sets the PREFIX macro to pixman_region32 and then imports the code from pixman-region.c.

PIXMAN_EXPORT void
PREFIX (_init) (region_type_t *region)
{
    region->extents = *pixman_region_empty_box;
    region->data = pixman_region_empty_data;
}

PIXMAN_EXPORT void
PREFIX (_init_rect) (region_type_t *	region,
                     int		x,
		     int		y,
		     unsigned int	width,
		     unsigned int	height)
{
    region->extents.x1 = x;
    region->extents.y1 = y;
    region->extents.x2 = x + width;
    region->extents.y2 = y + height;

    if (!GOOD_RECT (&region->extents))
    {
        if (BAD_RECT (&region->extents))
            _pixman_log_error (FUNC, "Invalid rectangle passed");
        PREFIX (_init) (region);
        return;
    }

    region->data = NULL;
}

简单一点的操作手段:

1.进入pixman的文件夹。

2.若要搜索pixman_region32_union_rect

3.直接grep "_union_rect"

 类似资料:

相关阅读

相关文章

相关问答