These are chat archives for AvaloniaUI/Avalonia

12th
Apr 2018
Jumar Macato
@jmacato
Apr 12 2018 06:36
guys, what do you think will it take for our Matrix class to accept 3d matrices? would it require a complete rewrite of the rendering backend or would it be just a drop in improvement?
Steven Kirk
@grokys
Apr 12 2018 08:14
not sure tbh... for 3D transforms?
i think we should be able to express 3D transforms using 2D matrices?
given that our interface is 2D
danwalmsley
@danwalmsley
Apr 12 2018 08:22
Just add an extra row and column
And change the multiplication method
I have a multiplication method for any size matrix somewhere Il dig it out
When I'm on my pc
Steven Kirk
@grokys
Apr 12 2018 08:23
add extra row and column where?
Jumar Macato
@jmacato
Apr 12 2018 08:24
@grokys yeah sir, for 3D transforms
since WPF has one, we could probably use one too
Steven Kirk
@grokys
Apr 12 2018 08:25
WPF has a 3D matrix because it has 3D support though
Jumar Macato
@jmacato
Apr 12 2018 08:25
and also some people might use it for perspective transforms
and page flipping effects
i see..
Steven Kirk
@grokys
Apr 12 2018 08:26
i'm no expert on this though
hmm yeah it seems that CSS has 3D matrices
so i guess we should have them

http://www.useragentman.com/blog/2015/07/16/augment-photos-with-css3-matrix3d-transforms/

Note that the Matrix Construction Set has been around for a while for doing 2D matrix()transforms. Over the years, Federico Brigante, Gerard Delmàs and others have requested a 3D version since the 2D matrix() function only allows you to manipulate three corners of a rectangle, while 3D ones allow manipulation of all four.

The one drawback is with matrix3d() (and 3D transforms in general) is that a bitmap of the original, un-transformed object is transformed, including fonts. 2D transforms will transform typography’s vector data, resulting in crisper results:

ok so that's why you need 3D matrices even with a 2D UI
Jumar Macato
@jmacato
Apr 12 2018 08:29
yes sir, even if we only do them for rendertransforms, they would be quite useful
Steven Kirk
@grokys
Apr 12 2018 08:31
would we need 3D transform support at the renderer level then? or would 3D transforms be translated into 2D?
Jumar Macato
@jmacato
Apr 12 2018 08:32
the former sir, i dont think simply converting them to 2d transforms would cut it
the backends probably has support for it already and we may just need to pass them the matrices but i am no expert at them...
and has .NETStandard 2.0 nuget :)
Jumar Macato
@jmacato
Apr 12 2018 09:32
@wieslawsoltes that looks cool!
Steven Kirk
@grokys
Apr 12 2018 09:51
i'd be wary about adding a dependency to get a 3D matrix. people complain about dependencies
those people have never developed in nodejs ;)
Jumar Macato
@jmacato
Apr 12 2018 09:55
indeed sir, bloat should be avoided as much as possible
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 09:56
We can always copy the parts we need
Matthijs ter Woord
@mterwoord
Apr 12 2018 09:59
embedded the references is also possible..
danwalmsley
@danwalmsley
Apr 12 2018 10:25
@jmacato here is a generic matrix multiplication method
private static ColorMatrix Multiply(float[][] matrix1, float[][] matrix2)
        {
            int size = 5; // multiplies 2 5x5 matrices.

            // build up an empty 5x5 array for results
            float[][] result = new float[size][];
            for (int row = 0; row < size; row++)
            {
                result[row] = new float[size];
            }

            float[] column = new float[size];
            for (int j = 0; j < size; j++)
            {
                for (int k = 0; k < size; k++)
                {
                    column[k] = matrix1[k][j];
                }
                for (int i = 0; i < size; i++)
                {
                    float[] row = matrix2[i];
                    float s = 0;
                    for (int k = 0; k < size; k++)
                    {
                        s += row[k] * column[k];
                    }
                    result[i][j] = s;
                }
            }

            return new ColorMatrix(result);
        }
