DS_ASSERT(x >= 0 && y >= 0 && width > 0 && height > 0);
surface = wl_container_of(vp_handle, surface, viewport_handle);
- surface->pending.committed |= DS_SURFACE_STATE_VIEWPORT;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_VIEWPORT);
surface->pending.viewport.has_src = true;
surface->pending.viewport.src.x = x;
surface->pending.viewport.src.y = y;
DS_ASSERT(vp_handle->taken == true);
surface = wl_container_of(vp_handle, surface, viewport_handle);
- surface->pending.committed |= DS_SURFACE_STATE_VIEWPORT;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_VIEWPORT);
surface->pending.viewport.has_src = false;
}
DS_ASSERT(width > 0 && height > 0);
surface = wl_container_of(vp_handle, surface, viewport_handle);
- surface->pending.committed |= DS_SURFACE_STATE_VIEWPORT;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_VIEWPORT);
surface->pending.viewport.has_dst = true;
surface->pending.viewport.dst_width = width;
surface->pending.viewport.dst_height = height;
DS_ASSERT(vp_handle->taken == true);
surface = wl_container_of(vp_handle, surface, viewport_handle);
- surface->pending.committed |= DS_SURFACE_STATE_VIEWPORT;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_VIEWPORT);
surface->pending.viewport.has_dst = false;
}
}
surface = wl_resource_get_user_data(resource);
- surface->pending.committed |= DS_SURFACE_STATE_BUFFER;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_BUFFER);
surface->pending.dx = dx;
surface->pending.dy = dy;
if (width < 0 || height < 0)
return;
- surface->pending.committed |= DS_SURFACE_STATE_SURFACE_DAMAGE;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_SURFACE_DAMAGE);
pixman_region32_union_rect(&surface->pending.surface_damage,
&surface->pending.surface_damage,
x, y, width, height);
wl_list_insert(surface->pending.frame_callback_list.prev,
wl_resource_get_link(callback_resource));
- surface->pending.committed |= DS_SURFACE_STATE_FRAME_CALLBACK_LIST;
+ DS_FLAG_SET(surface->pending.committed,
+ DS_SURFACE_STATE_FRAME_CALLBACK_LIST);
}
static void
ds_dbg("ds_surface(%p) set opaque region", surface);
- surface->pending.committed |= DS_SURFACE_STATE_OPAQUE_REGION;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_OPAQUE_REGION);
if (region_resource) {
region = ds_region_from_resource(region_resource);
pixman_region32_copy(&surface->pending.opaque, region);
ds_dbg("ds_surface(%p) set input region", surface);
- surface->pending.committed |= DS_SURFACE_STATE_INPUT_REGION;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_INPUT_REGION);
if (region_resource) {
region = ds_region_from_resource(region_resource);
pixman_region32_copy(&surface->pending.input, region);
return;
}
- surface->pending.committed |= DS_SURFACE_STATE_TRANSFORM;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_TRANSFORM);
surface->pending.transform = transform;
}
return;
}
- surface->pending.committed |= DS_SURFACE_STATE_SCALE;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_SCALE);
surface->pending.scale = scale;
}
return;
}
- surface->pending.committed |= DS_SURFACE_STATE_BUFFER_DAMAGE;
+ DS_FLAG_SET(surface->pending.committed, DS_SURFACE_STATE_BUFFER_DAMAGE);
pixman_region32_union_rect(&surface->pending.buffer_damage,
&surface->pending.buffer_damage,
x, y, width, height);
state->buffer_width = next->buffer_width;
state->buffer_height = next->buffer_height;
- if (next->committed & DS_SURFACE_STATE_SCALE)
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_SCALE))
state->scale = next->scale;
- if (next->committed & DS_SURFACE_STATE_TRANSFORM)
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_TRANSFORM))
state->transform = next->transform;
- if (next->committed & DS_SURFACE_STATE_BUFFER) {
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_BUFFER)) {
state->dx = next->dx;
state->dy = next->dy;
next->dx = next->dy = 0;
state->dx = state->dy = 0;
}
- if (next->committed & DS_SURFACE_STATE_SURFACE_DAMAGE) {
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_SURFACE_DAMAGE)) {
pixman_region32_copy(&state->surface_damage, &next->surface_damage);
pixman_region32_clear(&next->surface_damage);
}
else
pixman_region32_clear(&state->surface_damage);
- if (next->committed & DS_SURFACE_STATE_BUFFER_DAMAGE) {
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_BUFFER_DAMAGE)) {
pixman_region32_copy(&state->buffer_damage, &next->buffer_damage);
pixman_region32_clear(&next->buffer_damage);
}
else
pixman_region32_clear(&state->buffer_damage);
- if (next->committed & DS_SURFACE_STATE_OPAQUE_REGION)
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_OPAQUE_REGION))
pixman_region32_copy(&state->opaque, &next->opaque);
- if (next->committed & DS_SURFACE_STATE_INPUT_REGION)
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_INPUT_REGION))
pixman_region32_copy(&state->input, &next->input);
- if (next->committed & DS_SURFACE_STATE_VIEWPORT)
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_VIEWPORT))
memcpy(&state->viewport, &next->viewport, sizeof(state->viewport));
- if (next->committed & DS_SURFACE_STATE_FRAME_CALLBACK_LIST) {
+ if (DS_FLAG_IS_SET(next->committed, DS_SURFACE_STATE_FRAME_CALLBACK_LIST)) {
wl_list_insert_list(&state->frame_callback_list,
&next->frame_callback_list);
wl_list_init(&next->frame_callback_list);
{
struct ds_surface_state *pending = &surface->pending;
- if ((pending->committed & DS_SURFACE_STATE_BUFFER)) {
+ if (DS_FLAG_IS_SET(pending->committed, DS_SURFACE_STATE_BUFFER)) {
if (pending->buffer) {
ds_buffer_get_size(pending->buffer,
&pending->buffer_width, &pending->buffer_height);
surface_state_move(&surface->current, next);
// FIXME no need?
- if (surface->current.committed & DS_SURFACE_STATE_BUFFER)
+ if (DS_FLAG_IS_SET(surface->current.committed, DS_SURFACE_STATE_BUFFER))
surface_update_buffer(surface);
if (surface->role && surface->role->commit)