| Message ID | 20251003165525.440173-12-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510594; bh=MyatTUS/WK1bRF+uMwXOykXYRM5uX+ZbVS+x0fcQ72Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lkCqT9MoDgjY9qa89AWzAaGWpD063CzqHDE823kbrmLYHJNPz2/69Qi9YMR4eUrNE BbNMmb/jrEBlZunYNdhq4IZTXCdWa/8ScB9mB/uz2Ch+rOhQ5D59AeDNsZ2jxcIQsg W6p9L1UUA3HmRi+F+8jO+GrPSOq5j1q4L604SUwzSI82oWcgGJQy8W0Lw8yQkCGlC0 Bk3i0Lt5OKu8yvL7r86CsudzerziNl3uUx+ky2yv+4SiT/kQTS1mbDsgF5LktNP9mL AQr0IYUOeQ8pvSlh3KLtMsiEkzW5X6HzSj254q9S1EJgkKEXY2W9M4A3hEGeemHaCa w8pgKsTRvsv2w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7B4FF67E85 for <u-boot-concept@u-boot.org>; Fri, 3 Oct 2025 10:56:34 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6GBMq8gQ20I2 for <u-boot-concept@u-boot.org>; Fri, 3 Oct 2025 10:56:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510594; bh=MyatTUS/WK1bRF+uMwXOykXYRM5uX+ZbVS+x0fcQ72Y=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lkCqT9MoDgjY9qa89AWzAaGWpD063CzqHDE823kbrmLYHJNPz2/69Qi9YMR4eUrNE BbNMmb/jrEBlZunYNdhq4IZTXCdWa/8ScB9mB/uz2Ch+rOhQ5D59AeDNsZ2jxcIQsg W6p9L1UUA3HmRi+F+8jO+GrPSOq5j1q4L604SUwzSI82oWcgGJQy8W0Lw8yQkCGlC0 Bk3i0Lt5OKu8yvL7r86CsudzerziNl3uUx+ky2yv+4SiT/kQTS1mbDsgF5LktNP9mL AQr0IYUOeQ8pvSlh3KLtMsiEkzW5X6HzSj254q9S1EJgkKEXY2W9M4A3hEGeemHaCa w8pgKsTRvsv2w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 67CAB67E82 for <u-boot-concept@u-boot.org>; Fri, 3 Oct 2025 10:56:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510592; bh=tNLi0W4ZVmKYc+kkEXr4Wz4+Rm8iXQthS7LL5Fo9n1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgl97sVdgkwLnqrXULF7tf8kblOMf/+yY6RY60C01wmoPDZubic9jQEFdL4e1pd7N qNExr7Kz7vXsVV4gkMlguGXVZKYsRMyD0CrsvxkNaDo6+ME0zQR1xOKUCFKaclozjS aHbtJv6sqdbKkllXFVkaA1jDlSYtgIuvWF+yjcafxlKLYvxcTijOK03k2C8dzR+d3X wZfBJpAbGZcDqAz0KqJ+EoPMVHqAWJxyA5YGkeOLRXdtzFErzPoUzdStfLlyXhDOmK rnpA+xl/9zxeze5Zr3wlhjj+dcJSeJ3CjAXE71DJPU2bIon6q1Nl7B92cgRu1YlGzt 6RMLK7eCDqg3w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0114B67E82; Fri, 3 Oct 2025 10:56:32 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id WIvoyZCgvmR7; Fri, 3 Oct 2025 10:56:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510589; bh=YjkE3loZhvxgSSfjTogfLTiWkpKrhEFRx4Od50l25bQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCPBFkmF00h6iWL4aOpvJhFvt8nk33ox7IcpK7hYdSYFgdoo+v2H9YACyw7qC8cud Br+WfEzIDhzYwQVumBlU5MXGCn/6tMy3PVICSj2xKGYT+gKoxqeGPdNuBOhUDXJ8qn hR79/pBdIIOqqot3U2My0tC2lxeIOb+GUj2EB8u36QTfb23MeDTyZqfFG0X7AudMt3 0OsnxwpRB2fEOf4guQ+DfmDJoMNf4M12578E2euJlkz3d5MqCaAgps+/EUoeBAvt00 8Trbefj52E5bji4lphiAu2D/Ki+sAvir9gckyACPWYEy4XhxD4Qb4SxppSm1GpEAC0 d8AVs7bvc8efw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C2F4367F49; Fri, 3 Oct 2025 10:56:28 -0600 (MDT) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Fri, 3 Oct 2025 10:55:04 -0600 Message-ID: <20251003165525.440173-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251003165525.440173-1-sjg@u-boot.org> References: <20251003165525.440173-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UWSUA3KXKVE5PJYQQECRUFPCSFJGLPJH X-Message-ID-Hash: UWSUA3KXKVE5PJYQQECRUFPCSFJGLPJH X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <sjg@chromium.org> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/22] video: Support transparency with 24bpp BMP image List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/UWSUA3KXKVE5PJYQQECRUFPCSFJGLPJH/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
video: Enhancements to support a pointer
|
|
Commit Message
Simon Glass
Oct. 3, 2025, 4:55 p.m. UTC
From: Simon Glass <sjg@chromium.org> When the pixel colour matches the transparency colour, skip writing it to the display. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/video/video_bmp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index 88a327e4a6d..9c9d9b2091b 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -388,6 +388,15 @@ static int draw_bmp(struct udevice *dev, ulong bmp_image, int x, int y, u8 red = bmap[0]; u8 green = bmap[1]; u8 blue = bmap[2]; + u32 pixel_color = (red << 16) | + (green << 8) | blue; + + bmap += 3; + /* Skip transparent pixels if alpha enabled */ + if (alpha && pixel_color == acolour) { + fb += bpix / 8; + continue; + } if (bpix == 16) { /* 16bit 565RGB format */ @@ -423,7 +432,6 @@ static int draw_bmp(struct udevice *dev, ulong bmp_image, int x, int y, *fb++ = blue; *fb++ = 0; } - bmap += 3; } fb -= priv->line_length + width * (bpix / 8); bmap += (padded_width - width);