Jumar Macato
@jmacato
Apr 12 2018 10:26
@danwalmsley nice!
danwalmsley
@danwalmsley
Apr 12 2018 10:26
this is some code I wrote for ColorMatrix recently
which works on R,G,B
Darren R. Starr
@darrenstarr
Apr 12 2018 10:27
@danwalmsley Lovely but scary... any chance you've run that through VTune?
Jumar Macato
@jmacato
Apr 12 2018 10:27
it'd be cool if you can incorporate System.Numerics.Vectors
danwalmsley
@danwalmsley
Apr 12 2018 10:27
you can replace R,G,B with X,Y,Z
Matthijs ter Woord
@mterwoord
Apr 12 2018 10:27
@jmacato jit is scaringly intelligent in optimizing things though
danwalmsley
@danwalmsley
Apr 12 2018 10:28
@darrenstarr whats vtune?
Jumar Macato
@jmacato
Apr 12 2018 10:28
@mterwoord yeah, does dotnet's JIT use SSE SIMD instructions?
Darren R. Starr
@darrenstarr
Apr 12 2018 10:28
It's Intel's profiler for Visual Studio (including C#), it quite a bit better than Microsoft's
danwalmsley
@danwalmsley
Apr 12 2018 10:28
ah ok
no iv not done that
im sure its maybe not the most efficient
Jumar Macato
@jmacato
Apr 12 2018 10:29
@danwalmsley i wish i have seen your colormatrix code yesterday
i was working with the ColorTransitions on the animations branch
danwalmsley
@danwalmsley
Apr 12 2018 10:29
but I guess its the actual application of the matrix you need to be optimized
Darren R. Starr
@darrenstarr
Apr 12 2018 10:29
The JIT does to a limited extent offer AVX2 optimization. Though it's not really designed for that. I've been thinking for years of spending some time on adding a few curiously missing optimizations. I think there's a risk of increasing the compilation complexity of the JIT too much though.
danwalmsley
@danwalmsley
Apr 12 2018 10:30
@jmacato I noticed gdi++ has colour matrix but wpf doesnt seem to
Darren R. Starr
@darrenstarr
Apr 12 2018 10:30
Of course, if you're doing a lot of it, there's some useful stuff in the Direct2D code for it.
danwalmsley
@danwalmsley
Apr 12 2018 10:30
iv been working on something where we needed to white balance photos which was why I wrote that
but I think color matrixes you can get gpu to apply them
Darren R. Starr
@darrenstarr
Apr 12 2018 10:30
@jmacato Last time I used it (a few weeks ago) I can swear I was multiplying matrices using just plain old * operators
Jumar Macato
@jmacato
Apr 12 2018 10:30
@darrenstarr i see, as i've seen/read, the numerics vector package does convert vector operations into SIMD instructions but i'm not too privy about it
oooh
danwalmsley
@danwalmsley
Apr 12 2018 10:31
@jmacato the matrix class I posted has * operator
but underneath its the method I posted
so you can do
scaleMatrix * rotateMatrix
same as the 2d ones in avalonia
Darren R. Starr
@darrenstarr
Apr 12 2018 10:32
I need to convince the boss to buy me a license to VTune before long.
Jumar Macato
@jmacato
Apr 12 2018 10:32
@danwalmsley quite neat! but would it work with perspective transforms? my linear algebra is a bit rusty nowadays
danwalmsley
@danwalmsley
Apr 12 2018 10:33
it should do, the only part of that logic im not sure about is the bit where you apply it
give me an hour or so i'll try and knock something together
Jumar Macato
@jmacato
Apr 12 2018 10:34
sure, have a look at my PR too if it's alright
Darren R. Starr
@darrenstarr
Apr 12 2018 10:34
@danwalmsley I'm heading to Build in a few weeks and I'm hoping to make a plan with @migueldeicaza to setup a Microsoft Garage project (as well as Telenor on my side) to make a 2d compositor which works with 3D space... so while all drawing operations would be the typical 2D operations, Z will always be considered.
Jumar Macato
@jmacato
Apr 12 2018 10:34
@danwalmsley i was thinking of adding alternative interpolation modes to the color transitions and keyframe animations, CSS only uses Premultiplied RGB space to interpolate between colors
and its a bit inaccurate, perception-wise
Jumar Macato
@jmacato
Apr 12 2018 10:35
i planned to use HSV and LAB as intermediate color spaces
Darren R. Starr
@darrenstarr
Apr 12 2018 10:35
@jmacato haha I think most of us generally suck at linear algebra, but once you get the basic transforms into a library, it pretty much takes care of itself.
Jumar Macato
@jmacato
Apr 12 2018 10:35
but i digressed since i want to follow K.I.S.S. principle hahaha
Darren R. Starr
@darrenstarr
Apr 12 2018 10:35
Ugh... have to stop talking... I need to work
Jumar Macato
@jmacato
Apr 12 2018 10:35
@darrenstarr yes! hahaha, thank heavens for stackoverflow's math stuff whenever i forget math algo's :)
danwalmsley
@danwalmsley
Apr 12 2018 10:36
@jmacato id use that Matrix3d class @wieslawsoltes has just posted
Jumar Macato
@jmacato
Apr 12 2018 10:36
@wieslawsoltes UWP has them too huh...
so many matrixes :fire:
Jumar Macato
@jmacato
Apr 12 2018 10:37
hahaha :)
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 10:39
I would use corefx matrixes if possible as they have unit tests
danwalmsley
@danwalmsley
Apr 12 2018 10:39
@jmacato your colour animations, do you only need to transform individual colours, or do you need to transform individual pixels?
Jumar Macato
@jmacato
Apr 12 2018 10:40
just colors, since it only handles SolidColorBrush
danwalmsley
@danwalmsley
Apr 12 2018 10:40
ok otherwise it would be very slow without gpu
Jumar Macato
@jmacato
Apr 12 2018 10:41
we also have a problem with new SolidColorBrush objects being created
every frame
but yeah
Matthijs ter Woord
@mterwoord
Apr 12 2018 10:41
@jmacato can use avx2 in situations. that's the "scaringly intelligent" part
danwalmsley
@danwalmsley
Apr 12 2018 10:41
creates the rotation matrix to rotate a colour by hue in hsv space
even though it works on RGB values
Jumar Macato
@jmacato
Apr 12 2018 10:42
@mterwoord scaringly awesome too haha
Matthijs ter Woord
@mterwoord
Apr 12 2018 10:42
yes.
not sure about specific situations, but i saw a presentation once about using the new vector stuff to things manually. in the "but, jit does all these situations automatically"
:)
Jumar Macato
@jmacato
Apr 12 2018 10:42
@danwalmsley i'll take a quick gist later, gotta do some stuff, be back in a bit :)
danwalmsley
@danwalmsley
Apr 12 2018 10:43
ok :)
I was going to ask last week if colour matrices would be needed here, but assumed it wouldnt so didnt mention it
Jumar Macato
@jmacato
Apr 12 2018 11:12
back
@mterwoord i see, i probably just hate the boilerplate code that i have to do for color normalization and back :)
@danwalmsley it's quite useful snippet!
but i'd like to know if you have any matrix-based RGB to HSV and the other way around :)
danwalmsley
@danwalmsley
Apr 12 2018 11:20
@jmacato its not possible to use matrix for that
but I do have conversion method
its because RGB -> HSV is non-linear
Jumar Macato
@jmacato
Apr 12 2018 11:21
yeah i just realized, there's branching
yeah
but can we speed it up
?
danwalmsley
@danwalmsley
Apr 12 2018 11:21
not sure.
shall I post my conversion methods?
Jumar Macato
@jmacato
Apr 12 2018 11:21
sure,
danwalmsley
@danwalmsley
Apr 12 2018 11:21
i suppose if speed was absolute concern you could have a lookup table
Jumar Macato
@jmacato
Apr 12 2018 11:21
it'll be quite handy
hmm 64mb of color lookup would be
a bit too much i guess :)
danwalmsley
@danwalmsley
Apr 12 2018 11:22
at least you know these conversions work
you know the difference between hsv and hsl right?
Jumar Macato
@jmacato
Apr 12 2018 11:22
yes
danwalmsley
@danwalmsley
Apr 12 2018 11:22
ok I have both incase you need
Jumar Macato
@jmacato
Apr 12 2018 11:22
rgb to xyz
for intermediate conversion to lab
coz lab interpolation makes the most accurate colors
danwalmsley
@danwalmsley
Apr 12 2018 11:23
iv seen a matrix for RGB to YIQ (which is a bit of an obscure colour space)
Jumar Macato
@jmacato
Apr 12 2018 11:23
i saw that one yesterday, it's a bit obtuse but awesome
what're you going to use your color snippets, if you don't mind me asking? :)
danwalmsley
@danwalmsley
Apr 12 2018 11:24
in my job we are working on some photo processing application
where we need to process raw data from camera
Jumar Macato
@jmacato
Apr 12 2018 11:25
ohh cool! :)
danwalmsley
@danwalmsley
Apr 12 2018 11:25
then use it to enhance certain aspects of an image
colour matrix was good for white balancing
converting to hsv was good to selecting things inside an image
but conversion to and from is a little slow
4000x3000 pixels it is anyway
Jumar Macato
@jmacato
Apr 12 2018 11:26
Some serious horsepower are needed for that kind of processing haha :)
every line of processing code counts when it comes to that, i reckon
nopara73
@nopara73
Apr 12 2018 11:29
Hi guys, where would you look for hiring someone who has experience with Avalonia?
BGRAColor is just RGBA (we tried to optimize for a particular pixel format)
you should be able to modify for your purposes
Matthijs ter Woord
@mterwoord
Apr 12 2018 11:34
@nopara73 I'd say ask around here is a good start. or am i misunderstanding you?
danwalmsley
@danwalmsley
Apr 12 2018 11:35
@nopara73 pm sent ;)
Matthijs ter Woord
@mterwoord
Apr 12 2018 11:35
ah ok :)
nopara73
@nopara73
Apr 12 2018 11:50
@mterwoord You don't :)
Jumar Macato
@jmacato
Apr 12 2018 11:50
@danwalmsley thanks!
Jumar Macato
@jmacato
Apr 12 2018 12:01
@danwalmsley I'd like to try making a simple paint app, akin to Paint.NET, but for avalonia. but that's for another time perhaps, i still need to work on PR
Jumar Macato
@jmacato
Apr 12 2018 12:35
hey folks, i've successfully ran the default MVVM template natively into linux! thanks in part to the folks at dotnet/corefx for their patience
image.png
Matthijs ter Woord
@mterwoord
Apr 12 2018 12:36
lots of background errors i see..
Jumar Macato
@jmacato
Apr 12 2018 12:36
ah it was on the previous build
:)
although the ilcompiler nuget package is not yet updated
for the specific fixes needed,
@wieslawsoltes i'll try to run Draw2D here
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:39
@jmacato Nice!
@jmacato You need to use this commands:
dotnet publish -c Debug -r win-x64 -o bin/win-x64-debug -v m /p:CoreRT=True
dotnet publish -c Release -r win-x64 -o bin/win-x64-release -v m /p:CoreRT=True
Jumar Macato
@jmacato
Apr 12 2018 12:40
alright
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:41
I have refactored project to enable native and default publish commands.
Jumar Macato
@jmacato
Apr 12 2018 12:42
i may change some stuff on it
since i'm building coreRT from source
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:42
ok
Jumar Macato
@jmacato
Apr 12 2018 12:43
should i use that specific branch (2e~) ?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:43
master
Jumar Macato
@jmacato
Apr 12 2018 12:43
okay okay
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:43
I merged CoreRT stuff to master
Jumar Macato
@jmacato
Apr 12 2018 12:57
oops not dotnet/corefx, dotnet/corert rather, my bad
@wieslawsoltes i'm currently building Draw2D
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:57
:fire:
Jumar Macato
@jmacato
Apr 12 2018 12:58
it takes a while to build 😏
oops
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 12:59
It has a lot of classes :smile:
Jumar Macato
@jmacato
Apr 12 2018 12:59
there's some errors
i think we will be fine without the System.Runtime includes in the rd.xml
letme try compiling again without those
Jumar Macato
@jmacato
Apr 12 2018 13:21
@wieslawsoltes yup, no can do, without fixes on the error regarding System.Private.CoreLib, it'll not run for now
Jumar Macato
@jmacato
Apr 12 2018 13:39
@wieslawsoltes i'll try building it again now
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 13:39
Oh great
Jumar Macato
@jmacato
Apr 12 2018 13:39
tho corert is taking its lovely time to build
hahaha
Jumar Macato
@jmacato
Apr 12 2018 13:57
@wieslawsoltes i'm getting a bit closer now, i accidentally removed Avalonia.Gtk on the rd.xml :fire:
Yes!!
image.png
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:01
Wow!
Did you try drawing?
:smile:
Is this release or debug build?
Jumar Macato
@jmacato
Apr 12 2018 14:02
wait haha :D i'm rebuilding coz i forgot to remove the stacktrace arguments
debug build
can you give me an example drawing .json file @wieslawsoltes ?
danwalmsley
@danwalmsley
Apr 12 2018 14:03
@jmacato do release builds work yet?
Jumar Macato
@jmacato
Apr 12 2018 14:04
@danwalmsley not yet, but MichalStrehovsky @ corert said that he has some idea about the assert errors on release builds
i'll wait for his fixes on that regard
i may try AvalonStudio next later :)
danwalmsley
@danwalmsley
Apr 12 2018 14:05
I almost got it to run
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:05
Just use some tool like line
Jumar Macato
@jmacato
Apr 12 2018 14:05
but i'd imagine the rd.xml to be huge
i hope im wrong about that
danwalmsley
@danwalmsley
Apr 12 2018 14:05
but I got stuck on rd.xml for newtonsoft.json
Jumar Macato
@jmacato
Apr 12 2018 14:05
oooh
i'll try to take it on later
danwalmsley
@danwalmsley
Apr 12 2018 14:05
I posted a branch with most of the work
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:05
Ok
Jumar Macato
@jmacato
Apr 12 2018 14:07
@wieslawsoltes there's a bit of a lag
probably just my laptop
image.png
executable is 96.1 mb, 27mb when compressed
do you have a linux machine to test this one on?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:12
No
Jumar Macato
@jmacato
Apr 12 2018 14:13
i see, here's the file anyway
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:13
I need finally to install Ubuntu on my machine, normally I use Virtual
Box
Jumar Macato
@jmacato
Apr 12 2018 14:13
dual boot 'em up :)
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:14
I think debug builds will be much slower even on fast machines
Jumar Macato
@jmacato
Apr 12 2018 14:14
i see.. why would it be slow on debug builds?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:16
That's from my tests with CoreRT
The normaly published apps with dotnet will faster
Jumar Macato
@jmacato
Apr 12 2018 14:16
I see...
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:18
The executable on Linux can probably be stripped a lot
So final size will be much smaller
Jumar Macato
@jmacato
Apr 12 2018 14:18
yeah, and also on CoreRT's side too, i'll try building it again when they fix the release builds bug
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:20
My app has large object graph and Xaml also uses lots of objects, so in debug mode this has big perf implications
I think :smile:
Jumar Macato
@jmacato
Apr 12 2018 14:20
yeah most probably thats the case, parsing/deserializing is quite expensive imo
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:21
I am mostly interested on perf of Xaml loading
Dynamically loaded Xaml currently is pretty slow
When using data templates
Jumar Macato
@jmacato
Apr 12 2018 14:23
i believe (i'm totally not sure about this, please correct me if i'm wrong) that portable.xaml is not as efficient as it should be, and the reflection overhead with xaml deserialization is quite expensive too, performance-wise
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:23
The portable Xaml is really fast
See the benchmarks at GitHub
repo
Jumar Macato
@jmacato
Apr 12 2018 14:24
ohh.. we are not using omnixaml anymore right?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:24
Right
Jumar Macato
@jmacato
Apr 12 2018 14:24
it'd be great if we can have a backend code generator that transpiles xaml into a c# object, preferably like how WPF makes .g.cs files
i see
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:24
Yeah
Jumar Macato
@jmacato
Apr 12 2018 14:25
that can also make controls with names accessible to code-behind but
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:25
Thank the goal
Jumar Macato
@jmacato
Apr 12 2018 14:25
im a bit conflicted with dealing with partial classes haha
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:26
Don't care about that, I want the speed :fire:
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 14:26
We've talked about that here any there. Another feature we could add is autogenerating an rd.xml file that roots all of the needed types. (Not just the ones with x:Name attributes)
Jumar Macato
@jmacato
Apr 12 2018 14:26
indeed, speed indeed :fireworks:
@jkoritzinsky that'll be awesome, generating rd.xml files manually is a PITA
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 14:27
:+1:
Jumar Macato
@jmacato
Apr 12 2018 14:27
especially when every native builds takes 5 mins, kinda kills the zone for me imho
then finding out that you forgot to include some types, rinse and repeat
i think roslyn has the ability to do codegen now right @jkoritzinsky ? last time i checked itwas not possible
danwalmsley
@danwalmsley
Apr 12 2018 14:30
@jmacato avalonstudio corert branch here:
Jumar Macato
@jmacato
Apr 12 2018 14:31
@danwalmsley thanks, will try that out later :))
danwalmsley
@danwalmsley
Apr 12 2018 14:31
if we could have XAML -> CS generator that would speed things up greatly
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 14:32
You can do codegen. It's just not builtin. I do it in SharpGenTools
Jumar Macato
@jmacato
Apr 12 2018 14:33
is it language-agnostic?
i've just checked your SharpGenTools project, quite awesome btw
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 14:36
Depends on which layer you generate code via. It can be.
danwalmsley
@danwalmsley
Apr 12 2018 14:36
we use it on avalonstudio to interact with the .net core debugger
works very well
would have been stuck without it
Jumar Macato
@jmacato
Apr 12 2018 14:41
@jkoritzinsky i see, i tried doing msbuild stuff but it's quite over my head. I was trying to make a winexe subsystem changer that removes the command line console in windows, it was for Avalonia of course, the main code worked but i failed miserably at making a nuget package that just works when you add it. I made it 'cause i can't afford to DL all of Visual Studio since internet in my country is abysmally slow and expensive
@danwalmsley awesome! i'll be taking a break for a bit
Jumar Macato
@jmacato
Apr 12 2018 15:01
@danwalmsley back, i'll see if i can make coreRT's magic work
danwalmsley
@danwalmsley
Apr 12 2018 15:22
@jmacato I'm just about to push a couple of fixes to AS corert branch
I updated that branch with latest stuff so I had to add some more to rd.xml
still doesn't run though
Jumar Macato
@jmacato
Apr 12 2018 15:22
@danwalmsley i'm currently building it right now, i'm having some problem with my net connection haha
danwalmsley
@danwalmsley
Apr 12 2018 15:23
ok make sure you pull submodules also
Jumar Macato
@jmacato
Apr 12 2018 15:23
i can't download AvalonStudio.Languages.CPlusPlus.LibClang.6.0.0
its failing here, idk why
i'll try a regular build
yep fails too
danwalmsley
@danwalmsley
Apr 12 2018 15:24
hmm odd
which directory are you building from?
Jumar Macato
@jmacato
Apr 12 2018 15:25
here's my logs
danwalmsley
@danwalmsley
Apr 12 2018 15:25
ok
sorry, it's a bit long
i was building at gitrepo/AvalonStudio/AvalonStudio
as i usually do
danwalmsley
@danwalmsley
Apr 12 2018 15:27
its built before like that?
Jumar Macato
@jmacato
Apr 12 2018 15:28
no, it fails on restore :(
that log is just a regular dotnet build
but i've integrated the requisite changes for CoreRT on it
danwalmsley
@danwalmsley
Apr 12 2018 15:29
try this
open nuget.config
(the one next to the sln file)
replace with
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear/>
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="AvaloniCI" value="https://www.myget.org/F/avalonia-ci/api/v2" />
    <add key="XamlBehaviors" value="https://www.myget.org/F/xamlbehaviors-nightly/api/v2" />
    <add key="DockNC" value="https://www.myget.org/F/mabiavalon-ci/api/v2" />
    <add key="sharpgen" value="https://www.myget.org/F/sharpgentools/api/v3/index.json" />
    <add key="cli-deps" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
    <add key="netcore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
  </packageSources>
</configuration>
Jumar Macato
@jmacato
Apr 12 2018 15:29
alright
danwalmsley
@danwalmsley
Apr 12 2018 15:29
then see if it works
I added the clear to make sure nothing is interfering with it
do you have an older version of that package cached in your .nuget folder?
Jumar Macato
@jmacato
Apr 12 2018 15:30
hmmm yeah i think, because i used AvalonStudio about 3 months ago
custom build
danwalmsley
@danwalmsley
Apr 12 2018 15:30
ok
you might have version 5
and you could change the package version if the above fix doesn't work
Jumar Macato
@jmacato
Apr 12 2018 15:30
now its 'Microsoft.CodeAnalysis.VisualBasic.2.7.0' f
that is failing
danwalmsley
@danwalmsley
Apr 12 2018 15:31
hmmm it looks like some ssl issue
can you access any https page
try
Jumar Macato
@jmacato
Apr 12 2018 15:31
yeah, my time settings are good
hmm
see if you can access this page
Jumar Macato
@jmacato
Apr 12 2018 15:34
sorry, i just ran out of data allocation
thats why it was failing hahaha
danwalmsley
@danwalmsley
Apr 12 2018 15:34
ok
Jumar Macato
@jmacato
Apr 12 2018 15:34
sorry for worrying you
danwalmsley
@danwalmsley
Apr 12 2018 15:34
np
btw once its built with
dotnet publish -f netcoreapp2.0 -r win-x64
this is the issue I'm getting
Jumar Macato
@jmacato
Apr 12 2018 15:35
can you try adding -v d
danwalmsley
@danwalmsley
Apr 12 2018 15:35
Exception has been thrown by the target of an invocation.
   at AvalonStudio!<BaseAddress>+0x13058f6
   at AvalonStudio!<BaseAddress>+0x13a2b1f
   at AvalonStudio.App.Main(String[]) + 0x22f

A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
   at AvalonStudio!<BaseAddress>+0xc201b0
   at AvalonStudio!<BaseAddress>+0xc1ff02
   at AvalonStudio!<BaseAddress>+0x133d797
   at AvalonStudio.MainWindow..ctor() + 0x89
   at AvalonStudio!<BaseAddress>+0xc11ffa
   at AvalonStudio!<BaseAddress>+0x1305820

Error getting value from 'Root' on 'AvalonStudio.GlobalSettings.Settings'.
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object) + 0x151
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CalculatePropertyDetails(JsonProperty, JsonConverter&, JsonContainerContract, JsonProperty, JsonReader, Object, Boolean&, Object&, JsonContract&, Boolean&) + 0x1a8
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty, JsonConverter, JsonContainerContract, JsonProperty, JsonReader, Object) + 0x8b
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object, JsonReader, JsonObjectContract, JsonProperty, String) + 0xbbf
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x4a5
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x104
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader, Type, Boolean) + 0x3cb
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader, Type) + 0x1a9
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader, Type) + 0x3a
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String, Type, JsonSerializerSettings) + 0xcc
   at AvalonStudio!<BaseAddress>+0x130043d
   at AvalonStudio!<BaseAddress>+0x12fff54
   at AvalonStudio!<BaseAddress>+0x1305aaa
   at AvalonStudio.GlobalSettings.Settings.Load() + 0x61
   at AvalonStudio!<BaseAddress>+0x65833d
   at AvalonStudio!<BaseAddress>+0x139a003
   at AvalonStudio!<BaseAddress>+0xc200bd

