~egonelbre

Recent activity

Re: App size vs constraints 24 days ago

From Egon Elbre to ~eliasnaur/gio

https://pkg.go.dev/gioui.org/unit#Metric contains PxPerDp and PxPerSp.
It could be useful to add `DpToPx` and `SpToPx` methods.

+ Egon

On Fri, Sep 2, 2022 at 8:09 PM Jon Egil Strand
<jon.egil.strand@gmail.com> wrote:
>
> Hi
>
> While maintaining my egg-timer I noticed the previous centered egg now
> had moved to the left of center.
>
> The size of the app is hardcoded to 400x600

Re: Surprising Gio Vulkan vs. OpenGL Performance a month ago

From Egon Elbre to ~eliasnaur/gio

Ah, I just noticed that there's a link at the end of the email to the
pprof files.

On Mon, Aug 15, 2022 at 8:54 AM Egon Elbre <egonelbre@gmail.com> wrote:
>
> Can you try inspecting the differences in the profiling output
> with `-cpuprofile cpu.prof` and `go tool pprof`? It's easier to figure
> these things out based on the profile.
>
> Can you try testing things with `-tags nox11`?
>
> + Egon
>
> On Sat, Aug 13, 2022 at 4:11 PM Chris Waldon

Re: Surprising Gio Vulkan vs. OpenGL Performance a month ago

From Egon Elbre to ~eliasnaur/gio

Can you try inspecting the differences in the profiling output
with `-cpuprofile cpu.prof` and `go tool pprof`? It's easier to figure
these things out based on the profile.

Can you try testing things with `-tags nox11`?

+ Egon

On Sat, Aug 13, 2022 at 4:11 PM Chris Waldon
<christopher.waldon.dev@gmail.com> wrote:
>
> Hey all,
>
> I randomly happened to try building one of my applications yesterday

Re: scrolling a outlay.FlowWrap ? 2 months ago

From Egon Elbre to ~eliasnaur/gio

In this case I would probably implement a custom scrolling and list
that can make smarter decisions based on the batches and number of
items.

For the most basic wrapping logic, you can take a look at
https://github.com/egonelbre/expgio/blob/main/wrap/main.go#L72.

If you change up the implementation such that it also has a separate
call "measure", you can calculate the layout of items without having
to render them. This does mean, there's an efficient way to load the
measurements of images upfront.

Once you know the layout, you can render only those items that are
actually in the view. (i.e. top or bottom edge of the image is in

Re: scrolling a outlay.FlowWrap ? 2 months ago

From Egon Elbre to ~eliasnaur/gio

One way to add predictive loading to that async loader example is to
use `List.Position.First` and `List.Position.First + .Count` then
trigger loading to items that are beyond those.

> throttling the actual loading of the resource (and only load resources that are "about to be in the viewport")

I'm not quite sure, whether I understand you correctly, but currently
the async loading is only triggered for things that are rendered.

However, you trigger loading, either through `widget.List` or by other
means, you could hit a scenario where you initially use a zero size
widget, which would mean all items are visible... which would trigger
loading all the items.

Re: scrolling a outlay.FlowWrap ? 2 months ago

From Egon Elbre to ~eliasnaur/gio

For async loading take a look at
https://github.com/egonelbre/expgio/tree/master/async-loading

+ Egon

On Wed, Jul 6, 2022 at 11:24 AM Sebastien Binet <s@sbinet.org> wrote:
>
> On Tue Jul 5, 2022 at 22:21 CET, Chris Waldon wrote:
> > On Tue, Jul 5, 2022 at 3:23 AM Sebastien Binet <s@sbinet.org> wrote:
> > >
> > > On Mon Jul 4, 2022 at 20:36 CET, Sebastien Binet wrote:
> > > > hi there,
> > > >
> > > > I am probably holding it wrong, but is it possible to scroll a very

Re: [PATCH gio 5/5] internal/ops: optimize Decode 2 months ago

From Egon Elbre to ~eliasnaur/gio-patches

Not that I know of, I was mainly focused on making the compiled output
nicer at the moment.

+ Egon


+ Egon

On Sat, Jul 2, 2022 at 9:19 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> Merged, although unfortunate. Is there a Go issue for tracking this kind of
> inefficiency?
>
> Elias

Re: Performance expectations 3 months ago

From Egon Elbre to ~eliasnaur/gio

Yes, paths can be disconnected.

https://go.dev/play/p/fy5scYZnd0Y


On Mon, Jun 27, 2022 at 11:27 AM Dominik Honnef <dominik@honnef.co> wrote:
>
> Thank you for your detailed response.
>
> Elias Naur <mail@eliasnaur.com> writes:
>
> > glxgears is not a great comparison, because of its low scene complexity.
> > As for 3D seemingly more performant than 2D, see [0] and [1]. Basically,
> > GPUs are not designed for 2D (CPUs less so, of course).

Re: Performance expectations 3 months ago

From Egon Elbre to ~eliasnaur/gio

With regards to cgocheck, one significant optimization would be to avoid passing
the whole glFunctions
(https://git.sr.ht/~eliasnaur/gio/tree/main/item/internal/gl/gl_unix.go#L37).
Go needs to check all pointery things passed into a C func.
So, if it were just a single func ptr, it wouldn't need to check all the fields.

+ Egon

On Mon, Jun 27, 2022 at 9:26 AM Elias Naur <mail@eliasnaur.com> wrote:
>
> Hi Dominik
>
> Thank you for your demonstration and careful analysis.
>

Re: LinearGradient and RadialGradient 4 months ago

From Egon Elbre to ~eliasnaur/gio

I'm not quite sure what you mean by `angle` in this context?

For linear gradient it allows to specify start and end,
which don't have to be either horizontal or vertical.
Or in other words, it already supports an angle.

With regards to radial gradients I have a proof of concept at:
https://github.com/egonelbre/gio/tree/radial and discussion
https://github.com/gioui/gio/pull/28.

The basic idea is the same, that you provide the center and a major axis
edge point... + eccentricity (for ellipses). Then use the distance to calculate
the appropriate value.