These are chat archives for AvaloniaUI/Avalonia

4th
Feb 2017
Eric Mellino
@mellinoe
Feb 04 2017 00:14 UTC
@galvesribeiro I am here now, just read through the discussion
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:14 UTC
yeah
just curious if you had the console problem in your engine
I mean, when you open the game have you able to supporess the console to be open?
Eric Mellino
@mellinoe
Feb 04 2017 00:14 UTC
@danwalmsley I'm not super familiar with System.Composition, but it should be unchanged from the Microsoft.Composition nuget package we used to ship
@danwalmsley We also are supporting "MEF1" (the regular .NET Framework component), but only in .NET Core / .NET Standard 2.0
The console window thing is very problematic
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:15 UTC
humm
Eric Mellino
@mellinoe
Feb 04 2017 00:16 UTC
In my game editor, when publishing a standalone version of my game, I have a step that changes the subsystem link of the executable.
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:16 UTC
I saw that
but it only work on windows
Eric Mellino
@mellinoe
Feb 04 2017 00:16 UTC
Yes, exactly
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:16 UTC
and it is kinda hack :)
Eric Mellino
@mellinoe
Feb 04 2017 00:17 UTC
I filed an issue about this a long time ago here: dotnet/core-setup#196, but there is not a lot of interest from the rest of my team
Any extra voices in there would help show the importance of it
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:17 UTC
I saw tht too
the point is, we are already using the underlying OS windowing system
the host is just to start the clr
Eric Mellino
@mellinoe
Feb 04 2017 00:18 UTC
Right
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:18 UTC
we would just need somehow to skip that terminal thing
Eric Mellino
@mellinoe
Feb 04 2017 00:18 UTC
Unfortunately the "host" is also the thing that runs SDK commands, so we need the console for that
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:18 UTC
otherwise, we would need to create our own host which is totally undesirable
:(
Eric Mellino
@mellinoe
Feb 04 2017 00:18 UTC
And we also need a console if the program being hosted uses console output
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:19 UTC
yeah, at development it is useful, but publishing it isnt
Eric Mellino
@mellinoe
Feb 04 2017 00:19 UTC
In my opinion the right thing to do is unconditionally link dotnet.exe against the Windows subsystem, and then conditionally create a console window based on some metadata in the project
in the project / published exe
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:19 UTC
yep
one question
instead of use dotnet as the host
is there a way to when dotnet publishto create the host for us? basically a self-contained app
I heard about it in the past
but noone looks to use it
Eric Mellino
@mellinoe
Feb 04 2017 00:20 UTC
Yes, it's quite easy
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:20 UTC
like embedding the framework etc
how
?
Eric Mellino
@mellinoe
Feb 04 2017 00:20 UTC
Yeah, it's very simple
If you are using the new csproj stuff
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:21 UTC
I am
Eric Mellino
@mellinoe
Feb 04 2017 00:21 UTC
You list <RuntimeIdentifiers>win7-x64;OTHER_STUFF</RuntimeIdentifiers> in your project
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:21 UTC
humm
that would be good for containers :)
Eric Mellino
@mellinoe
Feb 04 2017 00:22 UTC
And then you pass /p:RuntimeIdentifier=___ when building
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:22 UTC
ahh
Eric Mellino
@mellinoe
Feb 04 2017 00:22 UTC
The native host you get there is just dotnet.exe renamed, though
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:22 UTC
need the msbuild parameter
Eric Mellino
@mellinoe
Feb 04 2017 00:22 UTC
it is still a program linked to the Console subsystem
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:22 UTC
yes that is for another case
in my case an Orleans service which will run in containers
so basically this renamed dot net will be direct executable without need to pass the .dll as a parameter right?
Eric Mellino
@mellinoe
Feb 04 2017 00:23 UTC
Right, you just open it directly
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:23 UTC
perfect
thanks
will take a note
Eric Mellino
@mellinoe
Feb 04 2017 00:24 UTC
It looks for a .dll next to itself with the same name, and then hosts the CLR and uses that dll as the entrypoint assembly
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:24 UTC
perfect
I guess for the Console problem, people (for now) will need to build their own hosts
:(
Eric Mellino
@mellinoe
Feb 04 2017 00:25 UTC
Yeah... personally I think it's really unreasonable to expect anyone to do that, because of how complicated dotnet.exe is and how many platforms you'd need to build for. That's why I am hoping we will come to some sort of conclusion in that issue I linked
Technically you could just fork core-setup and change the subsystem linkage of dotnet.exe, and then publish a nuget package with a different name
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:26 UTC
humm
yeah
Eric Mellino
@mellinoe
Feb 04 2017 00:26 UTC
As far as I'm aware though, you'd then need to do additional work to get this custom host to play nicely with the new SDK targets, although I tried to ask them to make it easy/possible to integrate
At the very least you could just inject a custom post-build target to rename things and copy your custom host in on Windows
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:27 UTC
I’ve dealt in the past with mono when I had to create the host… it was a pain :(
danwalmsley
@danwalmsley
Feb 04 2017 00:37 UTC
@mellinoe hey
I don't suppose you know why on dotnet core when I do
Process.Start( FolderName)
I'm getting Win32 Exception Access Denied
Eric Mellino
@mellinoe
Feb 04 2017 00:40 UTC
Hrm, what is FolderName? seems weird to be passing that to Process.Start
Is that supposed to be opening an explorer window there?
I believe the difference here is that UseShellExecute defaults to false in .NET Core instead of true, so we are attempting to launch that folder as an executable rather than create an explorer there
You can either set UseShellExecute to true, or you could do Process.Start("cmd", $"/c start {FolderName}");
danwalmsley
@danwalmsley
Feb 04 2017 00:44 UTC
in full dotnet you could pass a path
like Process.Start("c:\myfolder\")
and it would just open in explorer
would also work on mono
ok let my try use shell execute
Eric Mellino
@mellinoe
Feb 04 2017 00:45 UTC
Yeah, the relevant difference is that we default UseShellExecute to false, so it doesn't work on .NET Core. You can set that manually in the ProcessStartInfo or you can use the above command
danwalmsley
@danwalmsley
Feb 04 2017 00:45 UTC
man you know your stuff
Eric Mellino
@mellinoe
Feb 04 2017 00:45 UTC
Thanks, it's just my job ;)
danwalmsley
@danwalmsley
Feb 04 2017 00:45 UTC
oh another quick think while I have your attention
is it possible to use runtime text templates (.tt files) in .net core?
or can you possible recommend a text templating thing that can be used with .net core
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:47 UTC

@mellinoe

In my opinion the right thing to do is unconditionally link dotnet.exe against the Windows subsystem, and then conditionally create a console window based on some metadata in the project

That won't work

Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:47 UTC
@mellinoe last question… have we got at some point with making .net core apps to run as daemons or windows services? (I’ll not bug you again! :P)
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:47 UTC
If exe has console subsystem
It won't be attached to the console
Of the calling process
AllocConsole will just allocate a new one
We've tried to mess with that back in VB6 days
So changing subsystem by patching PE is the only way
@danwalmsley On linux the command would be xdg-open
danwalmsley
@danwalmsley
Feb 04 2017 00:50 UTC
@kekekeks thanks
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:51 UTC
@galvesribeiro what exactly prevents us from P/Invoking StartServiceCtrlDispatcher
danwalmsley
@danwalmsley
Feb 04 2017 00:51 UTC
@kekekeks how long til your .net core branch can be fully merged?
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:52 UTC
Well, grokys doesn't feel well
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:52 UTC
@kekekeks you mean to register it with svcctl?
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:52 UTC
TopShelf uses direct registry access, I think
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:52 UTC
Yeah, it doesn support .net core yet
Eric Mellino
@mellinoe
Feb 04 2017 00:53 UTC
@danwalmsley I'm not really aware of runtime text-templating options, unfortunately. Perhaps take a look at this? https://github.com/lunet-io/scriban
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:53 UTC
That's because it uses built-in service class from .NET
Which isn't available
Eric Mellino
@mellinoe
Feb 04 2017 00:53 UTC
@kekekeks Could you elaborate on the subsystem problem? I didn't quite follow
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:53 UTC
You see, if you start something from powershell/cmd or another process that has proper console
And started executable has CUI subsystem
It will inherit standard handles from that process
So stdin/stdout/stderr will be reused, unless redirected
That won't happen if process has GUI subsystem
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 00:55 UTC
Topshelf/Topshelf#277
Eric Mellino
@mellinoe
Feb 04 2017 00:55 UTC
CUI subsystem = console subsystem?
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:55 UTC
Yep
You can allocate a new console by calling kernel32!AllocConsole
Eric Mellino
@mellinoe
Feb 04 2017 00:56 UTC
So what you're saying is there's no way for dotnet.exe to tell if the parent process already had a console to use?
So it would end up creating an extra console?
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:56 UTC
That doesn't depend on dotnet.exe
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:56 UTC
Handles are being inherited before executable's entry point is called
Eric Mellino
@mellinoe
Feb 04 2017 00:58 UTC
My idea was that dotnet.exe could determine if it needed a console after running some code, though. Could it not check if there's already a console before calling AllocConsole?
Nikita Tsukanov
@kekekeks
Feb 04 2017 00:59 UTC
It won't have access unless it has CUI subsystem
Eric Mellino
@mellinoe
Feb 04 2017 00:59 UTC
Like, call this thing: https://msdn.microsoft.com/en-us/library/ms683175(VS.85).aspx, if it returns NULL, then call AllocConsole
Nikita Tsukanov
@kekekeks
Feb 04 2017 01:01 UTC
If I remember correctly, it doesn't matter
Since std handles aren't attached to parent's console
Eric Mellino
@mellinoe
Feb 04 2017 01:03 UTC
Interesting. I'm outside my element here so I'm mostly just guessing. It feels like there should be some way to accomplish this :worried:
Nikita Tsukanov
@kekekeks
Feb 04 2017 01:04 UTC
Do you know how Visual Studio is able to have both run modes?
Console and GUI
Eric Mellino
@mellinoe
Feb 04 2017 01:05 UTC
What do you mean by that?
Nikita Tsukanov
@kekekeks
Feb 04 2017 01:05 UTC
Run attached to console when started from command prompt
And run without console when started by shortcut
Eric Mellino
@mellinoe
Feb 04 2017 01:06 UTC
I don't think there's any difference. It's a GUI application that doesn't create a window if you pass certain command-line args
Nikita Tsukanov
@kekekeks
Feb 04 2017 01:06 UTC
Visual Studio has 2 executables
  • devenv.exe which is started by shell
  • devenv.com which has priority when cmd.exe wants to start devenv
You can't have one executable that can run in proper console and GUI modes
You either can't access to parent's console or have to deal with freshly created console window when started from non-console application
That's how windows works
Eric Mellino
@mellinoe
Feb 04 2017 01:14 UTC
You might be right, I'm beyond my level of understanding here
Steven Kirk
@grokys
Feb 04 2017 08:33 UTC
hi guys, sorry for not getting the .NET core PR merged yet - I can see there's a lot of interest!
I'm feeling much better today
I have some errands to run this morning but will be able to review and hopefully merge this afternoon
in the meantime if anyone else wants to review please go ahead and add comments!
Johan Larsson
@JohanLarsson
Feb 04 2017 08:38 UTC
How many owners are there that can merge?
Steven Kirk
@grokys
Feb 04 2017 08:42 UTC
there are 5 core team members
Johan Larsson
@JohanLarsson
Feb 04 2017 08:43 UTC
good, having only one could be a problem when the project goes take-over-the-world-scale :)
Steven Kirk
@grokys
Feb 04 2017 08:44 UTC
yeah if it were just me that wouldn't be good
danwalmsley
@danwalmsley
Feb 04 2017 09:28 UTC
@grokys pr from a functional point of view is looking good
Avalon studio is porting across quite easily
Steven Kirk
@grokys
Feb 04 2017 09:29 UTC
it's not building for me on 2015 - is it 2017 only?
danwalmsley
@danwalmsley
Feb 04 2017 09:29 UTC
i'll let you know if I find anything that doesn't work
I think you have to install .net core rc3
let me find the link
Steven Kirk
@grokys
Feb 04 2017 09:29 UTC
ah that would make sense
then if it still doesn't work, you might need vs2017
will still build from command line though
stuff seems to run quicker
and use less memory
Steven Kirk
@grokys
Feb 04 2017 09:33 UTC
yep, that builds now, thanks
danwalmsley
@danwalmsley
Feb 04 2017 09:33 UTC
not sure
but I think you have to use skia only?
I think use direct2d wont work for .net core
sharpdx doesn't have .net core nugget package available yet perhaps
Steven Kirk
@grokys
Feb 04 2017 09:35 UTC
i think it does, but there's only a .net standard version of skia so far
that's fine with me for now
i've got to go out now, i've given the code a quick review, but need to actually try to run something using .net core when i get back!
Nikita Tsukanov
@kekekeks
Feb 04 2017 10:00 UTC

it's not building for me on 2015 - is it 2017 only?

I made sure that PR is building on AppVeyor's VS2015.

I'm not sure what exactly you need to install, since I'm using ASP.NET Core since beta4
danwalmsley
@danwalmsley
Feb 04 2017 10:07 UTC
I think he got it wokring
Nikita Tsukanov
@kekekeks
Feb 04 2017 10:08 UTC
Ah, ok
@grokys
https://github.com/kekekeks/avalonia-net-core-example - .NET Core-based example is here. You need to change NuGet.config to point to your nuget package output directory
Steven Kirk
@grokys
Feb 04 2017 12:24 UTC
thanks @kekekeks !
you know i really dislike shared projects
if only visual studio could somehow show the files that get included as part of a shared project it'd be fine
but as it is, they're like hiding source files
Steven Kirk
@grokys
Feb 04 2017 14:21 UTC
@kekekeks is this useful for implementing GetLoadedAssemblies in .net core? http://www.michael-whelan.net/replacing-appdomain-in-dotnet-core/
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 14:22 UTC
@grokys yes it is
we used that in Orleans
Nikita Tsukanov
@kekekeks
Feb 04 2017 14:24 UTC
@grokys tried that
ah ok
Nikita Tsukanov
@kekekeks
Feb 04 2017 14:24 UTC
AppVeyor said something like
"I'm sorry, Dave, I'm afraid I can't do that"
Steven Kirk
@grokys
Feb 04 2017 14:25 UTC
haha ok
Nikita Tsukanov
@kekekeks
Feb 04 2017 14:25 UTC
was working perfectly fine on my machine though
That was the original version of the code
Steven Kirk
@grokys
Feb 04 2017 14:39 UTC
not managed to get the nuget packages build on the .net core branch
A stable release of a package should not have on a prerelease dependency. Either modify the version spec of dependency "SkiaSharp [1.56.1-beta, )" or update the version field.
An error occurred when executing task 'Create-NuGet-Packages'.
Error: NuGet: Process returned an error (exit code 1).
(i'm building from cake)
Nikita Tsukanov
@kekekeks
Feb 04 2017 14:42 UTC
You need to add -something postfix
to your package version
Try with --force-nuget-version=0.4.2-testbuild1
BTW, I think Create-NuGet-Packages target should depend on Build
Not on Run-Unit-Tests
Steven Kirk
@grokys
Feb 04 2017 14:45 UTC
yeah, and it shouldn't do a clean every time either
Nikita Tsukanov
@kekekeks
Feb 04 2017 14:48 UTC
Well, that's arguable
Currently any target runs a reproduceble build
and makes sure that there are no leftovers from the previous one
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 14:58 UTC
Cake script Clean main function is to create directories if they don't exist
Steven Kirk
@grokys
Feb 04 2017 14:59 UTC
whooop, got it running!
yeah, i dunno, sometimes i just want to build changes with cake. not very often though tbh as usually i do that in VS, so /shrug
anyway, the .net core build isn't that straightforward, but it works!
hopefully it will work out of the box on 2017
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 15:01 UTC
@grokys removing this line should probably fix the issue with Clean https://github.com/AvaloniaUI/Avalonia/blob/master/build.cake#L588
this folders are created by msbuild anyway
Steven Kirk
@grokys
Feb 04 2017 15:02 UTC
thanks, it's not a big problem
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 15:02 UTC
ok
Steven Kirk
@grokys
Feb 04 2017 15:02 UTC
just meant that i had to do a complete build again instead of just rebuilding the nuget packages
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:03 UTC
I usually just comment out that dependency when I'm debugging package generation
Steven Kirk
@grokys
Feb 04 2017 15:03 UTC
yeah, that's what i've done before
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:03 UTC
BTW, we need to split that script
It's too huge
Also too much work is done outside of targets
Steven Kirk
@grokys
Feb 04 2017 15:12 UTC
ok, PR looks good. i'm kinda wary about including something that's such a WIP in master, but it's obvious that there's an awful lot of interest in getting this working so I think that's more important
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:13 UTC
Well, it's not WIP
It works)
Just need to fix icons in win32 backend (for some reason we are using Windows.Forms for them) and implement window states for GTK3
Oh, also folder selector in said win32 backend
But that could be done as separate PRs, since current one is already 38 commits
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 15:22 UTC

BTW, we need to split that script

@kekekeks I can try to split cake build script

Steven Kirk
@grokys
Feb 04 2017 15:31 UTC
merged!
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:31 UTC
Thanks!
Are we going to announce it on reddit or just wait for alpha5?
Steven Kirk
@grokys
Feb 04 2017 15:32 UTC
yeah we could, but we'd need to put together some decent instructions first i think
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:34 UTC
That depends on alpha release plan, I think
Steven Kirk
@grokys
Feb 04 2017 15:34 UTC
@kekekeks do you have twitter so i can mention you?
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:34 UTC
Do we want scenegraph to be in alpha5 or not
Steven Kirk
@grokys
Feb 04 2017 15:35 UTC
well i was intending to do an alpha5 before scenegraph
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:35 UTC
Not using it heavily or something
Steven Kirk
@grokys
Feb 04 2017 15:36 UTC
what i meant though was just instructions for building from source for .NET core
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:38 UTC
Well, we have an example for VS2015 tooling
Steven Kirk
@grokys
Feb 04 2017 15:38 UTC
i hope we can have proper .net core support in the release after alpha5 though
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:38 UTC
I could add one for VS2017
Steven Kirk
@grokys
Feb 04 2017 15:39 UTC
right, but e.g. i had to install 2 versions of .net core SDK previews, pass a command-line argument to cake, clone your sample app, update the path to the nuget packages there etc
just instructions such as those because everyone will hit those problems
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:41 UTC
Well, now that packages are published to nuget, you don't need to do all that to use avalonia from net core app
just install VS2017, reference packages and you are ready to go
Well, let's wait for alpha5 then
Steven Kirk
@grokys
Feb 04 2017 15:42 UTC
i dunno, i think it would be good to publicize that we've got it working when building from source
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:44 UTC
One could use our nightly feed, you know
instead of building the whole thing from source
I'll update my example project to do that
Steven Kirk
@grokys
Feb 04 2017 15:44 UTC
ok great
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 15:49 UTC
as much as I hate to say that, but those new MSBuild projects on latest RTM tooling is really nice… very compact without mambo jambo
Steven Kirk
@grokys
Feb 04 2017 15:49 UTC
yeah i can't wait!
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 15:49 UTC
@grokys the MSBuild tooling is released
the VS2017 isnt
:)
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:53 UTC
@galvesribeiro RC3 isn't exatly a "release"
Steven Kirk
@grokys
Feb 04 2017 15:53 UTC
it's a "release candidate" =D
The .NET Core and ASP.NET Core workload is no longer in preview. We have fixed several bugs and improved usability of .NET Core and ASP.NET Core Tooling.
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 15:55 UTC
The RC4 is Visual Studio tooling
not .net core
Nikita Tsukanov
@kekekeks
Feb 04 2017 15:55 UTC
All I see here is RC3
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 15:55 UTC
it is VS tooling
it is a mess those versioning
they already announced on a community meetup
the tooling is done and released. the only part in RC is VS tooling (just a bunch of UI wrappers aroung the underlying tooling) and they now stopped to work on it and are working on netstandard2.0
unless Damian passed the wrong impression to eveyone listening :)
Steven Kirk
@grokys
Feb 04 2017 15:59 UTC
everyone knows that a "release candidate" in MSspeak is a beta ;)
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 15:59 UTC
hehehe
anyway, the latest tooling is being very stable here… even with VS2017 crazyness
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:07 UTC
https://github.com/kekekeks/avalonia-net-core-example - updated example with proper feed url and some docs
danwalmsley
@danwalmsley
Feb 04 2017 16:07 UTC
@wieslawsoltes any chance of making xaml behaviours target .net core too?
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:08 UTC
@danwalmsley you should be able to reference PCL from your project
danwalmsley
@danwalmsley
Feb 04 2017 16:08 UTC
Ah I think once it references new avalonia will be ok then
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:09 UTC
You also need to switch to nightly feed, I think
danwalmsley
@danwalmsley
Feb 04 2017 16:11 UTC
ok
I vote to get scengraph in alpha 5!
Steven Kirk
@grokys
Feb 04 2017 16:23 UTC
it would be nice!
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:26 UTC
It would postpone alpha5 release for a month
@danwalmsley have you encountered DllNotFoundException: Unable to load DLL 'libSkiaSharp':?
Steven Kirk
@grokys
Feb 04 2017 16:31 UTC
yeah, it would be nice but even once it's finished i suspect it'll take a while to work out all the bugs
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:37 UTC
Mkay, my VS install got completely broken
I'm unable to save files
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 16:42 UTC
@kekekeks AvaloniaUI/Avalonia#878
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:44 UTC
Why do you need to explicitly pass/access context ?
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 16:44 UTC
there no access for static helper methods
they are available only in main script
Cake project does the same
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:46 UTC
I wonder if it's possible to have nuget feeds on per-PR basis
Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 16:48 UTC

