These are chat archives for AvaloniaUI/Avalonia

26th
Apr 2017
Jeremy Koritzinsky
@jkoritzinsky
Apr 26 2017 01:25
@kekekeks SharpDX has a .net core compatible build in the 4.0.0 packages. I ported the system over about a month or so ago
Nikita Tsukanov
@kekekeks
Apr 26 2017 11:52
@grokys @jkoritzinsky Direct2D seems to be broken after that change with DX11
On lots of machines it simply doesn't work anymore
Throwing exceptions from static constructor, giving blank window, etc
Steven Kirk
@grokys
Apr 26 2017 11:59
hmm
you mean the direct2d 1.1 change?
sounds like we may have to go back to d2d 1.0
but i was experiencing issues resizing using the deferred renderer with that
as the render target there automatically resizes itself and its contents
Nikita Tsukanov
@kekekeks
Apr 26 2017 12:11
Well, getting E_NOINTERFACE inside of static constructor is definitely not an option
Can we at least move initialization somewhere
So in case of non-operational Direct2D we could fall back to skia?
Or just ship Skia as default renderer in the next release
Steven Kirk
@grokys
Apr 26 2017 12:51
is there an issue for this?
soerendd
@soerendd
Apr 26 2017 12:54
Is this the cause for the missing opacity when using skia?
grafik.png
Nikita Tsukanov
@kekekeks
Apr 26 2017 12:54
AvaloniaUI/Avalonia#869
@soerendd Seems to be so
It looks like that SkiaSharp lacked some API surface when our backend was being ported from C++ version
soerendd
@soerendd
Apr 26 2017 13:04
It's still missing in SkiaSharp master.
the cause could be that that method is also missing in the skia c interface. It is available in the skia c++ interface
Nikita Tsukanov
@kekekeks
Apr 26 2017 13:09
It's probably can be done by setting Color or something
In C++ API it's just a wrapper, I think
So it can be replaced by SetColor call or something like that
soerendd
@soerendd
Apr 26 2017 13:18
You are right. For me it seems to be a problem in skia itself because the color is set with the correct opacity
grafik.png
Nikita Tsukanov
@kekekeks
Apr 26 2017 13:34
The trick was to multiply existing opacity by saved one
or something like that
It was working fine with our C++ backend
soerendd
@soerendd
Apr 26 2017 13:37
Yes the code this. I see that when the text is drawn the paint struct has a color alpha of 25 which is 0.1*255 (opacity was 0.1)
Nikita Tsukanov
@kekekeks
Apr 26 2017 14:57
@grokys I highly suspect that VS performance issues are related to tons of interlinked projects
I'm currently trying to resolve freezes that occur when trying to use VS extension with our main repo
And it turns out that most of time was spent inside of code that's resolving project references
It's really slow in this version
Are you sure that we need that division between Avalonia.Base, Avalonia.Visuals, etc to be done using separate projects?
If I remember correctly, you wanted it to be that way to avoid circular dependencies
Nikita Tsukanov
@kekekeks
Apr 26 2017 15:13
@grokys I'm getting DXGI_ERROR_INVALID_CALL/InvalidCall on scenegraph at tooltip page after closing said tooltip
It seems to be trying to create a swap chain on top of destroyed window
Nevermind, exception was catched
@grokys Do you have any visualization for layers?
Steven Kirk
@grokys
Apr 26 2017 15:32
like a debug visualization? not yet
Nikita Tsukanov
@kekekeks
Apr 26 2017 15:35
Is there any way to do it for presentation purposes? Like render a transparent rectangle on composition or something
Or do they occupy the whole window anyway?
Steven Kirk
@grokys
Apr 26 2017 15:36
yeah, i dont think it would be too hard, however for the moment all layers are the same size as the window
yep, that
i assume you're talking about when using the deferred renderer?
Nikita Tsukanov
@kekekeks
Apr 26 2017 15:36
Yeah
Well, I guess I can run some post-processing on them
And recolor non-transparent pixels or something
Steven Kirk
@grokys
Apr 26 2017 15:37
yeah - the immediate renderer doesn't use layers directory, though D2D creates its own when transparency is set. i assume you'll need to do that for skia too...
Nikita Tsukanov
@kekekeks
Apr 26 2017 15:38
I just need something on the screen for demo
Steven Kirk
@grokys
Apr 26 2017 15:39
hmm, like applying effects to layers?
Nikita Tsukanov
@kekekeks
Apr 26 2017 15:51
Yep, something like that
Steven Kirk
@grokys
Apr 26 2017 16:06
yeah, that's something for the future but there's nothing like that right now
Nikita Tsukanov
@kekekeks
Apr 26 2017 16:13
RenderTarget doesn't allow me to use effects
for some weird reason
Nikita Tsukanov
@kekekeks
Apr 26 2017 16:35
Mkay, I've added shadow effect
@grokys can you explain why disabled radio button have it's own layer?
Seems pretty inefficient
And contents of LayoutTransform control don't
Steven Kirk
@grokys
Apr 26 2017 16:37
yeah, it is very inefficient, and it's not just disabled radio buttons, it's disabled buttons too. the default style for (radio)buttons set the opacity on disabled
which causes a layer to be created
Nikita Tsukanov
@kekekeks
Apr 26 2017 16:41
Ouch
Why layers aren't created for controls with RenderTransform?
Steven Kirk
@grokys
Apr 26 2017 16:43
that's more of a performance thing, whereas layers for opacity is pretty much necessary
Nikita Tsukanov
@kekekeks
Apr 26 2017 16:49
Where can I find the logic that decides to create a layer for a visual?
var startLayer = opacity < 1 || visual.OpacityMask != null;
This line?
Nikita Tsukanov
@kekekeks
Apr 26 2017 17:00
I've added (visual.RenderTransform != null && visual.RenderTransform.Value != Matrix.Identity) there
Since I need something for demo purposes
That won't be only marking disabled checkboxes
Steven Kirk
@grokys
Apr 26 2017 17:00
haha sure
Nikita Tsukanov
@kekekeks
Apr 26 2017 17:03
but it might be worth keeping
Since chrome allocates layers for transformed elements
Nikita Tsukanov
@kekekeks
Apr 26 2017 17:16
And now I have no idea how to apply opacity to layer rendered with effects...
Nikita Tsukanov
@kekekeks
Apr 26 2017 17:30
visualizer.gif
@grokys
Steven Kirk
@grokys
Apr 26 2017 17:32
oh nice! what are you using to create the shadows?
@danwalmsley @wieslawsoltes @Seeker1437
Updated VS extension
https://www.dropbox.com/s/i0l0qlt4jrxr7ou/AvaloniaVS.vsix?dl=0
Darnell Williams
@Seeker1437
Apr 26 2017 17:40
Thanks!
Also R# doesn't support official VS2017 for some reason
Nikita Tsukanov
@kekekeks
Apr 26 2017 17:41
Ehm, what?
I'm running with R# enabled right now
Nikita Tsukanov
@kekekeks
Apr 26 2017 18:49
@grokys Is it me or there is a huge rendering lag on scenegraph branch?
It's most noticeable with sliders, I think
Steven Kirk
@grokys
Apr 26 2017 19:19
i've not seen that, no
does it happen on scenegraph before your changes?
Nikita Tsukanov
@kekekeks
Apr 26 2017 19:38
I'm running windows in VM, that might be the case
lag.gif
Nikita Tsukanov
@kekekeks
Apr 26 2017 19:47
Yep, happens even without my changes
I have only 32FPS though
BTW, are you sure that we need to recompose the scene on every frame?
it eats quite a lot of CPU time in my case
Steven Kirk
@grokys
Apr 26 2017 19:56
let me try
we definitely don't need to recompose the scene on every frame
it's mentioned in the PR:
All layers are still composited on every frame, whether there is something to draw or not. This is beacuse D2D is double buffered and we need to be sure both buffers are updated. We need to provide dirty rects when flipping the swap chain to fix this.
Nikita Tsukanov
@kekekeks
Apr 26 2017 19:59
Well, some of skia's target surfaces might be not preserving back buffer at all
Steven Kirk
@grokys
Apr 26 2017 20:00
yeah, i don't see that lag with sliders here
looks like input lag even. does it go away if you use the immediate renderer?
Nikita Tsukanov
@kekekeks
Apr 26 2017 20:02
Mostly
That may happen because of the fact that render thread always lag for at least one frame
And when FPS is low that one frame becomes noticeable
Since there is also RDP between the display and the app
Those lags add up
Steven Kirk
@grokys
Apr 26 2017 20:17
yeah, i suspect it might be that