grub/grub-core/video/fb/fbblit.c

2217 lines
58 KiB
C
Raw Normal View History

/*
* GRUB -- GRand Unified Bootloader
2008-01-01 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/video.h: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_adapter): Added unmap_color and get_active_render_target. * video/video.c: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_get_info): Changed method to accept NULL pointer as an argument to allow detection of active video adapter. * video/i386/pc/vbe.c: Renamed grub_video_vbe_unmap_color as grub_video_vbe_unmap_color_int. Added grub_video_vbe_unmap_color and grub_video_vbe_get_active_render_target. (grub_video_vbe_adapter): Added unmap_color and get_active_render_target. * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage with grub_video_vbe_unmap_color_int. * term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added. (DEFAULT_NORMAL_COLOR): Likewise. (DEFAULT_HIGHLIGHT_COLOR) Likewise. (DEFAULT_FG_COLOR): Removed. (DEFAULT_BG_COLOR): Likewise. (DEFAULT_CURSOR_COLOR): Changed value. (grub_virtual_screen): Added standard_color_setting, normal_color_setting, highlight_color_setting and term_color. (grub_virtual_screen): Removed fg_color_setting and bg_color_setting. (bitmap_width): Added. (bitmap_height): Likewise. (bitmap): Likewise. (set_term_color): Likewise. (grub_virtual_screen_setup): Changed to use new terminal coloring settings. (grub_gfxterm_init): Added init for bitmap. (grub_gfxterm_fini): Added destroy for bitmap. (redraw_screen_rect): Updated to use background bitmap and new terminal coloring. (scroll_up): Added optimization for case when there is no bitmap. (grub_gfxterm_cls): Fixed to use correct background color. (grub_virtual_screen_setcolorstate): Changed to use new terminal coloring. (grub_virtual_screen_setcolor): Likewise. (grub_virtual_screen_getcolor): Added. (grub_gfxterm_background_image_cmd): Likewise. (grub_video_term): Added setcolor and getcolor. (MOD_INIT): Added registration of background_image command. (MOD_TERM): Added unregistration for background_image command.
2008-01-01 12:02:07 +00:00
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
*
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> Migrate to GNU General Public License Version 3. * COPYING: Replaced with the plain text version of GPLv3. * config.guess: Updated from gnulib. * config.sub: Likewise. * geninit.sh: Output a GPLv3 copyright notice. * geninitheader.sh: Likewise. * genmodsrc.sh: Likewise. * gensymlist.sh.in: Likewise. * boot/i386/pc/boot.S: Upgraded to GPLv3. * boot/i386/pc/diskboot.S: Likewise. * boot/i386/pc/pxeboot.S: Likewise. * commands/blocklist.c: Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. * commands/configfile.c: Likewise. * commands/echo.c: Likewise. * commands/help.c: Likewise. * commands/ls.c: Likewise. * commands/search.c: Likewise. * commands/terminal.c: Likewise. * commands/test.c: Likewise. * commands/videotest.c: Likewise. * commands/i386/cpuid.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/reboot.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/ieee1275/halt.c: Likewise. * commands/ieee1275/reboot.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * disk/loopback.c: Likewise. * disk/lvm.c: Likewise. * disk/raid.c: Likewise. * disk/efi/efidisk.c: Likewise. * disk/i386/pc/biosdisk.c: Likewise. * disk/ieee1275/ofdisk.c: Likewise. * font/manager.c: Likewise. * fs/affs.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/fshelp.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/sfs.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * hello/hello.c: Likewise. * include/grub/acorn_filecore.h: Likewise. * include/grub/arg.h: Likewise. * include/grub/bitmap.h: Likewise. * include/grub/boot.h: Likewise. * include/grub/cache.h: Likewise. * include/grub/device.h: Likewise. * include/grub/disk.h: Likewise. * include/grub/dl.h: Likewise. * include/grub/elfload.h: Likewise. * include/grub/env.h: Likewise. * include/grub/err.h: Likewise. * include/grub/file.h: Likewise. * include/grub/font.h: Likewise. * include/grub/fs.h: Likewise. * include/grub/fshelp.h: Likewise. * include/grub/gzio.h: Likewise. * include/grub/hfs.h: Likewise. * include/grub/kernel.h: Likewise. * include/grub/loader.h: Likewise. * include/grub/lvm.h: Likewise. * include/grub/misc.h: Likewise. * include/grub/mm.h: Likewise. * include/grub/net.h: Likewise. * include/grub/normal.h: Likewise. * include/grub/parser.h: Likewise. * include/grub/partition.h: Likewise. * include/grub/pc_partition.h: Likewise. * include/grub/raid.h: Likewise. * include/grub/rescue.h: Likewise. * include/grub/script.h: Likewise. * include/grub/setjmp.h: Likewise. * include/grub/symbol.h: Likewise. * include/grub/term.h: Likewise. * include/grub/terminfo.h: Likewise. * include/grub/tparm.h: Likewise. * include/grub/types.h: Likewise. * include/grub/video.h: Likewise. * include/grub/efi/api.h: Likewise. * include/grub/efi/chainloader.h: Likewise. * include/grub/efi/console.h: Likewise. * include/grub/efi/console_control.h: Likewise. * include/grub/efi/disk.h: Likewise. * include/grub/efi/efi.h: Likewise. * include/grub/efi/pe32.h: Likewise. * include/grub/efi/time.h: Likewise. * include/grub/i386/linux.h: Likewise. * include/grub/i386/setjmp.h: Likewise. * include/grub/i386/types.h: Likewise. * include/grub/i386/efi/kernel.h: Likewise. * include/grub/i386/efi/loader.h: Likewise. * include/grub/i386/efi/time.h: Likewise. * include/grub/i386/pc/biosdisk.h: Likewise. * include/grub/i386/pc/boot.h: Likewise. * include/grub/i386/pc/chainloader.h: Likewise. * include/grub/i386/pc/console.h: Likewise. * include/grub/i386/pc/init.h: Likewise. * include/grub/i386/pc/kernel.h: Likewise. * include/grub/i386/pc/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * include/grub/i386/pc/multiboot.h: Likewise. * include/grub/i386/pc/serial.h: Likewise. * include/grub/i386/pc/time.h: Likewise. * include/grub/i386/pc/vbe.h: Likewise. * include/grub/i386/pc/vbeblit.h: Likewise. * include/grub/i386/pc/vbefill.h: Likewise. * include/grub/i386/pc/vbeutil.h: Likewise. * include/grub/i386/pc/vga.h: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. * include/grub/ieee1275/ofdisk.h: Likewise. * include/grub/powerpc/libgcc.h: Likewise. * include/grub/powerpc/setjmp.h: Likewise. * include/grub/powerpc/types.h: Likewise. * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. * include/grub/powerpc/ieee1275/console.h: Likewise. * include/grub/powerpc/ieee1275/ieee1275.h: Likewise. * include/grub/powerpc/ieee1275/kernel.h: Likewise. * include/grub/powerpc/ieee1275/loader.h: Likewise. * include/grub/powerpc/ieee1275/multiboot.h: Likewise. * include/grub/powerpc/ieee1275/time.h: Likewise. * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/grub/sparc64/libgcc.h: Likewise. * include/grub/sparc64/setjmp.h: Likewise. * include/grub/sparc64/types.h: Likewise. * include/grub/sparc64/ieee1275/console.h: Likewise. * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. * include/grub/sparc64/ieee1275/kernel.h: Likewise. * include/grub/sparc64/ieee1275/time.h: Likewise. * include/grub/util/biosdisk.h: Likewise. * include/grub/util/getroot.h: Likewise. * include/grub/util/lvm.h: Likewise. * include/grub/util/misc.h: Likewise. * include/grub/util/raid.h: Likewise. * include/grub/util/resolve.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. * kern/disk.c: Likewise. * kern/dl.c: Likewise. * kern/elf.c: Likewise. * kern/env.c: Likewise. * kern/err.c: Likewise. * kern/file.c: Likewise. * kern/fs.c: Likewise. * kern/loader.c: Likewise. * kern/main.c: Likewise. * kern/misc.c: Likewise. * kern/mm.c: Likewise. * kern/parser.c: Likewise. * kern/partition.c: Likewise. * kern/rescue.c: Likewise. * kern/term.c: Likewise. * kern/efi/efi.c: Likewise. * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * kern/i386/dl.c: Likewise. * kern/i386/efi/init.c: Likewise. * kern/i386/efi/startup.S: Likewise. * kern/i386/pc/init.c: Likewise. * kern/i386/pc/lzo1x.S: Likewise. * kern/i386/pc/startup.S: Likewise. * kern/ieee1275/ieee1275.c: Likewise. * kern/powerpc/cache.S: Likewise. * kern/powerpc/dl.c: Likewise. * kern/powerpc/ieee1275/cmain.c: Likewise. * kern/powerpc/ieee1275/crt0.S: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * kern/sparc64/cache.S: Likewise. * kern/sparc64/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. * kern/sparc64/ieee1275/openfw.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/efi/linux.c: Likewise. * loader/i386/efi/linux_normal.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/linux_normal.c: Likewise. * loader/i386/pc/multiboot.c: Likewise. * loader/i386/pc/multiboot_normal.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. * normal/arg.c: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/completion.c: Likewise. * normal/execute.c: Likewise. * normal/function.c: Likewise. * normal/lexer.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/menu_entry.c: Likewise. * normal/misc.c: Likewise. * normal/parser.y: Likewise. * normal/script.c: Likewise. * normal/i386/setjmp.S: Likewise. * normal/powerpc/setjmp.S: Likewise. * normal/sparc64/setjmp.S: Likewise. * partmap/acorn.c: Likewise. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/gpt.c: Likewise. * partmap/pc.c: Likewise. * partmap/sun.c: Likewise. * term/gfxterm.c: Likewise. * term/terminfo.c: Likewise. * term/efi/console.c: Likewise. * term/i386/pc/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. * term/ieee1275/ofconsole.c: Likewise. * util/biosdisk.c: Likewise. * util/console.c: Likewise. * util/genmoddep.c: Likewise. * util/getroot.c: Likewise. * util/grub-emu.c: Likewise. * util/grub-mkdevicemap.c: Likewise. * util/grub-probe.c: Likewise. * util/lvm.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. * util/update-grub.in: Likewise. * util/update-grub_lib.in: Likewise. * util/grub.d/00_header.in: Likewise. * util/grub.d/10_hurd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/i386/efi/grub-install.in: Likewise. * util/i386/efi/grub-mkimage.c: Likewise. * util/i386/pc/grub-install.in: Likewise. * util/i386/pc/grub-mkimage.c: Likewise. * util/i386/pc/grub-mkrescue.in: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/i386/pc/misc.c: Likewise. * util/powerpc/ieee1275/grub-install.in: Likewise. * util/powerpc/ieee1275/grub-mkimage.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. * video/bitmap.c: Likewise. * video/video.c: Likewise. * video/i386/pc/vbe.c: Likewise. * video/i386/pc/vbeblit.c: Likewise. * video/i386/pc/vbefill.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> Migrate to GNU General Public License Version 3. * COPYING: Replaced with the plain text version of GPLv3. * config.guess: Updated from gnulib. * config.sub: Likewise. * geninit.sh: Output a GPLv3 copyright notice. * geninitheader.sh: Likewise. * genmodsrc.sh: Likewise. * gensymlist.sh.in: Likewise. * boot/i386/pc/boot.S: Upgraded to GPLv3. * boot/i386/pc/diskboot.S: Likewise. * boot/i386/pc/pxeboot.S: Likewise. * commands/blocklist.c: Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. * commands/configfile.c: Likewise. * commands/echo.c: Likewise. * commands/help.c: Likewise. * commands/ls.c: Likewise. * commands/search.c: Likewise. * commands/terminal.c: Likewise. * commands/test.c: Likewise. * commands/videotest.c: Likewise. * commands/i386/cpuid.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/reboot.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/ieee1275/halt.c: Likewise. * commands/ieee1275/reboot.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * disk/loopback.c: Likewise. * disk/lvm.c: Likewise. * disk/raid.c: Likewise. * disk/efi/efidisk.c: Likewise. * disk/i386/pc/biosdisk.c: Likewise. * disk/ieee1275/ofdisk.c: Likewise. * font/manager.c: Likewise. * fs/affs.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/fshelp.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/sfs.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * hello/hello.c: Likewise. * include/grub/acorn_filecore.h: Likewise. * include/grub/arg.h: Likewise. * include/grub/bitmap.h: Likewise. * include/grub/boot.h: Likewise. * include/grub/cache.h: Likewise. * include/grub/device.h: Likewise. * include/grub/disk.h: Likewise. * include/grub/dl.h: Likewise. * include/grub/elfload.h: Likewise. * include/grub/env.h: Likewise. * include/grub/err.h: Likewise. * include/grub/file.h: Likewise. * include/grub/font.h: Likewise. * include/grub/fs.h: Likewise. * include/grub/fshelp.h: Likewise. * include/grub/gzio.h: Likewise. * include/grub/hfs.h: Likewise. * include/grub/kernel.h: Likewise. * include/grub/loader.h: Likewise. * include/grub/lvm.h: Likewise. * include/grub/misc.h: Likewise. * include/grub/mm.h: Likewise. * include/grub/net.h: Likewise. * include/grub/normal.h: Likewise. * include/grub/parser.h: Likewise. * include/grub/partition.h: Likewise. * include/grub/pc_partition.h: Likewise. * include/grub/raid.h: Likewise. * include/grub/rescue.h: Likewise. * include/grub/script.h: Likewise. * include/grub/setjmp.h: Likewise. * include/grub/symbol.h: Likewise. * include/grub/term.h: Likewise. * include/grub/terminfo.h: Likewise. * include/grub/tparm.h: Likewise. * include/grub/types.h: Likewise. * include/grub/video.h: Likewise. * include/grub/efi/api.h: Likewise. * include/grub/efi/chainloader.h: Likewise. * include/grub/efi/console.h: Likewise. * include/grub/efi/console_control.h: Likewise. * include/grub/efi/disk.h: Likewise. * include/grub/efi/efi.h: Likewise. * include/grub/efi/pe32.h: Likewise. * include/grub/efi/time.h: Likewise. * include/grub/i386/linux.h: Likewise. * include/grub/i386/setjmp.h: Likewise. * include/grub/i386/types.h: Likewise. * include/grub/i386/efi/kernel.h: Likewise. * include/grub/i386/efi/loader.h: Likewise. * include/grub/i386/efi/time.h: Likewise. * include/grub/i386/pc/biosdisk.h: Likewise. * include/grub/i386/pc/boot.h: Likewise. * include/grub/i386/pc/chainloader.h: Likewise. * include/grub/i386/pc/console.h: Likewise. * include/grub/i386/pc/init.h: Likewise. * include/grub/i386/pc/kernel.h: Likewise. * include/grub/i386/pc/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * include/grub/i386/pc/multiboot.h: Likewise. * include/grub/i386/pc/serial.h: Likewise. * include/grub/i386/pc/time.h: Likewise. * include/grub/i386/pc/vbe.h: Likewise. * include/grub/i386/pc/vbeblit.h: Likewise. * include/grub/i386/pc/vbefill.h: Likewise. * include/grub/i386/pc/vbeutil.h: Likewise. * include/grub/i386/pc/vga.h: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. * include/grub/ieee1275/ofdisk.h: Likewise. * include/grub/powerpc/libgcc.h: Likewise. * include/grub/powerpc/setjmp.h: Likewise. * include/grub/powerpc/types.h: Likewise. * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. * include/grub/powerpc/ieee1275/console.h: Likewise. * include/grub/powerpc/ieee1275/ieee1275.h: Likewise. * include/grub/powerpc/ieee1275/kernel.h: Likewise. * include/grub/powerpc/ieee1275/loader.h: Likewise. * include/grub/powerpc/ieee1275/multiboot.h: Likewise. * include/grub/powerpc/ieee1275/time.h: Likewise. * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/grub/sparc64/libgcc.h: Likewise. * include/grub/sparc64/setjmp.h: Likewise. * include/grub/sparc64/types.h: Likewise. * include/grub/sparc64/ieee1275/console.h: Likewise. * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. * include/grub/sparc64/ieee1275/kernel.h: Likewise. * include/grub/sparc64/ieee1275/time.h: Likewise. * include/grub/util/biosdisk.h: Likewise. * include/grub/util/getroot.h: Likewise. * include/grub/util/lvm.h: Likewise. * include/grub/util/misc.h: Likewise. * include/grub/util/raid.h: Likewise. * include/grub/util/resolve.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. * kern/disk.c: Likewise. * kern/dl.c: Likewise. * kern/elf.c: Likewise. * kern/env.c: Likewise. * kern/err.c: Likewise. * kern/file.c: Likewise. * kern/fs.c: Likewise. * kern/loader.c: Likewise. * kern/main.c: Likewise. * kern/misc.c: Likewise. * kern/mm.c: Likewise. * kern/parser.c: Likewise. * kern/partition.c: Likewise. * kern/rescue.c: Likewise. * kern/term.c: Likewise. * kern/efi/efi.c: Likewise. * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * kern/i386/dl.c: Likewise. * kern/i386/efi/init.c: Likewise. * kern/i386/efi/startup.S: Likewise. * kern/i386/pc/init.c: Likewise. * kern/i386/pc/lzo1x.S: Likewise. * kern/i386/pc/startup.S: Likewise. * kern/ieee1275/ieee1275.c: Likewise. * kern/powerpc/cache.S: Likewise. * kern/powerpc/dl.c: Likewise. * kern/powerpc/ieee1275/cmain.c: Likewise. * kern/powerpc/ieee1275/crt0.S: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * kern/sparc64/cache.S: Likewise. * kern/sparc64/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. * kern/sparc64/ieee1275/openfw.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/efi/linux.c: Likewise. * loader/i386/efi/linux_normal.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/linux_normal.c: Likewise. * loader/i386/pc/multiboot.c: Likewise. * loader/i386/pc/multiboot_normal.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. * normal/arg.c: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/completion.c: Likewise. * normal/execute.c: Likewise. * normal/function.c: Likewise. * normal/lexer.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/menu_entry.c: Likewise. * normal/misc.c: Likewise. * normal/parser.y: Likewise. * normal/script.c: Likewise. * normal/i386/setjmp.S: Likewise. * normal/powerpc/setjmp.S: Likewise. * normal/sparc64/setjmp.S: Likewise. * partmap/acorn.c: Likewise. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/gpt.c: Likewise. * partmap/pc.c: Likewise. * partmap/sun.c: Likewise. * term/gfxterm.c: Likewise. * term/terminfo.c: Likewise. * term/efi/console.c: Likewise. * term/i386/pc/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. * term/ieee1275/ofconsole.c: Likewise. * util/biosdisk.c: Likewise. * util/console.c: Likewise. * util/genmoddep.c: Likewise. * util/getroot.c: Likewise. * util/grub-emu.c: Likewise. * util/grub-mkdevicemap.c: Likewise. * util/grub-probe.c: Likewise. * util/lvm.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. * util/update-grub.in: Likewise. * util/update-grub_lib.in: Likewise. * util/grub.d/00_header.in: Likewise. * util/grub.d/10_hurd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/i386/efi/grub-install.in: Likewise. * util/i386/efi/grub-mkimage.c: Likewise. * util/i386/pc/grub-install.in: Likewise. * util/i386/pc/grub-mkimage.c: Likewise. * util/i386/pc/grub-mkrescue.in: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/i386/pc/misc.c: Likewise. * util/powerpc/ieee1275/grub-install.in: Likewise. * util/powerpc/ieee1275/grub-mkimage.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. * video/bitmap.c: Likewise. * video/video.c: Likewise. * video/i386/pc/vbe.c: Likewise. * video/i386/pc/vbeblit.c: Likewise. * video/i386/pc/vbefill.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> Migrate to GNU General Public License Version 3. * COPYING: Replaced with the plain text version of GPLv3. * config.guess: Updated from gnulib. * config.sub: Likewise. * geninit.sh: Output a GPLv3 copyright notice. * geninitheader.sh: Likewise. * genmodsrc.sh: Likewise. * gensymlist.sh.in: Likewise. * boot/i386/pc/boot.S: Upgraded to GPLv3. * boot/i386/pc/diskboot.S: Likewise. * boot/i386/pc/pxeboot.S: Likewise. * commands/blocklist.c: Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. * commands/configfile.c: Likewise. * commands/echo.c: Likewise. * commands/help.c: Likewise. * commands/ls.c: Likewise. * commands/search.c: Likewise. * commands/terminal.c: Likewise. * commands/test.c: Likewise. * commands/videotest.c: Likewise. * commands/i386/cpuid.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/reboot.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/ieee1275/halt.c: Likewise. * commands/ieee1275/reboot.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * disk/loopback.c: Likewise. * disk/lvm.c: Likewise. * disk/raid.c: Likewise. * disk/efi/efidisk.c: Likewise. * disk/i386/pc/biosdisk.c: Likewise. * disk/ieee1275/ofdisk.c: Likewise. * font/manager.c: Likewise. * fs/affs.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/fshelp.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/sfs.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * hello/hello.c: Likewise. * include/grub/acorn_filecore.h: Likewise. * include/grub/arg.h: Likewise. * include/grub/bitmap.h: Likewise. * include/grub/boot.h: Likewise. * include/grub/cache.h: Likewise. * include/grub/device.h: Likewise. * include/grub/disk.h: Likewise. * include/grub/dl.h: Likewise. * include/grub/elfload.h: Likewise. * include/grub/env.h: Likewise. * include/grub/err.h: Likewise. * include/grub/file.h: Likewise. * include/grub/font.h: Likewise. * include/grub/fs.h: Likewise. * include/grub/fshelp.h: Likewise. * include/grub/gzio.h: Likewise. * include/grub/hfs.h: Likewise. * include/grub/kernel.h: Likewise. * include/grub/loader.h: Likewise. * include/grub/lvm.h: Likewise. * include/grub/misc.h: Likewise. * include/grub/mm.h: Likewise. * include/grub/net.h: Likewise. * include/grub/normal.h: Likewise. * include/grub/parser.h: Likewise. * include/grub/partition.h: Likewise. * include/grub/pc_partition.h: Likewise. * include/grub/raid.h: Likewise. * include/grub/rescue.h: Likewise. * include/grub/script.h: Likewise. * include/grub/setjmp.h: Likewise. * include/grub/symbol.h: Likewise. * include/grub/term.h: Likewise. * include/grub/terminfo.h: Likewise. * include/grub/tparm.h: Likewise. * include/grub/types.h: Likewise. * include/grub/video.h: Likewise. * include/grub/efi/api.h: Likewise. * include/grub/efi/chainloader.h: Likewise. * include/grub/efi/console.h: Likewise. * include/grub/efi/console_control.h: Likewise. * include/grub/efi/disk.h: Likewise. * include/grub/efi/efi.h: Likewise. * include/grub/efi/pe32.h: Likewise. * include/grub/efi/time.h: Likewise. * include/grub/i386/linux.h: Likewise. * include/grub/i386/setjmp.h: Likewise. * include/grub/i386/types.h: Likewise. * include/grub/i386/efi/kernel.h: Likewise. * include/grub/i386/efi/loader.h: Likewise. * include/grub/i386/efi/time.h: Likewise. * include/grub/i386/pc/biosdisk.h: Likewise. * include/grub/i386/pc/boot.h: Likewise. * include/grub/i386/pc/chainloader.h: Likewise. * include/grub/i386/pc/console.h: Likewise. * include/grub/i386/pc/init.h: Likewise. * include/grub/i386/pc/kernel.h: Likewise. * include/grub/i386/pc/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * include/grub/i386/pc/multiboot.h: Likewise. * include/grub/i386/pc/serial.h: Likewise. * include/grub/i386/pc/time.h: Likewise. * include/grub/i386/pc/vbe.h: Likewise. * include/grub/i386/pc/vbeblit.h: Likewise. * include/grub/i386/pc/vbefill.h: Likewise. * include/grub/i386/pc/vbeutil.h: Likewise. * include/grub/i386/pc/vga.h: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. * include/grub/ieee1275/ofdisk.h: Likewise. * include/grub/powerpc/libgcc.h: Likewise. * include/grub/powerpc/setjmp.h: Likewise. * include/grub/powerpc/types.h: Likewise. * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. * include/grub/powerpc/ieee1275/console.h: Likewise. * include/grub/powerpc/ieee1275/ieee1275.h: Likewise. * include/grub/powerpc/ieee1275/kernel.h: Likewise. * include/grub/powerpc/ieee1275/loader.h: Likewise. * include/grub/powerpc/ieee1275/multiboot.h: Likewise. * include/grub/powerpc/ieee1275/time.h: Likewise. * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/grub/sparc64/libgcc.h: Likewise. * include/grub/sparc64/setjmp.h: Likewise. * include/grub/sparc64/types.h: Likewise. * include/grub/sparc64/ieee1275/console.h: Likewise. * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. * include/grub/sparc64/ieee1275/kernel.h: Likewise. * include/grub/sparc64/ieee1275/time.h: Likewise. * include/grub/util/biosdisk.h: Likewise. * include/grub/util/getroot.h: Likewise. * include/grub/util/lvm.h: Likewise. * include/grub/util/misc.h: Likewise. * include/grub/util/raid.h: Likewise. * include/grub/util/resolve.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. * kern/disk.c: Likewise. * kern/dl.c: Likewise. * kern/elf.c: Likewise. * kern/env.c: Likewise. * kern/err.c: Likewise. * kern/file.c: Likewise. * kern/fs.c: Likewise. * kern/loader.c: Likewise. * kern/main.c: Likewise. * kern/misc.c: Likewise. * kern/mm.c: Likewise. * kern/parser.c: Likewise. * kern/partition.c: Likewise. * kern/rescue.c: Likewise. * kern/term.c: Likewise. * kern/efi/efi.c: Likewise. * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * kern/i386/dl.c: Likewise. * kern/i386/efi/init.c: Likewise. * kern/i386/efi/startup.S: Likewise. * kern/i386/pc/init.c: Likewise. * kern/i386/pc/lzo1x.S: Likewise. * kern/i386/pc/startup.S: Likewise. * kern/ieee1275/ieee1275.c: Likewise. * kern/powerpc/cache.S: Likewise. * kern/powerpc/dl.c: Likewise. * kern/powerpc/ieee1275/cmain.c: Likewise. * kern/powerpc/ieee1275/crt0.S: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * kern/sparc64/cache.S: Likewise. * kern/sparc64/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. * kern/sparc64/ieee1275/openfw.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/efi/linux.c: Likewise. * loader/i386/efi/linux_normal.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/linux_normal.c: Likewise. * loader/i386/pc/multiboot.c: Likewise. * loader/i386/pc/multiboot_normal.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. * normal/arg.c: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/completion.c: Likewise. * normal/execute.c: Likewise. * normal/function.c: Likewise. * normal/lexer.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/menu_entry.c: Likewise. * normal/misc.c: Likewise. * normal/parser.y: Likewise. * normal/script.c: Likewise. * normal/i386/setjmp.S: Likewise. * normal/powerpc/setjmp.S: Likewise. * normal/sparc64/setjmp.S: Likewise. * partmap/acorn.c: Likewise. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/gpt.c: Likewise. * partmap/pc.c: Likewise. * partmap/sun.c: Likewise. * term/gfxterm.c: Likewise. * term/terminfo.c: Likewise. * term/efi/console.c: Likewise. * term/i386/pc/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. * term/ieee1275/ofconsole.c: Likewise. * util/biosdisk.c: Likewise. * util/console.c: Likewise. * util/genmoddep.c: Likewise. * util/getroot.c: Likewise. * util/grub-emu.c: Likewise. * util/grub-mkdevicemap.c: Likewise. * util/grub-probe.c: Likewise. * util/lvm.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. * util/update-grub.in: Likewise. * util/update-grub_lib.in: Likewise. * util/grub.d/00_header.in: Likewise. * util/grub.d/10_hurd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/i386/efi/grub-install.in: Likewise. * util/i386/efi/grub-mkimage.c: Likewise. * util/i386/pc/grub-install.in: Likewise. * util/i386/pc/grub-mkimage.c: Likewise. * util/i386/pc/grub-mkrescue.in: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/i386/pc/misc.c: Likewise. * util/powerpc/ieee1275/grub-install.in: Likewise. * util/powerpc/ieee1275/grub-mkimage.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. * video/bitmap.c: Likewise. * video/video.c: Likewise. * video/i386/pc/vbe.c: Likewise. * video/i386/pc/vbeblit.c: Likewise. * video/i386/pc/vbefill.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> Migrate to GNU General Public License Version 3. * COPYING: Replaced with the plain text version of GPLv3. * config.guess: Updated from gnulib. * config.sub: Likewise. * geninit.sh: Output a GPLv3 copyright notice. * geninitheader.sh: Likewise. * genmodsrc.sh: Likewise. * gensymlist.sh.in: Likewise. * boot/i386/pc/boot.S: Upgraded to GPLv3. * boot/i386/pc/diskboot.S: Likewise. * boot/i386/pc/pxeboot.S: Likewise. * commands/blocklist.c: Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. * commands/configfile.c: Likewise. * commands/echo.c: Likewise. * commands/help.c: Likewise. * commands/ls.c: Likewise. * commands/search.c: Likewise. * commands/terminal.c: Likewise. * commands/test.c: Likewise. * commands/videotest.c: Likewise. * commands/i386/cpuid.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/reboot.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/ieee1275/halt.c: Likewise. * commands/ieee1275/reboot.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * disk/loopback.c: Likewise. * disk/lvm.c: Likewise. * disk/raid.c: Likewise. * disk/efi/efidisk.c: Likewise. * disk/i386/pc/biosdisk.c: Likewise. * disk/ieee1275/ofdisk.c: Likewise. * font/manager.c: Likewise. * fs/affs.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/fshelp.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/sfs.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * hello/hello.c: Likewise. * include/grub/acorn_filecore.h: Likewise. * include/grub/arg.h: Likewise. * include/grub/bitmap.h: Likewise. * include/grub/boot.h: Likewise. * include/grub/cache.h: Likewise. * include/grub/device.h: Likewise. * include/grub/disk.h: Likewise. * include/grub/dl.h: Likewise. * include/grub/elfload.h: Likewise. * include/grub/env.h: Likewise. * include/grub/err.h: Likewise. * include/grub/file.h: Likewise. * include/grub/font.h: Likewise. * include/grub/fs.h: Likewise. * include/grub/fshelp.h: Likewise. * include/grub/gzio.h: Likewise. * include/grub/hfs.h: Likewise. * include/grub/kernel.h: Likewise. * include/grub/loader.h: Likewise. * include/grub/lvm.h: Likewise. * include/grub/misc.h: Likewise. * include/grub/mm.h: Likewise. * include/grub/net.h: Likewise. * include/grub/normal.h: Likewise. * include/grub/parser.h: Likewise. * include/grub/partition.h: Likewise. * include/grub/pc_partition.h: Likewise. * include/grub/raid.h: Likewise. * include/grub/rescue.h: Likewise. * include/grub/script.h: Likewise. * include/grub/setjmp.h: Likewise. * include/grub/symbol.h: Likewise. * include/grub/term.h: Likewise. * include/grub/terminfo.h: Likewise. * include/grub/tparm.h: Likewise. * include/grub/types.h: Likewise. * include/grub/video.h: Likewise. * include/grub/efi/api.h: Likewise. * include/grub/efi/chainloader.h: Likewise. * include/grub/efi/console.h: Likewise. * include/grub/efi/console_control.h: Likewise. * include/grub/efi/disk.h: Likewise. * include/grub/efi/efi.h: Likewise. * include/grub/efi/pe32.h: Likewise. * include/grub/efi/time.h: Likewise. * include/grub/i386/linux.h: Likewise. * include/grub/i386/setjmp.h: Likewise. * include/grub/i386/types.h: Likewise. * include/grub/i386/efi/kernel.h: Likewise. * include/grub/i386/efi/loader.h: Likewise. * include/grub/i386/efi/time.h: Likewise. * include/grub/i386/pc/biosdisk.h: Likewise. * include/grub/i386/pc/boot.h: Likewise. * include/grub/i386/pc/chainloader.h: Likewise. * include/grub/i386/pc/console.h: Likewise. * include/grub/i386/pc/init.h: Likewise. * include/grub/i386/pc/kernel.h: Likewise. * include/grub/i386/pc/loader.h: Likewise. * include/grub/i386/pc/memory.h: Likewise. * include/grub/i386/pc/multiboot.h: Likewise. * include/grub/i386/pc/serial.h: Likewise. * include/grub/i386/pc/time.h: Likewise. * include/grub/i386/pc/vbe.h: Likewise. * include/grub/i386/pc/vbeblit.h: Likewise. * include/grub/i386/pc/vbefill.h: Likewise. * include/grub/i386/pc/vbeutil.h: Likewise. * include/grub/i386/pc/vga.h: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. * include/grub/ieee1275/ofdisk.h: Likewise. * include/grub/powerpc/libgcc.h: Likewise. * include/grub/powerpc/setjmp.h: Likewise. * include/grub/powerpc/types.h: Likewise. * include/grub/powerpc/ieee1275/biosdisk.h: Likewise. * include/grub/powerpc/ieee1275/console.h: Likewise. * include/grub/powerpc/ieee1275/ieee1275.h: Likewise. * include/grub/powerpc/ieee1275/kernel.h: Likewise. * include/grub/powerpc/ieee1275/loader.h: Likewise. * include/grub/powerpc/ieee1275/multiboot.h: Likewise. * include/grub/powerpc/ieee1275/time.h: Likewise. * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/grub/sparc64/libgcc.h: Likewise. * include/grub/sparc64/setjmp.h: Likewise. * include/grub/sparc64/types.h: Likewise. * include/grub/sparc64/ieee1275/console.h: Likewise. * include/grub/sparc64/ieee1275/ieee1275.h: Likewise. * include/grub/sparc64/ieee1275/kernel.h: Likewise. * include/grub/sparc64/ieee1275/time.h: Likewise. * include/grub/util/biosdisk.h: Likewise. * include/grub/util/getroot.h: Likewise. * include/grub/util/lvm.h: Likewise. * include/grub/util/misc.h: Likewise. * include/grub/util/raid.h: Likewise. * include/grub/util/resolve.h: Likewise. * io/gzio.c: Likewise. * kern/device.c: Likewise. * kern/disk.c: Likewise. * kern/dl.c: Likewise. * kern/elf.c: Likewise. * kern/env.c: Likewise. * kern/err.c: Likewise. * kern/file.c: Likewise. * kern/fs.c: Likewise. * kern/loader.c: Likewise. * kern/main.c: Likewise. * kern/misc.c: Likewise. * kern/mm.c: Likewise. * kern/parser.c: Likewise. * kern/partition.c: Likewise. * kern/rescue.c: Likewise. * kern/term.c: Likewise. * kern/efi/efi.c: Likewise. * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * kern/i386/dl.c: Likewise. * kern/i386/efi/init.c: Likewise. * kern/i386/efi/startup.S: Likewise. * kern/i386/pc/init.c: Likewise. * kern/i386/pc/lzo1x.S: Likewise. * kern/i386/pc/startup.S: Likewise. * kern/ieee1275/ieee1275.c: Likewise. * kern/powerpc/cache.S: Likewise. * kern/powerpc/dl.c: Likewise. * kern/powerpc/ieee1275/cmain.c: Likewise. * kern/powerpc/ieee1275/crt0.S: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * kern/sparc64/cache.S: Likewise. * kern/sparc64/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. * kern/sparc64/ieee1275/openfw.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/efi/linux.c: Likewise. * loader/i386/efi/linux_normal.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/linux_normal.c: Likewise. * loader/i386/pc/multiboot.c: Likewise. * loader/i386/pc/multiboot_normal.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. * normal/arg.c: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/completion.c: Likewise. * normal/execute.c: Likewise. * normal/function.c: Likewise. * normal/lexer.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/menu_entry.c: Likewise. * normal/misc.c: Likewise. * normal/parser.y: Likewise. * normal/script.c: Likewise. * normal/i386/setjmp.S: Likewise. * normal/powerpc/setjmp.S: Likewise. * normal/sparc64/setjmp.S: Likewise. * partmap/acorn.c: Likewise. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/gpt.c: Likewise. * partmap/pc.c: Likewise. * partmap/sun.c: Likewise. * term/gfxterm.c: Likewise. * term/terminfo.c: Likewise. * term/efi/console.c: Likewise. * term/i386/pc/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. * term/ieee1275/ofconsole.c: Likewise. * util/biosdisk.c: Likewise. * util/console.c: Likewise. * util/genmoddep.c: Likewise. * util/getroot.c: Likewise. * util/grub-emu.c: Likewise. * util/grub-mkdevicemap.c: Likewise. * util/grub-probe.c: Likewise. * util/lvm.c: Likewise. * util/misc.c: Likewise. * util/raid.c: Likewise. * util/resolve.c: Likewise. * util/update-grub.in: Likewise. * util/update-grub_lib.in: Likewise. * util/grub.d/00_header.in: Likewise. * util/grub.d/10_hurd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/i386/efi/grub-install.in: Likewise. * util/i386/efi/grub-mkimage.c: Likewise. * util/i386/pc/grub-install.in: Likewise. * util/i386/pc/grub-mkimage.c: Likewise. * util/i386/pc/grub-mkrescue.in: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/i386/pc/misc.c: Likewise. * util/powerpc/ieee1275/grub-install.in: Likewise. * util/powerpc/ieee1275/grub-mkimage.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. * video/bitmap.c: Likewise. * video/video.c: Likewise. * video/i386/pc/vbe.c: Likewise. * video/i386/pc/vbeblit.c: Likewise. * video/i386/pc/vbefill.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
/* SPECIAL NOTES!
Please note following when reading the code below:
- In this driver we assume that every memory can be accessed by same memory
bus. If there are different address spaces do not use this code as a base
code for other archs.
- Every function in this code assumes that bounds checking has been done in
previous phase and they are opted out in here. */
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
#include <grub/video_fb.h>
#include <grub/fbblit.h>
#include <grub/fbutil.h>
#include <grub/misc.h>
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
#include <grub/types.h>
#include <grub/video.h>
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Generic replacing blitter (slow). Works for every supported format. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y, int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t src_red;
grub_uint8_t src_green;
grub_uint8_t src_blue;
grub_uint8_t src_alpha;
grub_video_color_t src_color;
grub_video_color_t dst_color;
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
src_color = get_pixel (src, i + offset_x, j + offset_y);
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
&src_blue, &src_alpha);
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
dst_color = grub_video_fb_map_rgba (src_red, src_green,
src_blue, src_alpha);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
set_pixel (dst, x + i, y + j, dst_color);
}
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Block copy replacing blitter. Works with modes multiple of 8 bits. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y, int width, int height,
int offset_x, int offset_y)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
int j;
grub_uint32_t *srcptr;
grub_uint32_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
int bpp;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
bpp = src->mode_info->bytes_per_pixel;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
for (j = 0; j < height; j++)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_memmove (dstptr, srcptr, width * bpp);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, src->mode_info->pitch);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dst->mode_info->pitch);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
}
}
/* Optimized replacing blitter for 1-bit to 32bit. */
static void
grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint32_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint32_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr & srcmask)
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = fgcolor;
else
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = bgcolor;
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr++;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
#ifdef GRUB_HAVE_UNALIGNED_ACCESS
/* Optimized replacing blitter for 1-bit to 24-bit. */
static void
grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint32_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width - 1; i++)
{
if (*srcptr & srcmask)
*(grub_uint32_t *) dstptr = fgcolor;
else
*(grub_uint32_t *) dstptr = bgcolor;
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
dstptr += 3;
}
if (*srcptr & srcmask)
{
*dstptr++ = fgcolor & 0xff;
*dstptr++ = (fgcolor & 0xff00) >> 8;
*dstptr++ = (fgcolor & 0xff0000) >> 16;
}
else
{
*dstptr++ = bgcolor & 0xff;
*dstptr++ = (bgcolor & 0xff00) >> 8;
*dstptr++ = (bgcolor & 0xff0000) >> 16;
}
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
dstptr += dstrowskip;
}
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
#endif
/* Optimized replacing blitter for 1-bit to 16-bit. */
static void
grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint16_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint16_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr & srcmask)
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = fgcolor;
else
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = bgcolor;
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr++;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized replacing blitter for 1-bit to 8-bit. */
static void
grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint8_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr & srcmask)
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = fgcolor;
else
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = bgcolor;
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
dstptr++;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
dstptr += dstrowskip;
}
}
static void
grub_video_fbblit_replace_32bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint32_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint32_t palette[17];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr == 0xf0)
*dstptr = palette[16];
else
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized replacing blitter for 1-bit to 16bit. */
static void
grub_video_fbblit_replace_24bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint32_t palette[17];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
register grub_uint32_t col;
if (*srcptr == 0xf0)
col = palette[16];
else
col = palette[*srcptr & 0xf];
#ifdef GRUB_CPU_WORDS_BIGENDIAN
*dstptr++ = col >> 16;
*dstptr++ = col >> 8;
*dstptr++ = col >> 0;
#else
*dstptr++ = col >> 0;
*dstptr++ = col >> 8;
*dstptr++ = col >> 16;
#endif
srcptr++;
}
srcptr += srcrowskip;
dstptr += dstrowskip;
}
}
/* Optimized replacing blitter for 1-bit to 16bit. */
static void
grub_video_fbblit_replace_16bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint16_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint16_t palette[17];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr == 0xf0)
*dstptr = palette[16];
else
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized replacing blitter for 1-bit to 8bit. */
static void
grub_video_fbblit_replace_8bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint8_t palette[17];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
palette[16] = grub_video_fb_map_rgba (0, 0, 0, 0);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr == 0xf0)
*dstptr = palette[16];
else
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
dstptr += dstrowskip;
}
}
static void
grub_video_fbblit_blend_32bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint32_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint32_t palette[16];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr != 0xf0)
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized replacing blitter for 1-bit to 16bit. */
static void
grub_video_fbblit_blend_24bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint32_t palette[16];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
register grub_uint32_t col;
if (*srcptr != 0xf0)
{
col = palette[*srcptr & 0xf];
#ifdef GRUB_CPU_WORDS_BIGENDIAN
*dstptr++ = col >> 16;
*dstptr++ = col >> 8;
*dstptr++ = col >> 0;
#else
*dstptr++ = col >> 0;
*dstptr++ = col >> 8;
*dstptr++ = col >> 16;
#endif
}
else
dstptr += 3;
srcptr++;
}
srcptr += srcrowskip;
dstptr += dstrowskip;
}
}
/* Optimized replacing blitter for 1-bit to 16bit. */
static void
grub_video_fbblit_blend_16bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint16_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint16_t palette[17];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr != 0xf0)
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized replacing blitter for 1-bit to 8bit. */
static void
grub_video_fbblit_blend_8bit_indexa (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
unsigned int dstrowskip;
unsigned int srcrowskip;
grub_uint8_t palette[16];
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskip = src->mode_info->pitch - width;
for (i = 0; i < 16; i++)
palette[i] = grub_video_fb_map_color (i);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
if (*srcptr != 0xf0)
*dstptr = palette[*srcptr & 0xf];
srcptr++;
dstptr++;
}
srcptr += srcrowskip;
dstptr += dstrowskip;
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGBX8888 to BGRX8888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int srcrowskip;
unsigned int dstrowskip;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
#ifdef GRUB_CPU_WORDS_BIGENDIAN
grub_uint8_t a = *srcptr++;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t r = *srcptr++;
grub_uint8_t g = *srcptr++;
grub_uint8_t b = *srcptr++;
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t a = *srcptr++;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
#ifdef GRUB_CPU_WORDS_BIGENDIAN
*dstptr++ = a;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = b;
*dstptr++ = g;
*dstptr++ = r;
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = a;
#endif
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
srcptr += srcrowskip;
dstptr += dstrowskip;
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGB888 to BGRX8888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t *srcptr;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int srcrowskip;
unsigned int dstrowskip;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (i = 0; i < width; i++)
{
grub_uint8_t r = *srcptr++;
grub_uint8_t g = *srcptr++;
grub_uint8_t b = *srcptr++;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
#ifdef GRUB_CPU_WORDS_BIGENDIAN
/* Set alpha component as opaque. */
*dstptr++ = 255;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = b;
*dstptr++ = g;
*dstptr++ = r;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Set alpha component as opaque. */
*dstptr++ = 255;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
srcptr += srcrowskip;
dstptr += dstrowskip;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGBX8888 to BGR888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int srcrowskip;
unsigned int dstrowskip;
int i;
int j;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t color;
grub_uint8_t sr;
grub_uint8_t sg;
grub_uint8_t sb;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
color = *srcptr++;
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
#ifdef GRUB_CPU_WORDS_BIGENDIAN
*dstptr++ = sr;
*dstptr++ = sg;
*dstptr++ = sb;
#else
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = sb;
*dstptr++ = sg;
*dstptr++ = sr;
#endif
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dstptr += dstrowskip;
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGB888 to BGR888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint8_t *srcptr;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int srcrowskip;
unsigned int dstrowskip;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (i = 0; i < width; i++)
{
grub_uint8_t r = *srcptr++;
grub_uint8_t g = *srcptr++;
grub_uint8_t b = *srcptr++;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = b;
*dstptr++ = g;
*dstptr++ = r;
}
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
srcptr += srcrowskip;
dstptr += dstrowskip;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGB888 to RGBX8888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
grub_uint32_t color;
int i;
int j;
grub_uint8_t *srcptr;
grub_uint32_t *dstptr;
unsigned int sr;
unsigned int sg;
unsigned int sb;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 3 * width;
dstrowskip = dst->mode_info->pitch - 4 * width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
#ifdef GRUB_CPU_WORDS_BIGENDIAN
sb = *srcptr++;
sg = *srcptr++;
sr = *srcptr++;
#else
sr = *srcptr++;
sg = *srcptr++;
sb = *srcptr++;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Set alpha as opaque. */
color = 0xFF000000 | (sb << 16) | (sg << 8) | sr;
*dstptr++ = color;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGBX8888 to RGB888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t color;
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int sr;
unsigned int sg;
unsigned int sb;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
srcrowskip = src->mode_info->pitch - 4 * width;
dstrowskip = dst->mode_info->pitch - 3 * width;
for (j = 0; j < height; j++)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (i = 0; i < width; i++)
{
color = *srcptr++;
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = sr;
*dstptr++ = sg;
*dstptr++ = sb;
#else
*dstptr++ = sb;
*dstptr++ = sg;
*dstptr++ = sr;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGBX8888 to indexed color. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
grub_uint32_t color;
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
unsigned int sr;
unsigned int sg;
unsigned int sb;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 4 * width;
dstrowskip = dst->mode_info->pitch - width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
color = *srcptr++;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
color = grub_video_fb_map_rgb(sr, sg, sb);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = color & 0xFF;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized replacing blitter for RGB888 to indexed color. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t color;
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
unsigned int sr;
unsigned int sg;
unsigned int sb;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 3 * width;
dstrowskip = dst->mode_info->pitch - width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
for (j = 0; j < height; j++)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (i = 0; i < width; i++)
{
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
sr = *srcptr++;
sg = *srcptr++;
sb = *srcptr++;
#else
sb = *srcptr++;
sg = *srcptr++;
sr = *srcptr++;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
color = grub_video_fb_map_rgb(sr, sg, sb);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = color & 0xFF;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Generic blending blitter. Works for every supported format. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y, int width, int height,
int offset_x, int offset_y)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
int i;
int j;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
grub_uint8_t src_red;
grub_uint8_t src_green;
grub_uint8_t src_blue;
grub_uint8_t src_alpha;
grub_uint8_t dst_red;
grub_uint8_t dst_green;
grub_uint8_t dst_blue;
grub_uint8_t dst_alpha;
grub_video_color_t src_color;
grub_video_color_t dst_color;
src_color = get_pixel (src, i + offset_x, j + offset_y);
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
&src_blue, &src_alpha);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
if (src_alpha == 0)
continue;
if (src_alpha == 255)
{
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
dst_color = grub_video_fb_map_rgba (src_red, src_green,
src_blue, src_alpha);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
set_pixel (dst, x + i, y + j, dst_color);
continue;
}
dst_color = get_pixel (dst, x + i, y + j);
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fb_unmap_color_int (dst, dst_color, &dst_red,
&dst_green, &dst_blue, &dst_alpha);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
dst_red = (((src_red * src_alpha)
+ (dst_red * (255 - src_alpha))) / 255);
dst_green = (((src_green * src_alpha)
+ (dst_green * (255 - src_alpha))) / 255);
dst_blue = (((src_blue * src_alpha)
+ (dst_blue * (255 - src_alpha))) / 255);
dst_alpha = src_alpha;
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue,
dst_alpha);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
set_pixel (dst, x + i, y + j, dst_color);
}
}
}
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Optimized blending blitter for RGBA8888 to BGRA8888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
grub_uint32_t *srcptr;
grub_uint32_t *dstptr;
unsigned int srcrowskip;
unsigned int dstrowskip;
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
int i;
int j;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
grub_uint32_t color;
unsigned int sr;
unsigned int sg;
unsigned int sb;
unsigned int a;
unsigned int dr;
unsigned int dg;
unsigned int db;
color = *srcptr++;
a = color >> 24;
if (a == 0)
{
/* Skip transparent source pixels. */
dstptr++;
continue;
}
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
if (a == 255)
{
/* Opaque pixel shortcut. */
dr = sr;
dg = sg;
db = sb;
}
else
{
/* General pixel color blending. */
color = *dstptr;
dr = (color >> 16) & 0xFF;
dr = (dr * (255 - a) + sr * a) / 255;
dg = (color >> 8) & 0xFF;
dg = (dg * (255 - a) + sg * a) / 255;
db = (color >> 0) & 0xFF;
db = (db * (255 - a) + sb * a) / 255;
}
color = (a << 24) | (dr << 16) | (dg << 8) | db;
*dstptr++ = color;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
}
/* Optimized blending blitter for RGBA8888 to BGR888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
unsigned int srcrowskip;
unsigned int dstrowskip;
int i;
int j;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width;
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
grub_uint32_t color;
unsigned int sr;
unsigned int sg;
unsigned int sb;
unsigned int a;
unsigned int dr;
unsigned int dg;
unsigned int db;
color = *srcptr++;
a = color >> 24;
if (a == 0)
{
/* Skip transparent source pixels. */
dstptr += 3;
continue;
}
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
if (a == 255)
{
/* Opaque pixel shortcut. */
dr = sr;
dg = sg;
db = sb;
}
else
{
/* General pixel color blending. */
color = *dstptr;
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
db = dstptr[0];
dg = dstptr[1];
dr = dstptr[2];
#else
dr = dstptr[0];
dg = dstptr[1];
db = dstptr[2];
#endif
db = (db * (255 - a) + sb * a) / 255;
dg = (dg * (255 - a) + sg * a) / 255;
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dr = (dr * (255 - a) + sr * a) / 255;
}
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = db;
*dstptr++ = dg;
*dstptr++ = dr;
#else
*dstptr++ = dr;
*dstptr++ = dg;
*dstptr++ = db;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dstptr += dstrowskip;
}
}
/* Optimized blending blitter for RGBA888 to RGBA8888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
grub_uint32_t color;
int i;
int j;
grub_uint32_t *srcptr;
grub_uint32_t *dstptr;
unsigned int sr;
unsigned int sg;
unsigned int sb;
unsigned int a;
unsigned int dr;
unsigned int dg;
unsigned int db;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 4 * width;
dstrowskip = dst->mode_info->pitch - 4 * width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
color = *srcptr++;
a = color >> 24;
if (a == 0)
{
dstptr++;
continue;
}
if (a == 255)
{
*dstptr++ = color;
continue;
}
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
color = *dstptr;
dr = (color >> 0) & 0xFF;
dg = (color >> 8) & 0xFF;
db = (color >> 16) & 0xFF;
dr = (dr * (255 - a) + sr * a) / 255;
dg = (dg * (255 - a) + sg * a) / 255;
db = (db * (255 - a) + sb * a) / 255;
color = (a << 24) | (db << 16) | (dg << 8) | dr;
*dstptr++ = color;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
}
/* Optimized blending blitter for RGBA8888 to RGB888. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
grub_uint32_t color;
int i;
int j;
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
unsigned int sr;
unsigned int sg;
unsigned int sb;
unsigned int a;
unsigned int dr;
unsigned int dg;
unsigned int db;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 4 * width;
dstrowskip = dst->mode_info->pitch - 3 * width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2006-07-29 Vesa Jaaskelainen <chaac@nic.fi> * include/grub/bitmap.h: New file. * include/grub/i386/pc/vbeutil.h: Likewise. * video/bitmap.c: Likewise. * video/readers/tga.c: Likewise. * video/i386/pc/vbeutil.c: Likewise. * commands/videotest.c: Code cleanup and updated to reflect to new video API. * term/gfxterm.c: Likewise. * video/video.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod. (vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c. (bitmap_mod_SOURCES): New entry. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. * include/grub/video.h (grub_video_blit_operators): New enum type. (grub_video_render_target): Changed as forward declaration and moved actual definition to be video driver specific. (grub_video_adapter.blit_bitmap): Added blitting operator. (grub_video_adapter.blit_render_target): Likewise. (grub_video_blit_bitmap): Likewise. (grub_video_blit_render_target): Likewise. * include/grub/i386/pc/vbe.h (grub_video_render_target): Added driver specific render target definition. (grub_video_vbe_map_rgba): Added driver internal helper. (grub_video_vbe_unmap_color): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_get_video_ptr): Likewise. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_blend): Added generic blitter for blend operator. (grub_video_i386_vbeblit_replace): Added generic blitter for replace operator. * video/i386/pc/vbeblit.c: Updated to reflect changes on include/grub/i386/pc/vbeblit.h. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8): Updated to use grub_video_i386_vbeblit_info. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill): Added generic filler. * video/i386/pc/vbefill.c: Updated to reflect changes on include/grub/i386/pc/vbefill.h. * video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use grub_video_i386_vbeblit_info. (grub_video_vbe_unmap_color): Likewise. (grub_video_vbe_blit_glyph): Likewise. (grub_video_vbe_scroll): Likewise. (grub_video_vbe_draw_pixel): Removed function. (grub_video_vbe_get_pixel): Likewise. (grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and updated code to use it. (common_blitter): Added common blitter for render target and bitmap. (grub_video_vbe_blit_bitmap): Updated to use common_blitter. (grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
for (j = 0; j < height; j++)
{
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (i = 0; i < width; i++)
{
color = *srcptr++;
a = color >> 24;
if (a == 0)
{
dstptr += 3;
continue;
}
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
if (a == 255)
{
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = sr;
*dstptr++ = sg;
*dstptr++ = sb;
#else
*dstptr++ = sb;
*dstptr++ = sg;
*dstptr++ = sr;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
continue;
}
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dr = dstptr[0];
dg = dstptr[1];
db = dstptr[2];
#else
db = dstptr[0];
dg = dstptr[1];
dr = dstptr[2];
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dr = (dr * (255 - a) + sr * a) / 255;
dg = (dg * (255 - a) + sg * a) / 255;
db = (db * (255 - a) + sb * a) / 255;
#ifndef GRUB_CPU_WORDS_BIGENDIAN
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = dr;
*dstptr++ = dg;
*dstptr++ = db;
#else
*dstptr++ = db;
*dstptr++ = dg;
*dstptr++ = dr;
#endif
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
}
}
/* Optimized blending blitter for RGBA8888 to indexed color. */
static void
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
{
grub_uint32_t color;
int i;
int j;
grub_uint32_t *srcptr;
grub_uint8_t *dstptr;
unsigned int sr;
unsigned int sg;
unsigned int sb;
unsigned int a;
unsigned char dr;
unsigned char dg;
unsigned char db;
unsigned char da;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_size_t srcrowskip;
grub_size_t dstrowskip;
srcrowskip = src->mode_info->pitch - 4 * width;
dstrowskip = dst->mode_info->pitch - width;
srcptr = grub_video_fb_get_video_ptr (src, offset_x, offset_y);
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
color = *srcptr++;
a = color >> 24;
if (a == 0)
{
dstptr++;
continue;
}
sr = (color >> 0) & 0xFF;
sg = (color >> 8) & 0xFF;
sb = (color >> 16) & 0xFF;
if (a == 255)
{
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
color = grub_video_fb_map_rgb(sr, sg, sb);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = color & 0xFF;
continue;
}
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
dr = (dr * (255 - a) + sr * a) / 255;
dg = (dg * (255 - a) + sg * a) / 255;
db = (db * (255 - a) + sb * a) / 255;
2009-08-14 Vladimir Serbinenko <phcoder@gmail.com> Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
2009-08-14 12:41:58 +00:00
color = grub_video_fb_map_rgb(dr, dg, db);
2008-09-07 Vesa Jääskeläinen <chaac@nic.fi> Based on patch created by Colin D Bennett <colin@gibibit.com>. Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types.
2008-09-07 15:55:58 +00:00
*dstptr++ = color & 0xFF;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (srcptr, srcrowskip);
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized blending blitter for 1-bit to XXXA8888. */
static void
grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint32_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint32_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
grub_uint32_t color;
grub_uint8_t a;
if (*srcptr & srcmask)
{
color = fgcolor;
a = src->mode_info->fg_alpha;
}
else
{
color = bgcolor;
a = src->mode_info->bg_alpha;
}
if (a == 255)
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = color;
else if (a != 0)
{
grub_uint8_t s1 = (color >> 0) & 0xFF;
grub_uint8_t s2 = (color >> 8) & 0xFF;
grub_uint8_t s3 = (color >> 16) & 0xFF;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint8_t d1 = (*dstptr >> 0) & 0xFF;
grub_uint8_t d2 = (*dstptr >> 8) & 0xFF;
grub_uint8_t d3 = (*dstptr >> 16) & 0xFF;
d1 = (d1 * (255 - a) + s1 * a) / 255;
d2 = (d2 * (255 - a) + s2 * a) / 255;
d3 = (d3 * (255 - a) + s3 * a) / 255;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = (a << 24) | (d3 << 16) | (d2 << 8) | d1;
}
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr++;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* Optimized blending blitter for 1-bit to XXX888. */
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
#ifdef GRUB_HAVE_UNALIGNED_ACCESS
static void
grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
grub_uint8_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint32_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
grub_uint32_t color;
grub_uint8_t a;
if (*srcptr & srcmask)
{
color = fgcolor;
a = src->mode_info->fg_alpha;
}
else
{
color = bgcolor;
a = src->mode_info->bg_alpha;
}
if (a == 255)
{
#ifndef GRUB_CPU_WORDS_BIGENDIAN
((grub_uint8_t *) dstptr)[0] = color & 0xff;
((grub_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8;
((grub_uint8_t *) dstptr)[2] = (color & 0xff0000) >> 16;
#else
((grub_uint8_t *) dstptr)[2] = color & 0xff;
((grub_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8;
((grub_uint8_t *) dstptr)[0] = (color & 0xff0000) >> 16;
#endif
}
else if (a != 0)
{
grub_uint8_t s1 = (color >> 0) & 0xFF;
grub_uint8_t s2 = (color >> 8) & 0xFF;
grub_uint8_t s3 = (color >> 16) & 0xFF;
grub_uint8_t d1 = (*(grub_uint32_t *) dstptr >> 0) & 0xFF;
grub_uint8_t d2 = (*(grub_uint32_t *) dstptr >> 8) & 0xFF;
grub_uint8_t d3 = (*(grub_uint32_t *) dstptr >> 16) & 0xFF;
((grub_uint8_t *) dstptr)[0] = (d1 * (255 - a) + s1 * a) / 255;
((grub_uint8_t *) dstptr)[1] = (d2 * (255 - a) + s2 * a) / 255;
((grub_uint8_t *) dstptr)[2] = (d3 * (255 - a) + s3 * a) / 255;
}
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
dstptr += 3;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
dstptr += dstrowskip;
}
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
#endif
/* Optimized blending blitter for 1-bit to XXX888. */
static void
grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst,
struct grub_video_fbblit_info *src,
int x, int y,
int width, int height,
int offset_x, int offset_y)
{
int i;
int j;
grub_uint8_t *srcptr;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint16_t *dstptr;
grub_uint8_t srcmask;
unsigned int dstrowskip;
unsigned int srcrowskipbyte, srcrowskipbit;
grub_uint16_t fgcolor, bgcolor;
int bit_index;
/* Calculate the number of bytes to advance from the end of one line
to the beginning of the next line. */
dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
srcrowskipbyte = (src->mode_info->width - width) >> 3;
srcrowskipbit = (src->mode_info->width - width) & 7;
bit_index = offset_y * src->mode_info->width + offset_x;
srcptr = (grub_uint8_t *) src->data + (bit_index >> 3);
srcmask = 1 << (~bit_index & 7);
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr = grub_video_fb_get_video_ptr (dst, x, y);
fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red,
src->mode_info->fg_green,
src->mode_info->fg_blue,
src->mode_info->fg_alpha);
bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red,
src->mode_info->bg_green,
src->mode_info->bg_blue,
src->mode_info->bg_alpha);
for (j = 0; j < height; j++)
{
for (i = 0; i < width; i++)
{
grub_uint32_t color;
grub_uint8_t a;
if (*srcptr & srcmask)
{
color = fgcolor;
a = src->mode_info->fg_alpha;
}
else
{
color = bgcolor;
a = src->mode_info->bg_alpha;
}
if (a == 255)
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = color;
else if (a != 0)
{
grub_uint8_t s1 = (color >> 0) & 0x1F;
grub_uint8_t s2 = (color >> 5) & 0x3F;
grub_uint8_t s3 = (color >> 11) & 0x1F;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
grub_uint8_t d1 = (*dstptr >> 0) & 0x1F;
grub_uint8_t d2 = (*dstptr >> 5) & 0x3F;
grub_uint8_t d3 = (*dstptr >> 11) & 0x1F;
d1 = (d1 * (255 - a) + s1 * a) / 255;
d2 = (d2 * (255 - a) + s2 * a) / 255;
d3 = (d3 * (255 - a) + s3 * a) / 255;
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
*dstptr = (d1 & 0x1f) | ((d2 & 0x3f) << 5) | ((d3 & 0x1f) << 11);
}
srcmask >>= 1;
if (!srcmask)
{
srcptr++;
srcmask = 0x80;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
dstptr++;
}
srcptr += srcrowskipbyte;
if (srcmask >> srcrowskipbit)
srcmask >>= srcrowskipbit;
else
{
srcptr++;
srcmask <<= 8 - srcrowskipbit;
}
Fix video on platforms where unaligned access is forbidden. Make several optimisations while on it. * grub-core/video/fb/fbblit.c (grub_video_fbblit_replace_directN): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_32bit_1bit): Likewise. (grub_video_fbblit_replace_24bit_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_replace_16bit_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGRX8888_RGB888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGBX8888): Likewise. (grub_video_fbblit_replace_BGR888_RGB888): Likewise. (grub_video_fbblit_replace_RGBX8888_RGB88): Likewise. (grub_video_fbblit_replace_RGB888_RGBX888): Likewise. (grub_video_fbblit_replace_RGB888_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGBX8888): Likewise. (grub_video_fbblit_replace_index_RGB888): Likewise. (grub_video_fbblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_BGR888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. (grub_video_fbblit_blend_index_RGBA8888): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit) [!GRUB_HAVE_UNALIGNED_ACCESS]: Disable. (grub_video_fbblit_blend_XXX565_1bit): Optimise and use GRUB_VIDEO_FB_ADVANCE_POINTER. * grub-core/video/fb/fbfill.c (grub_video_fbfill_direct32): Likewise. * grub-core/video/fb/fbutil.c (grub_video_fb_get_video_ptr): Return void *. * grub-core/video/fb/video_fb.c (common_blitter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Skip disabled blitters. (grub_video_fb_create_render_target_from_pointer) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment. * include/grub/fbutil.h (grub_video_fb_get_video_ptr): Return void *. * include/grub/i386/types.h (GRUB_HAVE_UNALIGNED_ACCESS): New definition. * include/grub/x86_64/types.h (GRUB_HAVE_UNALIGNED_ACCESS): Likewise.
2011-12-13 19:07:33 +00:00
GRUB_VIDEO_FB_ADVANCE_POINTER (dstptr, dstrowskip);
}
}
/* NOTE: This function assumes that given coordinates are within bounds of
handled data. */
void
grub_video_fb_dispatch_blit (struct grub_video_fbblit_info *target,
struct grub_video_fbblit_info *source,
enum grub_video_blit_operators oper, int x, int y,
unsigned int width, unsigned int height,
int offset_x, int offset_y)
{
if (oper == GRUB_VIDEO_BLIT_REPLACE)
{
/* Try to figure out more optimized version for replace operator. */
switch (source->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
grub_video_fbblit_replace_directN (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
grub_video_fbblit_replace_BGRX8888_RGBX8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
grub_video_fbblit_replace_BGR888_RGBX8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
grub_video_fbblit_replace_RGB888_RGBX8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
grub_video_fbblit_replace_index_RGBX8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
grub_video_fbblit_replace_BGRX8888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
grub_video_fbblit_replace_RGBX8888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
grub_video_fbblit_replace_BGR888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
grub_video_fbblit_replace_directN (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
grub_video_fbblit_replace_index_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
grub_video_fbblit_replace_directN (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
grub_video_fbblit_replace_directN (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
switch (target->mode_info->bytes_per_pixel)
{
case 4:
grub_video_fbblit_replace_32bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 3:
grub_video_fbblit_replace_24bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 2:
grub_video_fbblit_replace_16bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 1:
grub_video_fbblit_replace_8bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED:
switch (target->mode_info->bytes_per_pixel)
{
case 4:
grub_video_fbblit_replace_32bit_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
#ifdef GRUB_HAVE_UNALIGNED_ACCESS
case 3:
grub_video_fbblit_replace_24bit_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
#endif
case 2:
grub_video_fbblit_replace_16bit_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 1:
grub_video_fbblit_replace_8bit_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
}
break;
default:
break;
}
/* No optimized replace operator found, use default (slow) blitter. */
grub_video_fbblit_replace (target, source, x, y, width, height,
offset_x, offset_y);
}
else
{
/* Try to figure out more optimized blend operator. */
switch (source->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
grub_video_fbblit_blend_BGRA8888_RGBA8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
grub_video_fbblit_blend_RGBA8888_RGBA8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
grub_video_fbblit_blend_BGR888_RGBA8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
grub_video_fbblit_blend_RGB888_RGBA8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
grub_video_fbblit_blend_index_RGBA8888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
/* Note: There is really no alpha information here, so blend is
changed to replace. */
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
grub_video_fbblit_replace_BGRX8888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
grub_video_fbblit_replace_RGBX8888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
grub_video_fbblit_replace_BGR888_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
grub_video_fbblit_replace_directN (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR:
grub_video_fbblit_replace_index_RGB888 (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED:
switch (target->mode_info->blit_format)
{
case GRUB_VIDEO_BLIT_FORMAT_BGRA_8888:
case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888:
grub_video_fbblit_blend_XXXA8888_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
#ifdef GRUB_HAVE_UNALIGNED_ACCESS
case GRUB_VIDEO_BLIT_FORMAT_BGR_888:
case GRUB_VIDEO_BLIT_FORMAT_RGB_888:
grub_video_fbblit_blend_XXX888_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
#endif
case GRUB_VIDEO_BLIT_FORMAT_BGR_565:
case GRUB_VIDEO_BLIT_FORMAT_RGB_565:
grub_video_fbblit_blend_XXX565_1bit (target, source,
x, y, width, height,
offset_x, offset_y);
return;
default:
break;
}
break;
case GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA:
switch (target->mode_info->bytes_per_pixel)
{
case 4:
grub_video_fbblit_blend_32bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 3:
grub_video_fbblit_blend_24bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 2:
grub_video_fbblit_blend_16bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
case 1:
grub_video_fbblit_blend_8bit_indexa (target, source,
x, y, width, height,
offset_x, offset_y);
return;
}
break;
default:
break;
}
/* No optimized blend operation found, use default (slow) blitter. */
grub_video_fbblit_blend (target, source, x, y, width, height,
offset_x, offset_y);
}
}