Beispiel #1
0
Region& Region::operator=(const Rect& rect)
{
  if (!rect.isEmpty()) {
    box_type_t box = { rect.x, rect.y, rect.x2(), rect.y2() };
    pixman_region32_reset(&m_region, &box);
  }
  else
    pixman_region32_clear(&m_region);
  return *this;
}
Beispiel #2
0
static void UwacSubmitBufferPtr(UwacWindow* window, UwacBuffer* buffer)
{
	UINT32 nrects, i;
#ifdef HAVE_PIXMAN_REGION
	const pixman_box32_t* box;
#else
	const RECTANGLE_16* box;
#endif
	wl_surface_attach(window->surface, buffer->wayland_buffer, 0, 0);
#ifdef HAVE_PIXMAN_REGION
	box = pixman_region32_rectangles(&buffer->damage, &nrects);

	for (i = 0; i < nrects; i++, box++)
		wl_surface_damage(window->surface, box->x1, box->y1, (box->x2 - box->x1), (box->y2 - box->y1));

#else
	box = region16_rects(&buffer->damage, &nrects);

	for (i = 0; i < nrects; i++, box++)
		wl_surface_damage(window->surface, box->left, box->top, (box->right - box->left),
		                  (box->bottom - box->top));

#endif

	if (window->frame_callback)
		wl_callback_destroy(window->frame_callback);

	window->frame_callback = wl_surface_frame(window->surface);
	wl_callback_add_listener(window->frame_callback, &frame_listener, window);
	wl_surface_commit(window->surface);
#ifdef HAVE_PIXMAN_REGION
	pixman_region32_clear(&buffer->damage);
#else
	region16_clear(&buffer->damage);
#endif
}
Beispiel #3
0
void Region::clear()
{
  pixman_region32_clear(&m_region);
}