Ejemplo n.º 1
0
static ply_renderer_head_t *
ply_renderer_head_new (ply_renderer_backend_t *backend,
                       drmModeConnector       *connector,
                       uint32_t                encoder_id,
                       uint32_t                controller_id,
                       uint32_t                console_buffer_id,
                       drmModeModeInfo        *mode)
{
  ply_renderer_head_t *head;

  head = calloc (1, sizeof (ply_renderer_head_t));

  head->backend = backend;
  head->connector = connector;
  head->encoder_id = encoder_id;
  head->controller_id = controller_id;
  head->console_buffer_id = console_buffer_id;
  head->mode = mode;

  head->area.x = 0;
  head->area.y = 0;
  head->area.width = mode->hdisplay;
  head->area.height = mode->vdisplay;

  head->pixel_buffer = ply_pixel_buffer_new (head->area.width, head->area.height);

  ply_trace ("Creating %ldx%ld renderer head", head->area.width, head->area.height);
  ply_pixel_buffer_fill_with_color (head->pixel_buffer, NULL,
                                    0.0, 0.0, 0.0, 1.0);

  return head;
}
Ejemplo n.º 2
0
static ply_renderer_head_t *
ply_renderer_head_new (ply_renderer_backend_t *backend,
                       drmModeConnector       *connector,
                       int                     connector_mode_index,
                       uint32_t                encoder_id,
                       uint32_t                controller_id,
                       uint32_t                console_buffer_id)
{
  ply_renderer_head_t *head;
  drmModeModeInfo *mode;

  head = calloc (1, sizeof (ply_renderer_head_t));

  head->backend = backend;
  head->encoder_id = encoder_id;
  head->connector_ids = ply_array_new (PLY_ARRAY_ELEMENT_TYPE_UINT32);
  head->controller_id = controller_id;
  head->console_buffer_id = console_buffer_id;

  assert (connector_mode_index < connector->count_modes);
  mode = &connector->modes[connector_mode_index];

  head->connector0 = connector;
  head->connector0_mode_index = connector_mode_index;

  head->area.x = 0;
  head->area.y = 0;
  head->area.width = mode->hdisplay;
  head->area.height = mode->vdisplay;

  ply_renderer_head_add_connector (head, connector, connector_mode_index);
  assert (ply_array_get_size (head->connector_ids) > 0);

  head->pixel_buffer = ply_pixel_buffer_new (head->area.width, head->area.height);

  ply_trace ("Creating %ldx%ld renderer head", head->area.width, head->area.height);
  ply_pixel_buffer_fill_with_color (head->pixel_buffer, NULL,
                                    0.0, 0.0, 0.0, 1.0);

  return head;
}