@wieslawsoltes any chance of making xaml behaviours target .net core too?

@danwalmsley I have updated XamlBehaviors to latest Avalonia build

danwalmsley
@danwalmsley
Feb 04 2017 16:50 UTC
@kekekeks iv not had that on windows
On Linux id get it if ld library path isn't set
Nikita Tsukanov
@kekekeks
Feb 04 2017 16:51 UTC
I'm getting it with VS2017 and .NET Core 1.0-
Works fine with 1.1
danwalmsley
@danwalmsley
Feb 04 2017 16:53 UTC
Iv only used 1.1
@wieslawsoltes nice one, thanks
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:05 UTC
I still wonder if we should wait for alpha5 or just go and claim the title of "The first UI framework for .NET Core"
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:11 UTC
I think you should wait until everything is settle up and people can use the new tooling
otherwise, you will have tons os people jumping in to contribute and they can’t use the new tooling they have
nobody wants to install old tooling anymore
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:11 UTC
Yep, true
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:12 UTC
At least untill you are confortable to update everything to use new tooling I would keep it quiet for now :)
(which I would do now if I were you :P )
danwalmsley
@danwalmsley
Feb 04 2017 17:13 UTC
I think we can claim that title, although may e skiasharp.views might also claim?
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:13 UTC
nah
it is a a fully feature UI framework
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:13 UTC
You see, Skia.Views are targeting specific frameworks
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:14 UTC
yeah but they will change
and
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:14 UTC
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:14 UTC
as far as I know, Skia.View rely on the underlying platform UI kit, so it is not fully feature and independent UI framework like Avalonia
danwalmsley
@danwalmsley
Feb 04 2017 17:15 UTC
"First .net core Xaml UI framework"
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:16 UTC
So we are basically waiting for AppVeyor to provide VS2017 images
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:16 UTC
you dont need it
you can grab the SDK while building
danwalmsley
@danwalmsley
Feb 04 2017 17:16 UTC
Can you just get appveyor to install .net core rc3
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:16 UTC
I have Docker.Dotnet doing that
it still using preview4 btw… I’ll update it to the latest one later
but it is the same principle, just replace the URL with the RC4
you dont need VS2017 for it
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:17 UTC
appveyor/ci#1179 we could request access to their "beta" image here
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:18 UTC
ok, but you dont need
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:18 UTC
You see, installing stuff as a part of the build process
Slows down your builds quite significantly
danwalmsley
@danwalmsley
Feb 04 2017 17:19 UTC
It will get cached won't it?
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:19 UTC
that installation is very simple and fast
don’t even bother to cache it
and it is temporary
danwalmsley
@danwalmsley
Feb 04 2017 17:19 UTC
Its just temporary measure until appveyor catch up
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:19 UTC
dotnet cli takes at least 20 secs on the first run after installation
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:19 UTC
that is the nuget cache
you can cache it no problem
regardless of the tooling
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:20 UTC
I'll request access to their VS2017 image and see what we can do with that
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:20 UTC
and man, what is so critical that 20s would kill ? :P it is temporary
I’m not sure if even with their 2017 image they have the latest tooling there
VS Tooling != .Net SDK tooling
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:21 UTC
Visual Studio 2017 RC image has been updated to the latest RC3 (build 26127.03) released on February 1, 2017
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:21 UTC
we are on RC4
:)
on VS tooling I mean
they will always lag anyway
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:22 UTC
Well, I'd prefer to use the same tools that are installed on my laptop, you know
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:22 UTC
:+1:
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:22 UTC
Got a bit sick of trying to figure out what's wrong on AppVeyor
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:22 UTC
yeah, it is kinda, weird...
Tbh, the only CI agent/service that I like is one from TFS/VSTS… all others are a pain to figure out what is going on
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:23 UTC
Well, let's here @grokys's thoughts on this matter. His main concern was the current state of VS2017, but it got better with the last update
VSTS?
Seriously?
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:24 UTC
yep
seriously
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:24 UTC
It treats stderr output as actual errors
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:24 UTC
use it today and compare with jenkins, appVeyor, MyGet and you will see
Really? do you know it is configurable, right?
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:24 UTC
My favorite one is TeamCity anyway
Where?
I've spent hours looking for that option
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:25 UTC
in the build task options
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:25 UTC
I ended up with this code in my cake build script:
[System.Runtime.InteropServices.DllImport("kernel32")]
static extern IntPtr GetStdHandle(int handle);

