These are chat archives for AvaloniaUI/Avalonia

10th
Apr 2018
Anvar
@GSTQ
Apr 10 2018 03:44
@grokys @danwalmsley was right. I set xaml.cs file to compile, and remove compile option from xaml and it work. If you need i may upload my repository again
bleepzter
@bleepzter
Apr 10 2018 05:00
hello
I am wondering how do I join the project/become contributor?
Steven Kirk
@grokys
Apr 10 2018 06:47
@bleepzter best place to start is here! what are you interested in doing?
Every single Cs file is explicitly set to compile
If you add a new Cs file to the project you have to manually add another entry in the csproj file
Steven Kirk
@grokys
Apr 10 2018 08:06
ah ok, yeah we should really update those csprojs
danwalmsley
@danwalmsley
Apr 10 2018 08:07
I'll send a PR later today 😀
Steven Kirk
@grokys
Apr 10 2018 08:07
i thought you were talking about the csprojs from the templates
danwalmsley
@danwalmsley
Apr 10 2018 08:07
Ah ok
Eric Mellino
@mellinoe
Apr 10 2018 08:25
Hey all -- random question. Is there any way to accomplish something like AvaloniaUI/Avalonia#6 at the moment? It would be cool to be able to embed a "Veldrid widget" into an app. I have a general feel for what it would look like in theory, but I'm not sure what's exposed from Avalonia
If there's anything like this SDL2 function then I think I'd understand how it would work
se5a
@se5a
Apr 10 2018 08:49
interested in doing something like that myself, though I have no idea where to even begin
Weboholics
@Weboholics
Apr 10 2018 09:40
A question, I saw that Avalonia is using different backend for rendering (gtk on linux). Have you considered using Vulcan lowlevel 3d API? As I understand its supported (or will be) by Linux, Windows and Mac. Now with Wayland I think also all 3 OS are using Display Servers? Couldn't this simplify the architecture and minimize OS specific code?
Didn't WPF use DirectX as backend? so Vulcan would be very similar...
Steven Kirk
@grokys
Apr 10 2018 13:14
@Weboholics we need a 2D drawing library, not a 3D library. we curerntly use skia and direct2d. if skia were to support vulcan then we'd get support automatically
so yeah we should have vulkan support already i guess
Jeremy Koritzinsky
@jkoritzinsky
Apr 10 2018 14:10
For Vulkan support we might have to set some settings on Skia to use GPU acceleration.
yowl
@yowl
Apr 10 2018 14:13
Skia now has a WebAssembly backend so Avalonia could be compiled to wasm and statically linked to it. I am talking BS, or does that sound feasible?
Weboholics
@Weboholics
Apr 10 2018 14:42
Best way to do 2D drawing is using the 3D Graphics from what I have heard :-) . My idea was that using Vulkan for rendering would decrease OS dependent code and enable fast and efficient animations and effects. Of course you could combine this with some high level library like skia. If I am not wrong all major OS now separate rendering from presentation (Display server).
Steven Kirk
@grokys
Apr 10 2018 14:59
@Weboholics yes that is exactly what skia does - 2D drawing using 3D graphics APIs ;)
Stano Turza
@Sorien
Apr 10 2018 15:31
There are some project that tries to implement 2d graphics on the top of vulkan api like https://github.com/jpbruyere/vkvg but it will take years to reach skia/cairo level
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 17:31
System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Avalonia.Direct2D1
  StackTrace:
   at Avalonia.Direct2D1.Media.GeometryImpl.GetRenderBounds(Pen pen)
   at Avalonia.Rendering.SceneGraph.GeometryNode..ctor(Matrix transform, IBrush brush, Pen pen, IGeometryImpl geometry, IDictionary`2 childScenes)
   at Avalonia.Rendering.SceneGraph.DeferredDrawingContextImpl.DrawGeometry(IBrush brush, Pen pen, IGeometryImpl geometry)
   at Core2D.Avalonia.Renderers.AvaloniaShapeRenderer.DrawEllipse(Object dc, EllipseShape ellipse, ShapeStyle style, Double dx, Double dy) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Renderers\AvaloniaShapeRenderer.cs:line 414
   at Core2D.Shapes.EllipseShape.Draw(Object dc, ShapeRenderer renderer, Double dx, Double dy, Object db, Object r) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core\Shapes\EllipseShape.cs:line 40
   at Core2D.Shapes.PointShape.Draw(Object dc, ShapeRenderer renderer, Double dx, Double dy, Object db, Object r) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core\Shapes\PointShape.cs:line 78
   at Core2D.Shapes.RectangleShape.Draw(Object dc, ShapeRenderer renderer, Double dx, Double dy, Object db, Object r) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core\Shapes\RectangleShape.cs:line 45
   at Core2D.Containers.LayerContainer.Draw(Object dc, ShapeRenderer renderer, Double dx, Double dy, Object db, Object r) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core\Containers\LayerContainer.cs:line 113
   at Core2D.Presenters.DefaultShapePresenter.DrawContainer(Object dc, ILayerContainer container, ShapeRenderer renderer, Double dx, Double dy, Object db, Object r) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core\Presenters\DefaultShapePresenter.cs:line 13
   at Core2D.Avalonia.Controls.LayerContainerRenderView.Render(DrawingContext context) in C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Controls\LayerContainerRenderView.cs:line 80
   at Avalonia.Rendering.SceneGraph.SceneBuilder.Update(DrawingContext context, Scene scene, VisualNode node, Rect clip, Boolean forceRecurse)
@grokys I am getting this error when using netcoreapp2.0 with UseDirect2D1()
Using UseSkia() works fine. Is this know issue?
Steven Kirk
@grokys
Apr 10 2018 18:39
@wieslawsoltes there is a problem with using sharpdx on netcoreapp which is AvaloniaUI/Avalonia#1320
not sure if you're seeing the same problem or not though
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:40
The app runs ok, the exception is thrown only when using drawing context
Steven Kirk
@grokys
Apr 10 2018 18:40
that one seems to be caused when you have bitmaps
are you drawing bitmaps?
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:40
I do not use bitmaps
Steven Kirk
@grokys
Apr 10 2018 18:41
ok, sounds like it's a different bug then
let me take a look at that code
@wieslawsoltes ah yeah looks like a simple mistake i introduced in jan
fix incoming
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:44
Great!
Steven Kirk
@grokys
Apr 10 2018 18:47
@wieslawsoltes AvaloniaUI/Avalonia#1485
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:51
Just checked my code and indeed I was passing pen as null in some cases.
Eric Mellino
@mellinoe
Apr 10 2018 18:51
@grokys Interesting. although it's a bit Windows and D2D-specific. I was thinking of something along the lines of an "EmbeddedNativePanel" that would let you hook your own renderer into it, and would be cross-platform. I have to admit I have no idea whether that would be possible outside of Windows, though.
Steven Kirk
@grokys
Apr 10 2018 18:52
yeah, i suspect achieving that cross-platform would be a bit difficult
danwalmsley
@danwalmsley
Apr 10 2018 18:52
@grokys I have found some issues on the border thickness branch posting details
Steven Kirk
@grokys
Apr 10 2018 18:53
great thanks @danwalmsley
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:53
@danwalmsley Did you try to improve text quality when using Skia backend?
The text sharpness is much worse when using Skia.
Steven Kirk
@grokys
Apr 10 2018 18:58
grrr, travis builds seem to be down again
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:58
yeah :worried:
danwalmsley
@danwalmsley
Apr 10 2018 18:58
@wieslawsoltes I did look at it along time ago
but only managed to make minimal improvement
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:59
@grokys By the way just refactored some code to use Bind Commands to Methods and its so nice!
danwalmsley
@danwalmsley
Apr 10 2018 18:59
at somepoint there was a regression but never got chance to look at it
Steven Kirk
@grokys
Apr 10 2018 18:59
@wieslawsoltes oh cool! thank @jkoritzinsky for that one!
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 18:59
@jkoritzinsky Bind Commands to Methods is so great! Thanks!
danwalmsley
@danwalmsley
Apr 10 2018 19:00
@grokys issue was in one of my styles I had <sys:double x:Key="ThemeBorderThickness">2</sys:double>
had to change to Thickness
so I think that branch looks good
Steven Kirk
@grokys
Apr 10 2018 19:00
ah ok, cool!
danwalmsley
@danwalmsley
Apr 10 2018 19:00
I'll just check corner radius
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 19:01
@danwalmsley The skia text rendering sharpness needs definitely improvement
Steven Kirk
@grokys
Apr 10 2018 19:02
oh sorry @danwalmsley i already merged
let me know if you find any problems with corner radius
danwalmsley
@danwalmsley
Apr 10 2018 19:02
@grokys looks ok anyway :)
@wieslawsoltes I think when I looked at it the main improvement was setting LCDRendering or something of similar naming to true
@wieslawsoltes post a screen shot of the text you are seeing? so I can see we are talking about the same thing
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 19:04
Skia.png
Direct2D1.png
Seems like this is already set here
danwalmsley
@danwalmsley
Apr 10 2018 19:07
yeah that's what I see, I put it down to skia not being able to take advantage of clear type?
that was my theory anyway
danwalmsley
@danwalmsley
Apr 10 2018 19:12
@grokys this I'm seeing with corner radius
image.png
image.png
That corner radius =4 border thickness =1
could be textblock causing it
danwalmsley
@danwalmsley
Apr 10 2018 19:46
@wieslawsoltes hmmm looks interesting, so they render it at higher dpi then scale down
AvaloniaUI/Avalonia@ead7b3b
danwalmsley
@danwalmsley
Apr 10 2018 19:48
hmmm, I guess that was when text was visible through layers when it shouldn't have been, that didn't make the text perfect btw
just a little better
Wiesław Šoltés
@wieslawsoltes
Apr 10 2018 19:50
CanUseLcdRendering=true.gif
CanUseLcdRendering=false.gif
danwalmsley
@danwalmsley
Apr 10 2018 20:07
@kekekeks could you merge kekekeks/Avalonia.Ide#7
fixes a minor crash
Benedikt Schroeder
@Gillibald
Apr 10 2018 21:17
Can you please explain what is working strange with textblock?