Exemple #1
0
static void nxbe_clipfilltrapezoid(FAR struct nxbe_clipops_s *cops,
                                   FAR struct nxbe_plane_s *plane,
                                   FAR const struct nxgl_rect_s *rect)
{
  struct nxbe_filltrap_s *fillinfo = (struct nxbe_filltrap_s *)cops;
#ifdef CONFIG_NX_UPDATE
  struct nxgl_rect_s update;
#endif

  /* Draw the trapezond */

  plane->filltrapezoid(&plane->pinfo, &fillinfo->trap, rect, fillinfo->color);

#ifdef CONFIG_NX_UPDATE
  /* Notify external logic that the display has been updated */

  update.pt1.x = MIN(MAX(fillinfo->trap.top.x1, rect->pt1.x),
                     MAX(fillinfo->trap.bot.x1, rect->pt1.x));
  update.pt1.y = MAX(fillinfo->trap.top.y, rect->pt1.y);
  update.pt2.x = MAX(MIN(fillinfo->trap.top.x2, rect->pt2.x),
                     MIN(fillinfo->trap.bot.x2, rect->pt2.x));
  update.pt2.y = MIN(fillinfo->trap.bot.y, rect->pt2.y);

  nx_notify_rectangle(&plane->pinfo, &update);
#endif
}
Exemple #2
0
static void nxbe_clipmovesrc(FAR struct nxbe_clipops_s *cops,
                             FAR struct nxbe_plane_s *plane,
                             FAR const struct nxgl_rect_s *rect)
{
  struct nxbe_move_s *info = (struct nxbe_move_s *)cops;
  struct nxgl_point_s offset;
#ifdef CONFIG_NX_UPDATE
  struct nxgl_rect_s update;
#endif

  if (info->offset.x != 0 || info->offset.y != 0)
    {
      /* Offset is the destination position of the moved rectangle */

      offset.x = rect->pt1.x + info->offset.x;
      offset.y = rect->pt1.y + info->offset.y;

      /* Move the source rectangle to the destination position */

      plane->moverectangle(&plane->pinfo, rect, &offset);

#ifdef CONFIG_NX_UPDATE
      /* Notify external logic that the display has been updated */

      update.pt1.x = offset.x;
      update.pt1.y = offset.y;
      update.pt2.x = rect->pt2.x + info->offset.x;
      update.pt2.y = rect->pt2.y + info->offset.y;

      nx_notify_rectangle(&plane->pinfo, &update);
#endif
    }
}
Exemple #3
0
static void nxbe_clipfill(FAR struct nxbe_clipops_s *cops,
                          FAR struct nxbe_plane_s *plane,
                          FAR const struct nxgl_rect_s *rect)
{
  struct nxbe_setpixel_s *fillinfo = (struct nxbe_setpixel_s *)cops;

  /* Set the pixel */
  
  plane->setpixel(&plane->pinfo, &rect->pt1, fillinfo->color);

#ifdef CONFIG_NX_UPDATE
  /* Notify external logic that the display has been updated */

  nx_notify_rectangle(&plane->pinfo, rect);
#endif
}