[System.Runtime.InteropServices.DllImport("kernel32")]
static extern IntPtr SetStdHandle(int num, IntPtr handle);

[System.Runtime.InteropServices.DllImport("kernel32")]
static extern IntPtr CloseHandle(IntPtr handle);

var stderr = GetStdHandle(-12);
var stdout = GetStdHandle(-11);
SetStdHandle(-12, stdout);
CloseHandle(stderr);

Console.SetError(Console.Out);
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:25 UTC
cake...
I don’t write a single line of code to build :)
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:26 UTC

in the build task options

There is an option for continuing build, but it will still be marked as "partially succeded"

Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 17:26 UTC
вроде все слова понятные... но что происходит не ясно :)
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:26 UTC

I don’t write a single line of code to build

From my point of view that's an awful thing

Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:26 UTC
build, release, CI, CD, everything there… I’m happy with it
unfortunately it isn’t open
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:27 UTC
The ideal build configuration is one that calls a build script
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:27 UTC
the ideal code is the one you didn’t write :D
anyway
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:27 UTC
Yep, but it's nice to be able to migrate between build systems at will
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:27 UTC
endless debate
:)
and you can
danwalmsley
@danwalmsley
Feb 04 2017 17:27 UTC
The gitlab Ci is pretty good, but I think you can only use with gitlab
You can use your own machines
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:28 UTC
export the tasks with a powershell script and be happy :)
danwalmsley
@danwalmsley
Feb 04 2017 17:28 UTC
To run builds so no queuing if you don't want
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 17:30 UTC
Excuse me please very much! On habr you wrote that Avalonia uses Skia to render, and on github it's written that it uses direct2d... what is right?
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:30 UTC
@Igor_Gritsenko_twitter renderers are pluggable
Right now we have Direct2D, Skia# and Cairo
.NET Core version uses Skia#, since SharpDX isn't compatible with .NET Core
Steven Kirk
@grokys
Feb 04 2017 17:32 UTC
IMHO we should wait until 2017 is released before we move to it
i don't want to install 2017 on my main machine because i don't trust it not to break anything yet
i have it installed on another machine for when i have to use it
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 17:33 UTC
Oh. it's clear now. And skia# has no problems to run with Core? Or you have to build skia it also for net core?
danwalmsley
@danwalmsley
Feb 04 2017 17:35 UTC
They just released a version a few days ago with .net core support
@kekekeks has moved very quickly
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:36 UTC
@Igor_Gritsenko_twitter Skia# doesn't have prebuilt native buinaries for Linux. We are currently using our own
See instructions there
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 17:37 UTC
thank ю вери мачъ!
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:37 UTC
Basically we already had almost everything in place and waited for Skia# to provide NETStandard-compatible build
@grokys come on, I'm using VS2017 for some of my production projects
It can't be that bad
Steven Kirk
@grokys
Feb 04 2017 17:39 UTC
ha, me too, and i have found it that bad! :)
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 17:39 UTC
@grokys I'm using vs2017 for all my production projects... because I have small ssd)
Steven Kirk
@grokys
Feb 04 2017 17:39 UTC
seriously, it hangs for 5 minutes on the first build that has an error
FIVE MINUTES
i've not updated to RC3 yet
hopefully they've fixed that
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:41 UTC
there must be something wrong on your deployment @grokys it never happened to me
I’m using it since the very first releases
Steven Kirk
@grokys
Feb 04 2017 17:41 UTC
clean install of windows, clean install of VS
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:41 UTC
@grokys just think about those juicy TypeConverters
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:41 UTC
it had tons of problems
but nothing that a quick restart in it hasnt resolved
Steven Kirk
@grokys
Feb 04 2017 17:41 UTC
are you using it for developing VS extensions? i suspect that might be where the problem lies
Johan Larsson
@JohanLarsson
Feb 04 2017 17:42 UTC
I always wanted to counte the number of exceptions thrown when starting a clean install of vs on a clean windoze
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:42 UTC
VS extension development have always been a mess
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:42 UTC
I recently updated Orleans Extensions to VS2017 and didn’t had problems
Steven Kirk
@grokys
Feb 04 2017 17:42 UTC
tell me about it
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:42 UTC
Regardless of VS version
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:42 UTC