Value cannot be null.
Parameter name: method
   at AvalonStudio!<BaseAddress>+0x9d7145
   at System.Linq.Expressions.Expression.Call(MethodInfo, Expression) + 0x36
   at AvalonStudio!<BaseAddress>+0xca67a3
   at AvalonStudio!<BaseAddress>+0xca4d29
   at AvalonStudio!<BaseAddress>+0xca4c96
   at AvalonStudio!<BaseAddress>+0xca4c50
   at AvalonStudio!<BaseAddress>+0xca4b19
   at AvalonStudio!<BaseAddress>+0xca4c08
   at AvalonStudio.GlobalSettings.Settings.get_Root() + 0x9b
   at AvalonStudio!<BaseAddress>+0x13ddcc7
   at AvalonStudio!<BaseAddress>+0xc53a72
   at AvalonStudio!<BaseAddress>+0x432393
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x31
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception) + 0x2b
   at AvalonStudio!<BaseAddress>+0x997437
   at AvalonStudio!<BaseAddress>+0x897244
   at AvalonStudio!<BaseAddress>+0x9233d2
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[]) + 0xb0
   at AvalonStudio!<BaseAddress>+0xeb1ac2
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object) + 0xa5
no idea where to start with that
what does -v d do?
it builds fine
Jumar Macato
@jmacato
Apr 12 2018 15:35
wait, add this to a <ItemGroup>
danwalmsley
@danwalmsley
Apr 12 2018 15:36
but not run
Jumar Macato
@jmacato
Apr 12 2018 15:36
it makes a more detailed build log
danwalmsley
@danwalmsley
Apr 12 2018 15:36
ok
Jumar Macato
@jmacato
Apr 12 2018 15:36
it's shorthand for --verbosity=detailed
wait
add this after rd.xml declaration in AvalonStudio's csproj
<IlcArg Include="--stacktracedata" />
so that it makes a better stacktrace
danwalmsley
@danwalmsley
Apr 12 2018 15:37
ok
I'm guessing there is some reflection info missing just not sure what
Jumar Macato
@jmacato
Apr 12 2018 15:38
definitely some types are missing, from the look of that trace
danwalmsley
@danwalmsley
Apr 12 2018 15:40
did you manage to build?
Jumar Macato
@jmacato
Apr 12 2018 15:40
no, i have to wait at least 45mins before i can topup my net
it's midnight here so yeah
danwalmsley
@danwalmsley
Apr 12 2018 15:41
oh with corert, if you compile the .net part with optimizers on
then the Corert bit without does that get a performance increase on core2d or work even?
Jumar Macato
@jmacato
Apr 12 2018 15:42
hmm
honestly i'm not sure since i haven't done a more thorough digging/benchmarking with it yet
danwalmsley
@danwalmsley
Apr 12 2018 15:43
I'm not sure I'm going to be able to use it for AvalonStudio since we rely on MEF for plugins and stuff
it could only be used if you wanted to include everything you needed all together
unless we find a way to make that work
Jumar Macato
@jmacato
Apr 12 2018 15:44
I'm not familiar with MEF yet but as @jkoritzinsky said before, it might break that
danwalmsley
@danwalmsley
Apr 12 2018 15:46
Exception has been thrown by the target of an invocation.
   at AvalonStudio!<BaseAddress>+0x13058f6
   at AvalonStudio!<BaseAddress>+0x13a2b1f
   at AvalonStudio.App.Main(String[]) + 0x22f

