赞
踩
1、pixman_reginon32_t数据结构
typedef struct pixman_region32_data pixman_region32_data_t;
typedef struct pixman_box32 pixman_box32_t;
typedef struct pixman_rectangle32 pixman_rectangle32_t;
typedef struct pixman_region32 pixman_region32_t;struct pixman_region32
{
pixman_box32_t extents;
pixman_region32_data_t *data;
};struct pixman_box32
{
int32_t x1, y1, x2, y2;
};struct pixman_region32_data {
long size;
long numRects;
/* pixman_box32_t rects[size]; 隐藏实现 */
};
获取区域方式:单个就是extents;多个就是data后的隐藏的rects
#define PIXREGION_RECTS(reg) \
((reg)->data ? (box_type_t *)((reg)->data + 1) \
: (box_type_t *)&(reg)->extents)
2、pixman_region32_init初始化
其他初始化函数:
pixman_region32_init_rect
pixman_region32_init_with_extents
void pixman_region32_init(region_type_t *region)
{
region->extents = *pixman_region_empty_box;
region->data = pixman_region_empty_data;
}static const box_type_t PREFIX (_empty_box_) = { 0, 0, 0, 0 };
static box_type_t *pixman_region_empty_box =(box_type_t *)&PREFIX (_empty_box_);
static const region_data_type_t PREFIX (_empty_data_) = { 0, 0 };
static region_data_type_t *pixman_region_empty_data =(region_data_type_t *)&PREFIX (_empty_data_);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。