@kekekeks
VS extension development have always been a mess

True story

danwalmsley
@danwalmsley
Feb 04 2017 17:46 UTC
@kekekeks what's required to have mac support for .net core?
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:48 UTC
GTK3 build
It should work with one from brew
But I haven't checked yet
danwalmsley
@danwalmsley
Feb 04 2017 17:48 UTC
Ah ok
@galvesribeiro do you have a mac?
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:49 UTC
I probably messed up with library name postfix formatting though
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:50 UTC
@danwalmsley yes
danwalmsley
@danwalmsley
Feb 04 2017 17:53 UTC
Maybe we can test Avalon studio on it later
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:54 UTC
I'll
Nikita Tsukanov
@kekekeks
Feb 04 2017 17:57 UTC
Mkay, since .NET Core requires stuff from brew anyway, we should be fine with using it for now
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 17:57 UTC
openssl frmo there
Nikita Tsukanov
@kekekeks
Feb 04 2017 18:01 UTC
The thing I don't like about brew is that it makes /usr/local/* writable by user acccount
Nikita Tsukanov
@kekekeks
Feb 04 2017 18:09 UTC
Yep, I've messed up name resolution
Or not
Well, it almost worked
Nikita Tsukanov
@kekekeks
Feb 04 2017 18:22 UTC
Yeah, almost
We need pixel format transformations after all
Steven Kirk
@grokys
Feb 04 2017 18:29 UTC
pretty close!
Nikita Tsukanov
@kekekeks
Feb 04 2017 18:31 UTC
Well, SkBitmap::CopyTo should be able to handle that
Nikita Tsukanov
@kekekeks
Feb 04 2017 18:36 UTC
But after that's fixed it will basically run out of the box
The only thing that I did (aside from installing .NET Core tooling) was brew install gtk+3
Jason Jarvis
@jazzay
Feb 04 2017 18:53 UTC
Nice work getting NetCore support! I'm excited to try it out once my power returns :(
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:03 UTC
@galvesribero, btw, people don't need to install "old tooling", VS2017 works with current solution just fine
Since there are no projects that are using .NET Core
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:09 UTC
I’m not sure about that...
if you have latest tooling installed, it will not work with old (project.json/xproj) based solution
I have a specific case right now
I’m using the latest version and I’m on latest updates, and Orleans doesn’t have updated yet to it
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:10 UTC
There is no xproj )
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:11 UTC
it doesnt build and all the files in Solution explorer are gone
project.json or xproj
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:11 UTC
Csproj + project.json
We are using UWP tooling
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:12 UTC
IIRC that is broken as well… project.json don’t work
with latest tooling
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:13 UTC
Worked half a hour ago with latest vs2017
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:13 UTC
already told you
VS2017 != .Net SDK tooling
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:13 UTC
Meh, just clone solution and open it
With vs2017
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:14 UTC
unless you start doing that magic mabo jambo with global.json to force use old SDK
it will not open, I don’t have that sdks anymore here, only the latest
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:14 UTC
No global.json)
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:14 UTC
and I’m baging my head here with something in docker
will try it later on
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:16 UTC
We are stuck with netstandard1.5, but this project type works with vs2015 and vs2017
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:16 UTC
blob
this is what happens
they are all csproj with project.json
many of them are PCLs
but will try avalonia later
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:17 UTC
So why does it work for me
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:17 UTC
because you are not in the latest tooling
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:18 UTC
I have vs2017 and net core rc3 installed
Where can I get that RC4 thingy?
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:18 UTC
or because you have the previous SDKs installed as well (old tooling) probably
RC4 is latest
1m
Nikita Tsukanov
@kekekeks
Feb 04 2017 19:19 UTC
What is your output from dotnet --version ?
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:20 UTC
1.0.0-rc4-004597
if you are going to try it, be aware that it will break your environment if you dont update the projects
unless you have all other previous tooling installed
The old tooling I’m refering to
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 04 2017 19:46 UTC
that feeling when you get solution from github of of AvaloneUI for .net core and it runs out of the box from the first time
that feeling
sorry :-)
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 19:47 UTC
hehehe
nice
danwalmsley
@danwalmsley
Feb 04 2017 20:08 UTC
@wieslawsoltes
Package Avalonia.Xaml.Behaviors 0.4.1-build329-alpha is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) / win-x86. Package Avalonia.Xaml.Behaviors 0.4.1-build329-alpha supports: portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)
One or more packages are incompatible with .NETCoreApp,Version=v1.1 (win-x86).
Nikita Tsukanov
@kekekeks
Feb 04 2017 20:13 UTC
Meh, just use target fallback
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 20:15 UTC
remve the RuntimeIdentifie while in development as well
you dont need it
put is as a conditional tag so it is only included while targeting release and publishing
Nikita Tsukanov
@kekekeks
Feb 04 2017 20:18 UTC

