From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Thu Jan 2 11:45:58 EST 2020 Received: from abbatoir.fios-router.home (pool-96-239-17-137.nycmny.fios.verizon.net [96.239.17.137]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id c46e11e9 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Thu, 2 Jan 2020 08:45:49 -0800 (PST) Message-ID: <84247256F02174D48607DE3E6E63F615@eigenstate.org> To: jamos@oboj.net, ori@eigenstate.org CC: 9front@9front.org Subject: Re: [9front] Netsurf 3.9 for Plan 9 (work in progress) Date: Thu, 2 Jan 2020 08:45:47 -0800 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: shared secure session just-in-time blockchain-aware frontend > On 2020-01-02 00:57, ori@eigenstate.org wrote: > >> I get a garbled image (see attached). > > This is the most common display, alas. > It is possible to tweak a web page in > order for it to display slightly more > beutifully, that is the file 9html/full.html. > > https://webbkurs.ei.hv.se/~imjam/plan9/full_html.png > > This is how full.html looks for me. > As soon as the bars does not span the whole > screen, the picture comes out of sync. As > an interesting note, the test programs for > the framebuffer driver works as expected > (e.g. bitmap/plottest/etc.) I see the problem: loaded = loadimage(drawstate->srvimage, r, drawstate->localimage, drawstate->imagebytes); The rectangle here is just the portion of the screen that's changed, so, eg, a 30x30 icon or something. But drawstate->localimage is the full view. So, you're uploading the first bunch of pixels of the image instead of the region you want to draw. Changing the code to create a rectangle representing the whole local image and uploading it ungarbles it: all.min.x = 0; all.min.y = 0; all.max.x = 800; all.max.y = 600; loaded = loadimage(drawstate->srvimage, all, drawstate->localimage, drawstate->imagebytes); For efficiency, we would really want a strided load image, but if there's a native plan 9 gui, that becoems a moot point. Other comments: box->x0, box->y0, box->x1 - box->x0, box->y1 - box->y0 box is just a 'Rectangle', so you can convert once and just pass the resulting 'r' around: r.min.x = box->x0; r.min.y = box->y0; r.max.x = box->x1; r.max.y = box->y1; update_and_redraw_srvimage(drawstate, r); >> The garbled image doesn't change with >> respect to window size. > > Yes, the framebuffer size is set at > initialisation, it is set to 800x600. > > Jonas