A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
   at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x254
   at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstructionReturnNonGCStaticBase(StaticClassConstructionContext*, IntPtr) + 0x1a
   at AvalonStudio!<BaseAddress>+0x133d797
   at AvalonStudio.MainWindow..ctor() + 0x89
   at System.Runtime.RawCalliHelper.Call(IntPtr, Object) + 0x26
   at AvalonStudio!<BaseAddress>+0x1305820

Error getting value from 'Root' on 'AvalonStudio.GlobalSettings.Settings'.
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object) + 0x151
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CalculatePropertyDetails(JsonProperty, JsonConverter&, JsonContainerContract, JsonProperty, JsonReader, Object, Boolean&, Object&, JsonContract&, Boolean&) + 0x1a8
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty, JsonConverter, JsonContainerContract, JsonProperty, JsonReader, Object) + 0x8b
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object, JsonReader, JsonObjectContract, JsonProperty, String) + 0xbbf
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x4a5
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x104
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader, Type, Boolean) + 0x3cb
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader, Type) + 0x1a9
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader, Type) + 0x3a
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String, Type, JsonSerializerSettings) + 0xcc
   at AvalonStudio!<BaseAddress>+0x130043d
   at AvalonStudio!<BaseAddress>+0x12fff54
   at AvalonStudio!<BaseAddress>+0x1305aaa
   at AvalonStudio.GlobalSettings.Settings.Load() + 0x61
   at AvalonStudio.GlobalSettings.Settings..cctor() + 0x15
   at System.Runtime.CompilerServices.ClassConstructorRunner.Call[T](IntPtr) + 0x23
   at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext*) + 0x161