conditional tag

It will download a metric ton of binaries anyway

Wiesław Šoltés
@wieslawsoltes
Feb 04 2017 21:13 UTC
@danwalmsley Try latest build
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:20 UTC
Yay!
:D
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:20 UTC
Unfortunately that involves unnecessary intermediate bitmap
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:20 UTC
curious @kekekeks the pixel format conversion made with SW without HW accell, right?
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:20 UTC
Since for some reason Skia is unable to just copy and convert pixels to arbitrary memory location
Our Skia renderer is SW-only for now
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:21 UTC
ah ok
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:21 UTC
It's possible to enable HW-accel
But I'm not sure that we need to
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:21 UTC
optimizations are always good :)
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:21 UTC
Since last time I've checked it sometimes caused performance degradation
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:22 UTC
Really?
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:22 UTC
Because of the way that Skia renders text in HW mode
They are using font atlases
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:22 UTC
but I’m happy it work without HW accell because it can work on my HW :P
Ouch!
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:23 UTC
That's why we have to be very careful about what we are rendering on GPU
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:23 UTC
I wonder if chrome uses it for fonts on Skia or if it use some other library for it and paint only the bitmap
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:23 UTC
and what on CPU
I think that once we'll get scenegraph merged
We could start work on GPU support
Since only and composition/effects should be rendered there
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:24 UTC
ic
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:24 UTC
Chrome does not use HW-acceleration for everything
It's mostly used for scene composition and effects there
Text, basic shapes, etc are rendered in SW-mode
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 21:25 UTC
hmm
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:30 UTC
@grokys Do we need pull requests for things like that — AvaloniaUI/Avalonia#879 ?
Steven Kirk
@grokys
Feb 04 2017 21:31 UTC
i'd say so - best to run it through CI
if it's a really minor change then you can disable the protected branch on master if you like, but i usually do a PR anyway
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:33 UTC
I wonder if it's possible to just merge directly if CI checks have passed
Nope, not possible
Steven Kirk
@grokys
Feb 04 2017 21:33 UTC
don't think so: though like i say you can disable the protected branch temporarily
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:34 UTC
It would be a good feature for GitHub BTW
Steven Kirk
@grokys
Feb 04 2017 21:34 UTC
it's nice to have the extra context for commits that PRs give too though
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:34 UTC
Ability to merge without PR
Steven Kirk
@grokys
Feb 04 2017 21:35 UTC
tbh i don't think they'd do it - protected branches are there so that you need to create a PR, merging without one is kinda defeating the point
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:35 UTC
Well, we are mostly using them to make sure that CI checks pass first
That's a valid use case
Steven Kirk
@grokys
Feb 04 2017 21:36 UTC
though this suggests it might be possible: https://help.github.com/articles/about-protected-branches/
but sooo many times since i started at GH i've used the fact that all changes go though a PR to get extra context for a commit
of course it's not so helpful if the PR message is left blank ;)
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:37 UTC
Well, commit message speaks for itself
Steven Kirk
@grokys
Feb 04 2017 21:38 UTC
commit message says what the change does, but a PR description can answer questions like "why did we need to make this change?"
so something like "running on iOS we discovered that the default pixel formal was displaying wrong, so blah blah" etc
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:45 UTC
BTW
AvaloniaUI/Avalonia#877
Why do you think that ShowDialog can be implemented in xplat way?
On linux there is even a special window property
That tells the window manager that some window is modal
Steven Kirk
@grokys
Feb 04 2017 21:47 UTC
ah yeah, that's a really old issue.
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:47 UTC
There also some logic in OSes that prevent modal dialogs to be lower than their parent
Steven Kirk
@grokys
Feb 04 2017 21:48 UTC
i'm guessing there was a lot of stuff in the platform-specific part that could be made x-plat
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:48 UTC
We need to pass window parent though
So we could call user32!SetParent, gtk_window_set_transient_for, etc
We need to go through "old issues" to see if they are still valid
Or we'll get people wasting their time
And put a huge red notice somewhere saying "Before picking an issue to work on consult in gitter chat blablabla"
Nikita Tsukanov
@kekekeks
Feb 04 2017 21:57 UTC
BTW, @grokys
There are cases when ITopLevelImpl is being called after disposal
They mark the methods that are being called after disposal
Contributing
Before You Start
Drop into our gitter chat room and let us know what you're thinking of doing.
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:20 UTC
Should be in README.md, I think
Steven Kirk
@grokys
Feb 04 2017 22:21 UTC
there's a link to it under "Contributing" in the readme
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:22 UTC
A big red warning on top of the issues/pull requests page would be a nice feature for GitHub...
Steven Kirk
@grokys
Feb 04 2017 22:24 UTC
i think they may be currently thinking about how to better get people "started" with contributing
i've pinged you on the PR if you want to add your input
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:27 UTC
So you are executing a layout pass inside render cycle
Steven Kirk
@grokys
Feb 04 2017 22:29 UTC
where?
Here
+                    Measure(Size.Infinity);
+                    Arrange(new Rect(DesiredSize));
Steven Kirk
@grokys
Feb 04 2017 22:30 UTC
that was already happening
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:30 UTC
Wow, async tests. The Future is here
Steven Kirk
@grokys
Feb 04 2017 22:31 UTC
the visual brush stuff has on scenegraph has to change though anyway
i've still not quite figured out the best way to do it
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:32 UTC
Last time I was touching that code, I was just copy-pasting it to some class shared across backends. Still don't understand, how it actually works
BTW, we need some docs on how scenegraph works, I wasn't able to find the place where layers are being created
And criteria for their creation
Steven Kirk
@grokys
Feb 04 2017 22:34 UTC
yeah i know... sorry things have just been changing too much
there will be docs soon
but as for the layout thing on visual brushes the problem comes when you have something like:
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:34 UTC
If I understand correctly the basic idea is to have some "shadow" of the visual tree
And then split that shadow tree to layers
Steven Kirk
@grokys
Feb 04 2017 22:35 UTC
yep, currently a layer is only created when you have opacity
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:36 UTC
Are you checking for ClipToBounds?
Steven Kirk
@grokys
Feb 04 2017 22:36 UTC
so if you e.g. change the opacity of a UserControl then its contents don't need to be redrawn, just the layer with the new opacity
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:36 UTC
Because being in a layer kinda forces that clipping

