Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nw0p0-0008F5-Vn for mharc-grub-devel@gnu.org; Tue, 31 May 2022 08:18:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw0ot-0008A6-Fu for grub-devel@gnu.org; Tue, 31 May 2022 08:17:56 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:33785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nw0os-0004Ey-02 for grub-devel@gnu.org; Tue, 31 May 2022 08:17:55 -0400 Received: by mail-pg1-x52e.google.com with SMTP id r71so12730166pgr.0 for ; Tue, 31 May 2022 05:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=5Bo5YsMKPjHZwfXDE5VGcNcH6nflWOiUWYGfXZ/XkkM=; b=o12uMG8GTPL6bKyf+WfbkN5vi+W6MS2zVorbyPVC6w4PHPXBCIvi+Rfs9PiTPsGbGS YRYwOlJ6Kam/GLUyDODTAl7XfRTGpkHEq403ITQgDgfMZ0Sy+StkmOPmAqVYK+G/fQ3h zrx7vohlNtKYvvOLibKPMMDl2HH4p2SyCXhYZD7Cv1DqqZba0H6iFW8WMIv3XIWoztaK D9RoVn07fq4Dj14BKx8Crtrd4kBvY9OJeSIjNVTLqsHRlVJE6UVo+/Co+Cq4rq4ZpyaN tPWI4d5ILwOW4ZBSxXjbEuLXK872wm/0fjYxG14KPDhb9fejhEGUX1WJou6UW2gzXIpe RtGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=5Bo5YsMKPjHZwfXDE5VGcNcH6nflWOiUWYGfXZ/XkkM=; b=FRJCT3wBr5/pbrOkM032UhOeSg4Nd4rvkwwAiM4VO9af4gPxR4eUiOHB7LW3Kw0Sl5 Kpj7is/I/4/15ZbQdu0sv60UCOPmsWeUd1A7lvpgvzMpWqafr+ZBRtlsUL+oq9QwtR+x JrmbDYUCfm7ZHyVoj63IA4DUaLqLzfwIA/JojV0UbWO7W6j0gkq6pDqqBUZOGA39rebt 7133KGGwywbSL/HF85Zn8QtM1W1a3lIWcTSAlB7PRMPNMdKV8bsnjqmglPC9HeCVhdMk ha/OVNfeUVi/hsS9vZCH7p9IEEFmq3evkk6pVBBJYRdF4JGIwE1Eg04/NJjtckZzCS0z A5Gw== X-Gm-Message-State: AOAM5338fvCdTGubi74JBX8kyo/Oz13CwDpzlhjkEBOL5B1OqiGK37bN YnpMR6uedrsIVi32xE6+A+I= X-Google-Smtp-Source: ABdhPJzQIoP8Lhf9asrprzS7atAFxUb4FNaNFmh57pWCTP827kUS4l6xfsb0VtVus57qDLsPvButVQ== X-Received: by 2002:a63:8aca:0:b0:3f9:f9ed:7426 with SMTP id y193-20020a638aca000000b003f9f9ed7426mr41614711pgd.176.1653999472616; Tue, 31 May 2022 05:17:52 -0700 (PDT) Received: from [0.0.0.0] (ec2-13-113-80-70.ap-northeast-1.compute.amazonaws.com. [13.113.80.70]) by smtp.gmail.com with ESMTPSA id n16-20020aa79050000000b00518c6887217sm10519577pfo.58.2022.05.31.05.17.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 05:17:52 -0700 (PDT) Message-ID: <7a0e991c-d04b-d2b1-64b0-2adc84fbdedf@gmail.com> Date: Tue, 31 May 2022 20:17:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 1/2] font: Add font scaling feature to grub_font_draw_glyph() Content-Language: en-US To: Gerd Hoffmann , The development of GNU GRUB References: <20220531104450.427508-1-zhangboyang.id@gmail.com> <20220531113655.n3wamp4iaar7gyoe@sirius.home.kraxel.org> From: Zhang Boyang In-Reply-To: <20220531113655.n3wamp4iaar7gyoe@sirius.home.kraxel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=zhangboyang.id@gmail.com; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2022 12:17:57 -0000 Hi, In fact it is pretty "fast" because only the displayed glyphs are scaled. That's a very small subset of the whole font. It will be slower if we scale every glyph when loading the font. Also, the scale factor are hard to determine at font loading time, because the video driver may haven't been loaded at that time. It is possible to cache the scaled glyphs, so only one scaling pass is needed for one glyph. But this will not change the computational complexity because the drawing algorithm itself is O(n) and scaling is also O(n). So I think we can optimize later if this simple-but-slow scaling code become performance bottleneck. Best Regards, Zhang Boyang On 2022/5/31 19:36, Gerd Hoffmann wrote: > Hi, > >> + /* FIXME: Scale bitmap pixel by pixel is slow */ > > So how about doing the scaling when loading the font, > so you have to do it only once? > > take care, > Gerd >