Value cannot be null.
Parameter name: method
   at System.Dynamic.Utils.ContractUtils.RequiresNotNull(Object, String) + 0x3d
   at System.Linq.Expressions.Expression.Call(MethodInfo, Expression) + 0x36
   at System.Runtime.CompilerServices.CallSite`1.CreateCustomNoMatchDelegate(MethodInfo) + 0x137
   at System.Runtime.CompilerServices.CallSite`1.MakeUpdateDelegate() + 0x71
   at System.Runtime.CompilerServices.CallSite`1.GetUpdateDelegate(T&) + 0x36
   at System.Runtime.CompilerServices.CallSite`1.GetUpdateDelegate() + 0x38
   at System.Runtime.CompilerServices.CallSite`1..ctor(CallSiteBinder) + 0x39
   at AvalonStudio!<BaseAddress>+0xca4c08
   at AvalonStudio.GlobalSettings.Settings.get_Root() + 0x9b
   at AvalonStudio!<BaseAddress>+0x13ddcc7
   at System.InvokeUtils.CalliIntrinsics.Call(IntPtr, IntPtr, Object, IntPtr, InvokeUtils.ArgSetupState&, Boolean) + 0x4a
   at System.InvokeUtils.CallDynamicInvokeMethod(Object, IntPtr, Object, IntPtr, IntPtr, Object, Object[], BinderBundle, Boolean, Boolean, Boolean) + 0x22f
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x31
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception) + 0x2b
   at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow(TargetInvocationException) + 0x2b
   at System.Linq.Exp
Jumar Macato
@jmacato
Apr 12 2018 15:48
your root object is a dynamic var
hmm
danwalmsley
@danwalmsley
Apr 12 2018 15:48
yeah, its so extensions can add unknown types to it
Jumar Macato
@jmacato
Apr 12 2018 15:48
then ExpandoObject
i see
danwalmsley
@danwalmsley
Apr 12 2018 15:49
its basically a global settings file, but any type can be inserted and retrieved
Jumar Macato
@jmacato
Apr 12 2018 15:49
where does ExpandoObjectConverter resides?
you should probably include the assembly
on which that resides
on the rd.xml
danwalmsley
@danwalmsley
Apr 12 2018 15:49
i guess its inside newtonsoft.json
but not sure
https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Converters/ExpandoObjectConverter.cs
I have <Assembly Name="Newtonsoft.Json" Dynamic="Required All" /> already
Jumar Macato
@jmacato
Apr 12 2018 15:53
can you try adding this
    <Assembly Name="Newtonsoft.Json">
        <Type Name="Newtonsoft.Json.Converters.ExpandoObjectConverter" Dynamic="Required All" />
    </Assembly>
beside the existing
newtonsoft
declare
danwalmsley
@danwalmsley
Apr 12 2018 15:55
how come you sometimes have to declare individual types like that?
btw where did you see expandoobjectconverter, I cant find it in my stacktrace?
Jumar Macato
@jmacato
Apr 12 2018 15:56
it was familiar with the problem @wieslawsoltes had, that the converters that were not found are returning null
i figured that newtonsoft's converters might not be working
hence the null root object
but it's just a conjecture of mine, may or maynot work
danwalmsley
@danwalmsley
Apr 12 2018 15:58
still the same
is it possible to attach debugger to corert?
Jumar Macato
@jmacato
Apr 12 2018 15:59
i'm afraid not :(
are you building on windows right now?
danwalmsley
@danwalmsley
Apr 12 2018 16:02
yeah
For Newtonsoft.Json
Jumar Macato
@jmacato
Apr 12 2018 16:05
ah yeah i forgot to say that one
@wieslawsoltes did you have an error similar to @danwalmsley 's?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:06
maybe, don't remember, I had so many errors :fire:
Jumar Macato
@jmacato
Apr 12 2018 16:06
haha thought so, how did you figured that one out?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:06
looking at CoreRT samples
:smile:
Jumar Macato
@jmacato
Apr 12 2018 16:07
ohh, geewhiz i didn't knew
Jumar Macato
@jmacato
Apr 12 2018 16:07
i see
their docs should include on how to figure those out ourselves :/
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:08
yeah
and I did a lot of googling, which was mostly unsuccessful
danwalmsley
@danwalmsley
Apr 12 2018 16:10
@wieslawsoltes thanks, iv already got those there
must be something else required
why cant we just say include all metadata
or would it be huge?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:11
try looking at deps.json
Jumar Macato
@jmacato
Apr 12 2018 16:12
i dont think they have the option to not do a tree shaking, i'll try to ask them later in case they do
btw i just got my net back, i'll try running the build here again
danwalmsley
@danwalmsley
Apr 12 2018 16:13
"Newtonsoft.Json/10.0.3": {
        "dependencies": {
          "Microsoft.CSharp": "4.3.0",
          "NETStandard.Library": "2.0.0",
          "System.ComponentModel.TypeConverter": "4.3.0",
          "System.Runtime.Serialization.Formatters": "4.3.0",
          "System.Runtime.Serialization.Primitives": "4.3.0",
          "System.Xml.XmlDocument": "4.3.0"
        },
        "compile": {
          "lib/netstandard1.3/Newtonsoft.Json.dll": {}
        }
      },
should I add all of those do you think?
Jumar Macato
@jmacato
Apr 12 2018 16:14
"System.Runtime.Serialization.Formatters" & "System.Runtime.Serialization.Primitives"
could be worth adding to the rd.xml
System.Dynamic.Runtime
danwalmsley
@danwalmsley
Apr 12 2018 16:18
slow progress
Jumar Macato
@jmacato
Apr 12 2018 16:20
@danwalmsley how large is c++.clang package?
in your estimate?
danwalmsley
@danwalmsley
Apr 12 2018 16:20
~60mb
Jumar Macato
@jmacato
Apr 12 2018 16:20
okay thanks
danwalmsley
@danwalmsley
Apr 12 2018 16:21
did you find the colormatrix stuff useful?
Jumar Macato
@jmacato
Apr 12 2018 16:22
yes, unfortunately i haven't done any work on Animations PR yet
coz of these CoreRT stuff, i got sidetracked haha
totally worth it, however :)
@wieslawsoltes a bit offtopic, but you think Core2D can be expanded to be like Inkscape or would it be just for diagrams and stuff?
Jumar Macato
@jmacato
Apr 12 2018 16:28
okay, currently building AS
Jumar Macato
@jmacato
Apr 12 2018 16:36
and its taking its sweet time... :/
Jumar Macato
@jmacato
Apr 12 2018 16:47
it crashed my machine hahaha
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:54

@wieslawsoltes a bit offtopic, but you think Core2D can be expanded to be like Inkscape or would it be just for diagrams and stuff?

I think it possible

Its built to be expanded easily with new tools
Currently you can draw paths easily
Even complex ones
Jumar Macato
@jmacato
Apr 12 2018 16:56
quite neat! the only thing i hate about inkscape is that it doesnt take advantage of the GPU
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:57
Its more advanced version
Jumar Macato
@jmacato
Apr 12 2018 16:57
Alright, will do when i boot up to windows tomorrow
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:57
Draw2D is just experimental version, to play with new stuff
Jumar Macato
@jmacato
Apr 12 2018 16:58
I see, a subset of Core2D right
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:58
yes
Jumar Macato
@jmacato
Apr 12 2018 16:58
neat
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:58
But has some nice features
Selection is better and path shapes is more advanced, some filtering and intersection stuff
Jumar Macato
@jmacato
Apr 12 2018 16:59
i saw your video about Avalon+ D2D vs WPF
was it Core2D?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 16:59
yes
Jumar Macato
@jmacato
Apr 12 2018 16:59
nice, so we outperform WPF on that regard now?
danwalmsley
@danwalmsley
Apr 12 2018 17:00
@wieslawsoltes where can I see the video?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:00
Core2D has C# scripting, SVG, PDF and other file formats export
Jumar Macato
@jmacato
Apr 12 2018 17:00
@danwalmsley i'm still building AS :'(
Jumar Macato
@jmacato
Apr 12 2018 17:01
woah it has svg already
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:01
export
danwalmsley
@danwalmsley
Apr 12 2018 17:01
@jmacato it shouldn't take too long
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:01
via SkiaSharp
danwalmsley
@danwalmsley
Apr 12 2018 17:01
apart from core rt part
Jumar Macato
@jmacato
Apr 12 2018 17:01
it just finished
took about 10minutes
yeah svg export is quite enough for me
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:02
The perf for Avalonia+Direct2D is really nice.
Jumar Macato
@jmacato
Apr 12 2018 17:03
core2d can be an EDA too like KiCAD with spice but better, someone should write a plugin for core2D for that haha
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:03
You can group shapes, bind data
Jumar Macato
@jmacato
Apr 12 2018 17:03
how about skia, have you tested that
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:03
import data from csv
I have
Jumar Macato
@jmacato
Apr 12 2018 17:03
is it any good?
danwalmsley
@danwalmsley
Apr 12 2018 17:04
@jmacato I talked with my brother @jameswalmsley at one point about creating a KiCad type application in avalonia
danwalmsley
@danwalmsley
Apr 12 2018 17:04
but decided not to take it on
would be great if someone actually did this
Jumar Macato
@jmacato
Apr 12 2018 17:04
I have so many ideas for Avalonia-based projects
that and a media player
i think i'll tackle the latter in the near future
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:05
I think @jkoritzinsky media some progress with video player
Jumar Macato
@jmacato
Apr 12 2018 17:05
yep, i saw his AvaloniaAV project
danwalmsley
@danwalmsley
Apr 12 2018 17:05
the only issue with big projects like AS or Kicad, is it takes over all your spare time
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 17:06
I've been stuck for a really long time on getting the frame bitmaps into the CPU when using MediaFoundation. Once I get that working then it'll be relatively smooth sailing.
Jumar Macato
@jmacato
Apr 12 2018 17:07
@jkoritzinsky have you seen unosquare/ffmpegmediaelement ?
its a custom mediaelement for wpf, and it decodes via ffmpeg interops
could be useful for xplat
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 17:07
I was planning on using ffmpeg off windows and V4L2 for Linux webcams.
Jumar Macato
@jmacato
Apr 12 2018 17:08
i see, i was inclined on a more general media use
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 17:08
My goal was to offer OS native implementations when possible for efficiency and memory usage gains.
Jumar Macato
@jmacato
Apr 12 2018 17:08
try looking that repo up, you may find it interesting :)
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:08
Jeremy Koritzinsky
@jkoritzinsky
Apr 12 2018 17:08
I'll take a look!
Jumar Macato
@jmacato
Apr 12 2018 17:10
@wieslawsoltes wow, thats very cool :D
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:11
Jumar Macato
@jmacato
Apr 12 2018 17:11
yup i just watched that one a while ago :D
very neat
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:12
The Spiro license is not nice :worried:
Jumar Macato
@jmacato
Apr 12 2018 17:13
why??
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:13
GPL
Other than that spiro curves are very powerful when drawing
Jumar Macato
@jmacato
Apr 12 2018 17:15
ahh gpl3
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:15
yep
All my stuff is MIT
Jumar Macato
@jmacato
Apr 12 2018 17:15
that license author intentions were good but the outcomes are not quite
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:16
I wanted to include Spiro's in Core2D but using GPLv3 is not an option
Jumar Macato
@jmacato
Apr 12 2018 17:16
but it's a plugin right?
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:17
yeah probably can do with plugin
Jumar Macato
@jmacato
Apr 12 2018 17:17
users can just plop it on their install, without mixing the two codebases
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:17
maybe in future
Jumar Macato
@jmacato
Apr 12 2018 17:17
yeah
alright
Wiesław Šoltés
@wieslawsoltes
Apr 12 2018 17:17
I had some MEF stuff, but more issues than benifits
Jumar Macato
@jmacato
Apr 12 2018 17:17
@danwalmsley first output was icon not working so i have to rip it off for now
@wieslawsoltes yeah
danwalmsley
@danwalmsley
Apr 12 2018 17:18
Pull latest fixrd
Fixes from that branch it will save you about 6more errors like that
Jumar Macato
@jmacato
Apr 12 2018 17:18
thanks for the heads up
Jumar Macato
@jmacato
Apr 12 2018 17:26
@danwalmsley how long does the corert build take there?
danwalmsley
@danwalmsley
Apr 12 2018 17:31
4-5 minutes
Jumar Macato
@jmacato
Apr 12 2018 17:31
quite jarring tbh
it takes 8 mins here
danwalmsley
@danwalmsley
Apr 12 2018 17:32
it could have been closer to that here
i guess they intend people to develop on .net and then just do corert as a publish step
Jumar Macato
@jmacato
Apr 12 2018 17:33
that's how they seem to communicate the use-case of .net native
hence the lack of caching
alright
it made the exact stacktrace that you got a while back
Jumar Macato
@jmacato
Apr 12 2018 17:38
i say we should find all the types that accesses the Root object
i'll try adding a Debug.Print on the setter
danwalmsley
@danwalmsley
Apr 12 2018 17:39
ok good idea
ahopper
@ahopper
Apr 12 2018 17:45
does anyone happen to have an Avalonia version of the Mahapps RangeSlider http://mahapps.com/controls/range-slider.html ?
danwalmsley
@danwalmsley
Apr 12 2018 17:46
I don't believe there is one
@jmacato I think in SettingsSerializer.cs you would need to look
I'm just trying now
Jumar Macato
@jmacato
Apr 12 2018 17:48
alright
i was trying debug write
it was not showing up in terminal
just tried console out
it's all just ExpandoObject
danwalmsley
@danwalmsley
Apr 12 2018 17:49
where did you put debug write?
Jumar Macato
@jmacato
Apr 12 2018 17:51
in GlobalSettings.cs
    [JsonConverter(typeof(ExpandoObjectConverter))]
    public ExpandoObject Root
    {
        get
        {
            System.Console.WriteLine("Root Getter: "+_root.GetType().Name);
            return _root;
        }
        set
        {
            System.Console.WriteLine("Root Setter: "+value.GetType().Name);
            _root = value;
        }
    }
danwalmsley
@danwalmsley
Apr 12 2018 17:51
I think it might be some type that gets put inside the expando object
normally settings looks like this
Jumar Macato
@jmacato
Apr 12 2018 17:51
hmm i should expand them as well
time to do some pattern matching
danwalmsley
@danwalmsley
Apr 12 2018 17:52
root 
{
      MySettingType : Values
}
erm I think if you put debug write inside SettingsSerializer.cs
it will be simpler
Jumar Macato
@jmacato
Apr 12 2018 17:52
makes sense
danwalmsley
@danwalmsley
Apr 12 2018 17:53
public static T GetSettings<T>(Func<dynamic> getRoot, Action save) where T : new()
        {
Jumar Macato
@jmacato
Apr 12 2018 17:53
i should probably log the generic param right?
danwalmsley
@danwalmsley
Apr 12 2018 17:53
inside this function
if think but not sure
your interested in typeof(T) and also what result of that function is
Jumar Macato
@jmacato
Apr 12 2018 17:54
i'll pepper some console outs in other funcs
danwalmsley
@danwalmsley
Apr 12 2018 17:54
but its been so long since I looked at it
Jumar Macato
@jmacato
Apr 12 2018 17:55
it might be one of the first classes you've coded haha
danwalmsley
@danwalmsley
Apr 12 2018 17:55
it probably was
I'm sure there are better ways to do this now
Jumar Macato
@jmacato
Apr 12 2018 17:56

RootGetSettings: GeneralSettings
RootGetSettings: EditorSettings
Initializing mainwindow...Done
Data Context set
RootGetSettings: GeneralSettings
False
ColorTheme Loaded

(dotnet:19908): Gtk-CRITICAL **: gtk_window_resize: assertion 'width > 0' failed
RootGetSettings: EditorSettings
RootSetSettings: EditorSettings

sorry my backtick key is not working
can't enclose them in a code block
danwalmsley
@danwalmsley
Apr 12 2018 17:56
then it crashes
Jumar Macato
@jmacato
Apr 12 2018 17:57
wait i just tested it in regular
dotnet run
so that we have a benchmark
i'm building it in corert now
danwalmsley
@danwalmsley
Apr 12 2018 17:57
ok
good idea
Jumar Macato
@jmacato
Apr 12 2018 18:13
it seems that the GetSettings function is not being called at all
danwalmsley
@danwalmsley
Apr 12 2018 18:15
I think the json stuff might have been a red herring
pushing a commit that fixes that
but you still get
the other part of stack trace
Jumar Macato
@jmacato
Apr 12 2018 18:16
alright
what do you think is the issue?
danwalmsley
@danwalmsley
Apr 12 2018 18:19
disregard that
i made a mistake
Jumar Macato
@jmacato
Apr 12 2018 18:22
i'll try this super sketchy try-catch block on mainwindow
        try{
            var generalSettings = Settings.GetSettings<GeneralSettings>();

            Console.WriteLine($"{generalSettings == null}");
            ColorTheme.LoadTheme(generalSettings.Theme);

            Console.WriteLine("ColorTheme Loaded");
        } catch (Exception ei){
            Console.WriteLine(ei.InnerException.ToString());

        }
danwalmsley
@danwalmsley
Apr 12 2018 18:27
@jmacato pull my latest change
it fixes the json stuff
but now the error is really wierd
I cant tell how far its getting either
Jumar Macato
@jmacato
Apr 12 2018 18:27
can i take a look
danwalmsley
@danwalmsley
Apr 12 2018 18:28
True
False
Initializing mainwindow...Done
Data Context set
Exception has been thrown by the target of an invocation.
   at AvalonStudio!<BaseAddress>+0x1318272
   at AvalonStudio!<BaseAddress>+0x13b54e7
   at AvalonStudio.App.Main(String[]) + 0x22f

Value cannot be null.
Parameter name: method
   at System.Dynamic.Utils.ContractUtils.RequiresNotNull(Object, String) + 0x3d
   at System.Linq.Expressions.Expression.Call(MethodInfo, Expression) + 0x36
   at System.Runtime.CompilerServices.CallSite`1.CreateCustomNoMatchDelegate(MethodInfo) + 0x137
   at System.Runtime.CompilerServices.CallSite`1.MakeUpdateDelegate() + 0x71
   at System.Runtime.CompilerServices.CallSite`1.GetUpdateDelegate(T&) + 0x36
   at System.Runtime.CompilerServices.CallSite`1.GetUpdateDelegate() + 0x38
   at System.Runtime.CompilerServices.CallSite`1..ctor(CallSiteBinder) + 0x39
   at AvalonStudio!<BaseAddress>+0xcb2e4c
   at AvalonStudio!<BaseAddress>+0x1350495
   at AvalonStudio!<BaseAddress>+0x135004d
   at AvalonStudio!<BaseAddress>+0x1350139
   at AvalonStudio.MainWindow..ctor() + 0x89
   at System.Runtime.RawCalliHelper.Call(IntPtr, Object) + 0x26
   at AvalonStudio!<BaseAddress>+0x131819c
