These are chat archives for AvaloniaUI/Avalonia

11th
Aug 2016
MitchellBot
@MitchellBot
Aug 11 2016 02:50
I'm trying to get Avalonia built for the first time but I'm having trouble with some of the references, anyone willing to help a newb?
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2016 02:51
What issues are you having?
MitchellBot
@MitchellBot
Aug 11 2016 02:51
I seem to be completely missing some packages like Avalonia.Cairo
And there are lots of missing references for something called Pango
Shouldn't the trunk have had all necessary references?
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2016 02:52
Did you install GTK#?
And restore the nuget packages?
MitchellBot
@MitchellBot
Aug 11 2016 02:52
yeah
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2016 02:53
Odd.
Which version of GTK#?
You need GTK 2.12
Not 2.99
MitchellBot
@MitchellBot
Aug 11 2016 02:53
oh, that's probably it then, I think I just downloaded the latest
I'll try that, thanks
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2016 02:54
np
MitchellBot
@MitchellBot
Aug 11 2016 02:59
yep, that was it, thanks again
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2016 03:00
No problem at all!
MitchellBot
@MitchellBot
Aug 11 2016 03:19
Is testapplication supposed to throw a breakpoint on exiting?
blob
This message was deleted
it's weird, kinda' like a native DLL throwing
oh... yeah... KERNELBASE.dll 0x4000001f
Steven Kirk
@grokys
Aug 11 2016 05:30
@MitchellBot ok yeah, that's definitely supposed to happen! it took me a long time to implement that ;)
j/k
I have no idea what's going on there!
Andrew
@zezba9000
Aug 11 2016 17:33
@MitchellBot If you turn on native code debugging in the .NET settings page it might give you more info
danwalmsley
@danwalmsley
Aug 11 2016 17:46
Github.com
Darnell Williams
@Seeker1437
Aug 11 2016 17:49
;)
danwalmsley
@danwalmsley
Aug 11 2016 19:53
How did that happen!
danwalmsley
@danwalmsley
Aug 11 2016 21:30
can anyone tell me why in skia backend we need a TypeFaceCache?
Darnell Williams
@Seeker1437
Aug 11 2016 21:33

Android I think is the main reason

For handling custom fonts

danwalmsley
@danwalmsley
Aug 11 2016 21:33
why?
Darnell Williams
@Seeker1437
Aug 11 2016 21:37
The font cache helps it know what fonts are available
danwalmsley
@danwalmsley
Aug 11 2016 21:38
I'm not sure that's the reason because the cached fonts are not available publically
looks like its just to stop memory being re-allocated every time you render with same font style...
Darnell Williams
@Seeker1437
Aug 11 2016 21:41
Well that is what is accomplished, without the cache it would have to keep looking for and loading fonts, usually the fonts are all detected and loaded into the cache then availability is determined from the cache, if there is a miss (font does not exist) the developer could make it try to reload the font cache in search of new fonts, or use a defaulted one
Windows has a font cache, but I think it's there for other platfomrs that might now have one skia can use directly
danwalmsley
@danwalmsley
Aug 11 2016 21:41
ah I fogot to post the linke
I was referring to this
Darnell Williams
@Seeker1437
Aug 11 2016 21:43
I know, it's common for the OS and just applications to have them though :O
Oh
I see what you mean
Darnell Williams
@Seeker1437
Aug 11 2016 21:50
XD
sorry @danwalmsley I think it's there to interacts with skia's font cache, You could do it directly in the FormattedTextImpl, but I guess it was seperated to make the code look neater
danwalmsley
@danwalmsley
Aug 11 2016 21:57
hmm yeah, trying to fix fonts in skia
they were coming out wrong
and its all down to this caching code...
looks like iv got it to work now ;) looks identical to Window now...
danwalmsley
@danwalmsley
Aug 11 2016 22:08
if anyone that worked on skia backend could take a look at #680, id be grateful if you could approve it ready for merge
:) have fixed the font style and font weight issues on skia now
@wieslawsoltes this might make core2d like closer on skia in comparison to Direct2d version
Wiesław Šoltés
@wieslawsoltes
Aug 11 2016 22:09
nice
danwalmsley
@danwalmsley
Aug 11 2016 22:11
for example this is what AvalonStudio splash screen (courtesy of the excellend @Seeker1437 ) looks like on Direct2d
image.png
this is what it looks like on skia on current builds...
image.png
you can see fonts are all wrong
this is what it looks like with my PR
Wiesław Šoltés
@wieslawsoltes
Aug 11 2016 22:13
fonts look much better :)
danwalmsley
@danwalmsley
Aug 11 2016 22:14
image.png
so current skia backend makes text much bolder than it should
now they are identical I think
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:15
Alpha4 got released, huh?
danwalmsley
@danwalmsley
Aug 11 2016 22:16
well almost identical
@kekekeks yeah!!!!
really good release!
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:16
Did you update vs extension with new packages?
I was a bit busy, so I've paid no attention for the chat (
danwalmsley
@danwalmsley
Aug 11 2016 22:17
I think @grokys updated it yes
pretty sure he did
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:19
Any news on GTK with .NET core?
or skia# on linux?
danwalmsley
@danwalmsley
Aug 11 2016 22:20
my brother has managed to build and run skiasharp on Linux now
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:20
Wow
danwalmsley
@danwalmsley
Aug 11 2016 22:20
he had to create his own makefile to build it all
but we haven't managed to do the plumbing of avalonia to skia
maybe you might be able to help us with it?
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:20
I think there was someone who managed to build that on RPI using their cake build system
danwalmsley
@danwalmsley
Aug 11 2016 22:21
it was a nightmare mate
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:21
I can provide you with my old makefiles
danwalmsley
@danwalmsley
Aug 11 2016 22:21
it took him the whole weekend
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:21
The main issue with the build is to strip unneeded stuff
Since library is HUGE
danwalmsley
@danwalmsley
Aug 11 2016 22:21
I don't understand an any of it, best to talk to @jameswalmsley about it
danwalmsley
@danwalmsley
Aug 11 2016 22:21
yeh
ah cheers
yeh I think the difficulty now if getting a SKBitmap (skia bitmap)
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:22
The main idea is to make compiler to generate an own translation unit for each function
So linker can include only the stuff that is actually used
danwalmsley
@danwalmsley
Aug 11 2016 22:24
to be displayed on a gtk window
Wiesław Šoltés
@wieslawsoltes
Aug 11 2016 22:24
You may look at this AvaloniaUI/Avalonia#677
danwalmsley
@danwalmsley
Aug 11 2016 22:24
@jameswalmsley you getting all this?
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:24

yeh I think the difficulty now if getting a SKBitmap (skia bitmap)

That's actually pretty easy

I can provide you with some C# code that will be capable of displaying image from pointer to bitmap data
danwalmsley
@danwalmsley
Aug 11 2016 22:25
I think we have a SKBitmap with the test app rendered into it
just cant get it to show in the window
or we are not sure how
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:26
The trick is to use libX11
danwalmsley
@danwalmsley
Aug 11 2016 22:26
best to speak with @jameswalmsley when he is around
danwalmsley
@danwalmsley
Aug 11 2016 22:26
yeh that sounds like it should be pretty efficient
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:26
Here is C++ code, I can translate it to c# if you want
danwalmsley
@danwalmsley
Aug 11 2016 22:26
awesome!!
its so close to working now
the hard bit was getting skiasharp to compile!!!
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:27
Yeah, that's a bit nightmarish
Have you managed to strip the binary size?
It was something like 50M for me at first
danwalmsley
@danwalmsley
Aug 11 2016 22:27
woah! really
I'm not sure what size ours is
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:27
Got it stripped down to 2M
danwalmsley
@danwalmsley
Aug 11 2016 22:28
I know he tried to build just what was needed
because at first it wouldn't link and he had to keep adding more bits
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:28
Meh, you need to just strip unneeded bits using linker
danwalmsley
@danwalmsley
Aug 11 2016 22:29
--gc-collect?
This scripts extracts all .o files from static libs
So you linker can treat them as your own object files
danwalmsley
@danwalmsley
Aug 11 2016 22:30
ah cool
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:31
Another trick is to use -ffunction-sections and -fdata-sections compiler flags
So compiler will create a section for each function and static variable
And these can be stripped away by the linker
danwalmsley
@danwalmsley
Aug 11 2016 22:31
ah yes that's what I was thinking of when I said -gc-collect
(getting tired here)
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:31
-Wl,-gc-sections actually
The problem is that -gc-sections doesn't work if you don't use compiler flags
so gyp file needs to be patched
danwalmsley
@danwalmsley
Aug 11 2016 22:32
what else is missing from skia?
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:32
Disabling rtty using --fno-rtty also removes a lot of garbage
danwalmsley
@danwalmsley
Aug 11 2016 22:32
because now running Avalon studio on skia looks pretty complete
we even have SetForegroundBrush working now ;)
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:33
Well, hw-acceleration
danwalmsley
@danwalmsley
Aug 11 2016 22:33
whats needed to get that
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:33
I'd prefer them to expose GrRenderContext API
danwalmsley
@danwalmsley
Aug 11 2016 22:34
when I run AvalonStudio on skia , even with software rendering is faster than on normal windows build
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:34
And then wire up opengl from C#
danwalmsley
@danwalmsley
Aug 11 2016 22:34
I don't know if hardware rendering adds in a tiny bit of lag maybe?
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:36
It would be nice if you provide me with your skia binary
So I could add X11 window render target to our backend code and test it
danwalmsley
@danwalmsley
Aug 11 2016 22:38
I don't have it.
its my brother he compiled it on his machine
iv only seen it on remote desktop
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:39
Well, there is no rush
danwalmsley
@danwalmsley
Aug 11 2016 22:39
erm actually I think he posted it to github
let me look
I think there are binaries somewhere in there
haha 67MB
woah!
Nikita Tsukanov
@kekekeks
Aug 11 2016 22:40
Yeah
I've run into the same issue
danwalmsley
@danwalmsley
Aug 11 2016 22:41
i'll tell him to follow your advice to strip it down
Darnell Williams
@Seeker1437
Aug 11 2016 23:07
Hmmm well @kekekeks that is stripping it down to what Avalonia needed right?