so if you e.g. change the opacity of a UserControl then its contents don't need to be redrawn, just the layer with the new opacity

I think that's how Chrome currently works

Steven Kirk
@grokys
Feb 04 2017 22:37 UTC
right. that's why at the moment layers are the size of the window: because there may be stuff outside the bounds
it's less than ideal
yeah, i looked at chrome's devtools and it seems to create a layer on opacity
though they're intellegent and the layer is only the size it needs to be
we can do that, but it will come later
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:39 UTC
If ClipToBounds is true, you can safely reduce the size of the layer
Steven Kirk
@grokys
Feb 04 2017 22:39 UTC
yep, but we actually have the bounds of the actual subtree available so we can also do it even if cliptobounds is false
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:40 UTC
Would be nice to have layers tab in devtools
Steven Kirk
@grokys
Feb 04 2017 22:40 UTC
yep!
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:40 UTC
And it will be a killer-feature for presentations
When you need to talk about rendering, just create some slider bound to opacity/rotation and show people how layers are being created
Steven Kirk
@grokys
Feb 04 2017 22:42 UTC
yeah, you can actually see it working in controlcatalog at the moment though
when a tab fades in/out it doesn't redraw the children
we also can do things like merge sibling controls with the same opacity into a single layer etc too
atm disabled buttons use opacity (not ideal i know) but this means that if you have two disabled buttons on a window, then 3 layers are created
you really only need 2
i also really want a way to do viewport scrolling so that you don't have to redraw everything on scroll
not sure what the API for that would look like though!
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:46 UTC
You definetely need a separate layer for scrollable area then
Steven Kirk
@grokys
Feb 04 2017 22:46 UTC
yeah
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:47 UTC
Since you probably won't be able to access previous frame contents
Steven Kirk
@grokys
Feb 04 2017 22:47 UTC
i don't think WPF or UWP have that
but i don't know if you noticed in the RenderTest sample - it has proper geometry hit detection
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:49 UTC
Btw another feature from chrome we should bring over is a way for a control to specify that it needs a render layer (for controls that do 3d rendering or video presentation
)
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:49 UTC
Does retained renderer run in a separate thread?
Steven Kirk
@grokys
Feb 04 2017 22:49 UTC
@jkoritzinsky yep, there will definitely be a way to do that - we can borrow WPF's syntax i think
@kekekeks yep
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:50 UTC
So how that exactly works? Controls are provided with a fake DrawingContext?
Steven Kirk
@grokys
Feb 04 2017 22:50 UTC
yeah exactly
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:50 UTC
Also, optional platform implementations for the render layers like kekekeks and I talked as a possibility about a while ago?
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:51 UTC
What happens if control needs RenderTargetBitmap?
@jkoritzinsky would ILockedFramebuffer be enough for that?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:52 UTC
Maybe...
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:52 UTC
So it would be something like WritableBitmap from WPF
The main issue with "direct" rendering to layer would be locking
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:53 UTC
There are a few specific cases I'm thinking of. Can I run them by you and you can tell me if they might work with that?
Steven Kirk
@grokys
Feb 04 2017 22:53 UTC
at the moment layers are IRenderTargetBitmapImpls but this isn't good on D2D
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:53 UTC
So we need to provide double buffering anyway
Steven Kirk
@grokys
Feb 04 2017 22:53 UTC
as they're WIC-backed bitmaps which need conversion to show in D2D
so i'm thinking we need something like IRenderTargetBitmapImpl IRenderTarget.CreateLayer() which on D2D would create a D2D bitmap
would that work for you @jkoritzinsky ?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:55 UTC
Partially...
The main situations I'm thinking of are 2 things
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:56 UTC
I think that we need to provide some sort of negotiation protocol
Between subsystems
Something like IWindowImpl::Surfaces
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:56 UTC
On OSX for AvaloniaAV, the AV player object only renders to a NSView or a CALayer
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:57 UTC
With emulated framebuffer being default one, since it's universally accessible
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:57 UTC
One idea is using the render layers backed by a render target bitmap or a frame buffer as a fallback and allowing platforms to supply platform specific render layers
Like DirectComposition when on Windows 8+ or CALayer on iOS/macOS
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:58 UTC
Mkay, so, in case of OSX and Skia
How are we supposed to provide that CALayer?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 22:59 UTC
SkiaSharp.Views has an implementation of skia on a CALayer
We can always pull from there
Nikita Tsukanov
@kekekeks
Feb 04 2017 22:59 UTC
It renders to CALayer, not vice versa
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:00 UTC
I'm really not sure then.
Skia could always use the default fallback
Steven Kirk
@grokys
Feb 04 2017 23:00 UTC
this is for showing video right?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:00 UTC
That's the use case I'm currently looking at
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:00 UTC
BTW, could you tell me exact class name that can draw to CALayer?
SKGLLayer?
Steven Kirk
@grokys
Feb 04 2017 23:01 UTC
so what use-cases do we have? 1. render layers 2. video layers
Steven Kirk
@grokys
Feb 04 2017 23:01 UTC
wouldn't video playback be implemented entirely in the rendering subsystem though?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:01 UTC
  1. 3d interop/embedding
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:01 UTC
You see, that class renders to OpenGL context provided by CoreAnimation
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:01 UTC
I know
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:02 UTC
There is no way of accessing another layer's contents from skia
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:02 UTC
I think I may have mis worded what I meant
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:02 UTC
Unless we do some voodoo magic with opengl FBOs
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:02 UTC
Have Quartz/CoreGraphics (on OSX/iOS) use CALayers
Instead of everything on those platforms
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:03 UTC
I'm not sure that you can manually compose CALayers from CoreGraphics
But it might be worth to use CoreAnimation directly
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:04 UTC
That sounds good to me
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:04 UTC
So, basically you suggest that we draw everything to CALayers
And then let coreanimation do the composition
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:04 UTC
Yep. Like 1 CALayer for each render layer
And then compose with core animation
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:05 UTC
that is how the appkit does, right?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:05 UTC
As far as I know yes
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:05 UTC
you can even “debug” the layers individually in runtime
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:06 UTC
That will require scenegraph to not compose layers direclty
And let drawing platform do that instead
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:06 UTC
And we do the composition on platforms that can't do it natively (IE skia and d2d on win7)
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:06 UTC
I think iOS and Android does it
dunno about OS X itself
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:07 UTC
Android doesn't have API for controlling that
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:07 UTC
OSX is very similar to iOS in terms of lower level rendering libraries
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:07 UTC
You are stuck with Views, not layers
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:07 UTC
humm
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:09 UTC
I wish I could met you guys before :)
I would love to see AngleSharp being used in a xplat C# browser engine
today what is missing is the rendering
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:09 UTC
well everything i know about this i learned from @kekekeks in a previous convo
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:09 UTC
this guys has an awesome HTML and CSS lib
plugable JS engine...
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:10 UTC
Awesome
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:10 UTC
what he misses is plug together HTML and CSS libraries and create a library to create the render three
I’m very dumb with UI stuff, so I didnt even try
I spoke with the creator, a nice guy
unfornutalye he dont have much time to dedicate
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:15 UTC
I see one issue with external layer composition
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:17 UTC
What?
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:17 UTC
For example you have something like
<StackPanel Background="Red" Padding="10">
       <Button Opacity = "0.5"/>
       <MySuperControl ClipToBounds="False"/>
</StackPanel>
In this case a layer is allocated for Button
Gutemberg Ribeiro
@galvesribeiro
Feb 04 2017 23:17 UTC
they are 3 layers
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:18 UTC
But MySuperControl expects to draw on top of that Button which is now a separate layer
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:18 UTC
Oh...
I see it
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:18 UTC
If we are doing manual composition, we control the order of drawing operations
Do we draw background, draw layer and then draw MySuperControl
But if we want to use external composition
We need to introduce a lot more layers
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:20 UTC
How does chrome handle this issue? Or it is not relevant for them?
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:20 UTC
In this case one for StackPanel, one for Button and one for MySuperControl
That's a good question for investigation
And I'm not sure that MySuperControl drawing on top of Button is a valid scenario anyway
Since I would expect it to draw on StackPanel, but not on the Button
But what if it needs some glow effect?
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:21 UTC
Because our last conversation we were using chrome as our example when you first showed me the perf considerations for using native render layers
Maybe take a look at how WPF does it?
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:22 UTC
From performance point of view there is no much difference between native layers and manual composition
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:22 UTC
We were talking about layer per visual or limiting rules for when to create render layers
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:23 UTC
Yep, I remember that
But we were talking about layers in general, not native/manual layers in particular
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:23 UTC
True true
Could we potentially have native layers for only controls that really need it and use manual ones in other situations?
Or is that not practical
I'm not super experienced with advanced rendering contexts.
*concepts
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:26 UTC
I'm not sure that we can mix them this way
From rendering system's point of view native layers are no different from native child windows
And since they allow alpha-channel for child windows since Win8
(Linux had that since forever)
There is no difference at all
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:27 UTC
Ok. Because I'm not sure how some interoperability scenarios would work efficiently without native layers since they'll already designed to work together: Video rendering and D3D11 swap chain embedding for 3d rendering
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:28 UTC
Native layers become an issue if you want to paint on top of them
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:28 UTC
The difference between child windows and composition layers is that composition layers can be transformed with affine transforms (which I don't think you can do with win 32 embedded windows)
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:29 UTC
Yep, but that's not related to z-ordering issue
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:29 UTC
I understand that. We need to figure out if that's a use case we need to support (just like these other ones)
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:30 UTC
So we need to create some kind of a list of cases when you want to paint on top of another layer
And check if there are valid ones there
But painting on top of sibling control is a valid one for sure
You might want to drop shadow from menubar, etc
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:31 UTC
Yep. And check if there are efficient ways to do the use cases that require native layers with manual ones instead
Or if we even want to support those other use cases
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:32 UTC
So, basically we need to check if we can have a separate "composition system"
BTW, said separate compositor will be good in general, since it will allow to use HW-acceleration to compose SW-drawn layers
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:33 UTC
I agree I think that would be good
How do other frameworks that use the layers manage the shadow issue?
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:37 UTC
No idea
CALayer has built-in shadow support
See shadow* prefixed properties
If we go down this road, I think that we should design our layer system using CoreAnimation as a reference
And in case of Direct2D1 we could still use our own composition implementation
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:41 UTC
Could we use DirectCompositon on win8+ and use a fallback impl on win7?
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:41 UTC
Since you only need D2D bitmaps to be exposed
You see, the more backends we have, the more we are prone to bugs
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:41 UTC
True
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:41 UTC
And more affected by limitations of said backends
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:41 UTC
And we need a manual one for skia anyway
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:42 UTC
So if we could compose the scene manually and if it doesn't impose any limitations
We should go for it
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:42 UTC
Ok.
I get that
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:42 UTC
Unless there are some components that require you to use DirectComposition
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:43 UTC
Not as of now. But I can't think of another good way to get a dxgi swap chain to render to a d2d bitmap without going through DC in some way
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:43 UTC
My last windows-related HW-acceleration experience comes from DirectX 9 times, so I can't make an educated choice here
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:43 UTC
Maybe we should make a wiki page and try to do some research and collect it there?
Or create an issue
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:44 UTC
And we definitely need a summary of this discussion
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:44 UTC
Yes
Can you create it and put start the summary? I'm away from my computer right now( typing this on my phone)
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:45 UTC
So the plan for now is to use RenderTargetBitmaps as layers and once scenegraph is complete we can see if it's possible to extract some kind of separate composition system
Well, it's 2:45AM here...
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:47 UTC
Oh right time zones. I'll put the summary together
Steven Kirk
@grokys
Feb 04 2017 23:47 UTC
yep, i've been unable to comment as i'm not knowledgeable enough, but that sounds good to me
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:50 UTC
BTW, could adorner layer be a solution for "paint-over-sibling" issue?
Adorners are rendered in some layer that's on top of an element or a group of them
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:52 UTC
Right now the adorner layer renders on top of everything
Not on top of individual controls
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:52 UTC
Does it have to be that way?
And it might actually be OK
Jeremy Koritzinsky
@jkoritzinsky
Feb 04 2017 23:53 UTC
It doesn't have to be. That's just how it is today.
Nikita Tsukanov
@kekekeks
Feb 04 2017 23:53 UTC
Out-of-borders and on-top-of-everything painting is needed mostly for user interaction
In conclusion. The main question is:
Can we have a separate render step that composes layers, or do we need to mix render composition with drawing operations?