that's entire output
it runs on full net core
James Burnside
@JCBurnside
Apr 12 2018 18:29
can someone send me a repo for a simple example for how to use UserControls?
Jumar Macato
@jmacato
Apr 12 2018 18:31
@danwalmsley i have to go right after 15mins, it's past 3 in the morning here hahah :)
but i'll try this with my sketchy try-catch in mainwindow
so that i can catch the inner exception
ahopper
@ahopper
Apr 12 2018 18:37
@JCBurnside all the pages in the controlcatalog are UserControls https://github.com/AvaloniaUI/Avalonia/tree/master/samples/ControlCatalog/Pages
James Burnside
@JCBurnside
Apr 12 2018 18:44
I am getting NotSupportException 'Current operation is valid only when the underlying type on a XamlType is known, but it is unknown for '{clr-namespace:AvaonliaIRC.Controls;assembly=AvaloniaIRC}ScrollingText'
Jumar Macato
@jmacato
Apr 12 2018 18:45
@danwalmsley i got the same error
but i have to go now, will try again later
Soier646
@Soier646
Apr 12 2018 18:50
Hi. Is there are any way to scroll to end of textbox programmly?
danwalmsley
@danwalmsley
Apr 12 2018 18:57
@JCBurnside whats the link to your repo again?
danwalmsley
@danwalmsley
Apr 12 2018 19:00
give me 1 minute i'll work out what the issue is
ok in Avalonia
oh wait 2 mins
danwalmsley
@danwalmsley
Apr 12 2018 19:05
2 issues
firstly
mainwindow.xaml
xmlns:local="clr-namespace:AvaloniaIRC;assembly=AvaloniaIRC">
you spelt that Aalonlia
the second
in avalonia the path to the XAML file must match the namespace of the .XAML.cs file
so if you want the .XAML file and .XAML.cs namespace to ve AvaloniaIRC.Controls
you need to put the XAML file inside a folder called Controls also
James Burnside
@JCBurnside
Apr 12 2018 19:08
ah ok.
danwalmsley
@danwalmsley
Apr 12 2018 19:08
JCBurnside/AvaloniaIRC#2
here are changes to fix it
the csproj changes are not needed to fix it, just removed code that isn't needed, (prob VS added it)
Steven Kirk
@grokys
Apr 12 2018 21:56
@danwalmsley finally got chance to look at AvaloniaUI/Avalonia#1488
so simple
danwalmsley
@danwalmsley
Apr 12 2018 21:59
oh nice
shall I push a commit with those fixes ?
Steven Kirk
@grokys
Apr 12 2018 21:59
sure
so funny that you were looking so deep into the renderer
when the problem was you were fixing the wrong control
danwalmsley
@danwalmsley
Apr 12 2018 22:00
yeah
Steven Kirk
@grokys
Apr 12 2018 22:01
i admit i still often expect a border
danwalmsley
@danwalmsley
Apr 12 2018 22:01
re CornerRadius
I notice that TemplatedControl has BorderThickness property
shouldn't it have CornerRadius property also?
@grokys doesn't seem to fix it for me
danwalmsley
@danwalmsley
Apr 12 2018 22:06
static ContentPresenter()
        {
            ContentProperty.Changed.AddClassHandler<ContentPresenter>(x => x.ContentChanged);
            ContentTemplateProperty.Changed.AddClassHandler<ContentPresenter>(x => x.ContentChanged);
            TemplatedParentProperty.Changed.AddClassHandler<ContentPresenter>(x => x.TemplatedParentChanged);

            AffectsRender(BorderThicknessProperty);
            AffectsMeasure(BorderThicknessProperty);
        }
static Border()
        {
            AffectsRender(BackgroundProperty, BorderBrushProperty, BorderThicknessProperty, CornerRadiusProperty);
            AffectsMeasure(BorderThicknessProperty);
        }
is something else required?
Steven Kirk
@grokys
Apr 12 2018 22:09
oh, weird
danwalmsley
@danwalmsley
Apr 12 2018 22:10
image.png
did you get this?
with black line still there on top border?
Steven Kirk
@grokys
Apr 12 2018 22:11
yeah
danwalmsley
@danwalmsley
Apr 12 2018 22:11
black line should disappear
if you resize the width of window
it immediately disapears
Steven Kirk
@grokys
Apr 12 2018 22:12
2018-04-13_00-12-34.gif
hold on, if i remove those lines it's still fixed
wtf
danwalmsley
@danwalmsley
Apr 12 2018 22:13
are you on direct or deffered renderer?
Steven Kirk
@grokys
Apr 12 2018 22:13
not changed anything about the renderer
danwalmsley
@danwalmsley
Apr 12 2018 22:14
can you push your current code to a branch so I can compare against mine?
Steven Kirk
@grokys
Apr 12 2018 22:15
hold on, just trying to work out what's going on
danwalmsley
@danwalmsley
Apr 12 2018 22:15
ok
Steven Kirk
@grokys
Apr 12 2018 22:16
WTF, i just pasted the MainWindow.xaml code again and now it's broken again
i hadn't edited that code
ok so looks like it might not be so simple :(
how did i just fix it?!?
danwalmsley
@danwalmsley
Apr 12 2018 22:17
oh I can see the issue
in your screenshot
you seem to have lost the border on the main red grid
if you compare to my screenshot there is a black border missing
Steven Kirk
@grokys
Apr 12 2018 22:18
ahhh
ok my bad. i did edit that file. to remove the border. but then i was still getting render artifacts
danwalmsley
@danwalmsley
Apr 12 2018 22:19
I think there was also border issues around the tab
which is fixed now
its just that top border should be covered when selected
which i don't think is going to be easy
the reason I was looking into the renderer was due to this issue not showing up on DirectRenderer
Steven Kirk
@grokys
Apr 12 2018 22:20
ok, i have no idea what was going on
danwalmsley
@danwalmsley
Apr 12 2018 22:20
:smile:
Steven Kirk
@grokys
Apr 12 2018 22:21
what the actual fuck?!?! it's ok again now!?
danwalmsley
@danwalmsley
Apr 12 2018 22:21
hahaha :)
Steven Kirk
@grokys
Apr 12 2018 22:22
an now it's not working again
danwalmsley
@danwalmsley
Apr 12 2018 22:22
random thought
Steven Kirk
@grokys
Apr 12 2018 22:22
ok, anyway so the changes you added are still needed
danwalmsley
@danwalmsley
Apr 12 2018 22:22
could it be working when its perfectly lined up with a pixel
and not when its across 2 pixels?
Steven Kirk
@grokys
Apr 12 2018 22:24
i actually suspect it's something in BorderRenderHelper - i'd got to there when i noticed it was using a ContentPresenter not a Border
but i may be wrong
ok, going to keep looking
sorry for the false alarm!
danwalmsley
@danwalmsley
Apr 12 2018 22:28
no worries, thanks for looking into the issue :)