From: Juliusz Chroboczek <jch@irif.fr>
To: Francis Bolduc <fbolduc@gmail.com>
Cc: galene@lists.galene.org
Subject: [Galene] Re: Blur background
Date: Sun, 05 May 2024 22:47:47 +0200 [thread overview]
Message-ID: <87ikzsdlzg.wl-jch@irif.fr> (raw)
In-Reply-To: <CAHpL4=j3Adh4nF-HpNZyR7i=qC0aZKJQBUYTg=qCRuCyG2MPzg@mail.gmail.com>
> Yes, loading 3rdparty libraries is conceptually insecure. I initially
> tried to download the Javascript libraries and wasm modules to serve
> them via Galene, but failed because they refer to each other via full
> URL instead of relative paths when you load them. I also tried to
> download their source code and build them myself, but my head exploded
> when I saw the kind of build system those libraries have.
Yeah, these are the two reasons I've been waiting for Chrome to implement
native background blur [1], but that effort appears to have been abandoned.
[1] https://chromestatus.com/feature/5077577782263808
>>> + offscreen = new OffscreenCanvas(1920, 1080);
>> This should be done lazily, in the filter, not at startup.
> Not sure what you mean. How would you do this?
Two ways. One is to add a function 'init' to your filter definition:
'blur-background':
description: "Blur Background",
init: initBlurBackground,
f: blurBackground,
},
and then, in initBlurBackground, instantiate a new field in your filter:
function initBlurBackground(ctx) {
this.offscreen = new OffscreenCanvas(...)
...
The other solution is to simply do the initialisation in the main function
of the filter:
if(!(offscreen in this)) {
this.offscreen = new OffscreenCanvas(...)
...
In either case, the data structures are only created when the filter is
first invoked, which means that only users who use your filter pay the
cost of initialisation.
-- Juliusz
next prev parent reply other threads:[~2024-05-05 20:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 18:56 [Galene] " Francis Bolduc
2024-05-05 19:14 ` [Galene] " Juliusz Chroboczek
2024-05-05 19:35 ` Francis Bolduc
2024-05-05 20:47 ` Juliusz Chroboczek [this message]
2024-05-05 21:49 ` Francis Bolduc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.galene.org/postorius/lists/galene.lists.galene.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikzsdlzg.wl-jch@irif.fr \
--to=jch@irif.fr \
--cc=fbolduc@gmail.com \
--cc=galene@lists.galene.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox