From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PU2kS-0006rY-TF for mharc-grub-devel@gnu.org; Sat, 18 Dec 2010 14:47:20 -0500 Received: from [140.186.70.92] (port=55510 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PU2kQ-0006r7-DV for grub-devel@gnu.org; Sat, 18 Dec 2010 14:47:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PU2kH-0005By-2v for grub-devel@gnu.org; Sat, 18 Dec 2010 14:47:13 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:51524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PU2kG-0005Bm-Sz for grub-devel@gnu.org; Sat, 18 Dec 2010 14:47:09 -0500 Received: by wyj26 with SMTP id 26so1843108wyj.0 for ; Sat, 18 Dec 2010 11:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=xZ7Isyh7drCNwE34S7MGSjzP+U+ShqU//5XSAP2HlKI=; b=U4JpUKy9W6JLOdTqiZc+TRxXT7vHmyeP2MPd+ATP18kWj/IIf7UjKE+iAUshr3JoZm V5Vu8ikGHby8yRUuEXESIsMn5++9fofUhnm5PzxkNSkNaUWDKngwkDI11d57aBbld5E1 DelC30uinXSSGxhmCIsVLZi7EqtXLaHAOxPxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=YEkv5QVeeqxxQN5q1BUiKBVW6mXiqsWcVTLa5S9W3IXPglWGO8cHLa0DEWm3d6+12A Yg/qITHtu6zuBUUSeiitPBWEtNIa9hnfnR6b63qAlvcAV+yKDKcfG/0EIfCQoEP5aLCG ZdnXCBiQeWuH8s8tpDcd7VCi4AmKfBCijBdEk= Received: by 10.216.187.71 with SMTP id x49mr2969359wem.111.1292701626407; Sat, 18 Dec 2010 11:47:06 -0800 (PST) Received: from debian.bg45.phnet (229-110.62-81.cust.bluewin.ch [81.62.110.229]) by mx.google.com with ESMTPS id 7sm941180wet.0.2010.12.18.11.47.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 18 Dec 2010 11:47:05 -0800 (PST) Message-ID: <4D0D0FA6.6000703@gmail.com> Date: Sat, 18 Dec 2010 20:46:46 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101211 Icedove/3.0.11 MIME-Version: 1.0 To: grub-devel@gnu.org References: <20101210123941.GX21862@riva.ucam.org> <20101210175342.GA686@riva.ucam.org> In-Reply-To: <20101210175342.GA686@riva.ucam.org> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig25DBE4FF05F963596904139E" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] background_color command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:47:19 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig25DBE4FF05F963596904139E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/10/2010 06:53 PM, Colin Watson wrote: > > module =3D { > + name =3D video_colors; > + common =3D video/colors.c; > + enable =3D videomodules; > +}; > =20 Both main users of video (gfxmenu and gfxterm) use color routines. So I feel like video/colors.c can go into video.mod > > + /* Create a filled bitmap so that we get suitable text blending. */= > + grub_video_bitmap_create (&bitmap, window.width, window.height, > + GRUB_VIDEO_BLIT_FORMAT_RGB_888); > + if (grub_errno !=3D GRUB_ERR_NONE) > + return grub_errno; > =20 You should check the return value and not grub_errno. > + > =20 It would be more optimal if in this case the image would be saved simply as the color rather than a filled array and use grub_video_fill_rect when this image is supposed to be blitted. also it would be neat to be able to specify the bgcolor around non-stretched image. > + data =3D bitmap->data; > + for (i =3D 0; i < window.height * window.width; i++) > + { > + *data++ =3D color.red; > + *data++ =3D color.green; > + *data++ =3D color.blue; > + } > + > =20 grub_video_fill_rect is the function for such kind of operations. > + bitmap_width =3D window.width; > + bitmap_height =3D window.height; > + > + /* Set the border color. */ > + virtual_screen.bg_color_display =3D grub_video_map_rgba_color (color= ); > + > + /* Mark whole screen as dirty. */ > + dirty_region_add (0, 0, window.width, window.height); > + > + /* All was ok. */ > + grub_errno =3D GRUB_ERR_NONE; > =20 You shouldn't discard grub_errno manually unless there is an error you want to ignore. > + return grub_errno; > =20 I'd rather use return GRUB_ERR_NONE; --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig25DBE4FF05F963596904139E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF0EAREKAAYFAk0ND6YACgkQNak7dOguQgmE9gEAlB3QGEOOJE+mgzBbsge7u/D2 Mdoa3inupfvZZLSNHscA93tJM2uvDZsN5kGfmVToD2F24gkp0Ggn0rxMwUSGw1o= =YNqh -----END PGP SIGNATURE----- --------------enig25DBE4FF05F963596904139E--