示例#1
0
static grub_err_t
grub_video_cbfb_init (void)
{
  grub_memset (&framebuffer, 0, sizeof(framebuffer));

  return grub_video_fb_init ();
}
示例#2
0
文件: sm712.c 项目: kphillisjr/burg
static grub_err_t
grub_video_sm712_video_init (void)
{
  /* Reset frame buffer.  */
  grub_memset (&framebuffer, 0, sizeof(framebuffer));

  return grub_video_fb_init ();
}
示例#3
0
文件: sdl.c 项目: Firef0x/burg-new
static grub_err_t
grub_video_sdl_init (void)
{
  window = 0;

  if (SDL_Init (SDL_INIT_VIDEO) < 0)
    return grub_error (GRUB_ERR_BAD_DEVICE, "Couldn't init SDL: %s",
		       SDL_GetError ());

  grub_memset (&mode_info, 0, sizeof (mode_info));

  return grub_video_fb_init ();
}
示例#4
0
grub_err_t
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
			  struct grub_video_palette_data *palette,
			  unsigned int palette_size)
{
  grub_err_t err;
  grub_memset (&framebuffer, 0, sizeof (framebuffer));

  grub_video_fb_init ();

  framebuffer.mode_info = *mode_info;
  framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info);

  framebuffer.ptr = grub_malloc (framebuffer.mode_info.height * framebuffer.mode_info.pitch);
  if (!framebuffer.ptr)
    return grub_errno;
  
  err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target,
							 &framebuffer.mode_info,
							 framebuffer.ptr);
  if (err)
    return err;
  err = grub_video_fb_set_active_render_target (framebuffer.render_target);
  if (err)
    return err;
  err = grub_video_fb_set_palette (0, palette_size, palette);
  if (err)
    return err;

  saved = grub_video_adapter_active;
  if (saved)
    {
      grub_video_get_info (&saved_mode_info);
      if (saved->fini)
	saved->fini ();
    }
  grub_video_adapter_active = &grub_video_capture_adapter;

  return GRUB_ERR_NONE;
}