-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite of rendering stack #827
Merged
Merged
Changes from all commits
Commits
Show all changes
211 commits
Select commit
Hold shift + click to select a range
ada15eb
Initial implementation of low-level scene graph.
grokys 8ed9823
Merge branch 'master' into scenegraph
8aae515
Removed duplicate TestRoot.
grokys 83d45c5
Merge branch 'remove-duplicate-testroot' into scenegraph
grokys d91d182
Initial implementation of scenegraph hit testing.
grokys 458007a
Updated libs with API changes.
grokys 86216d9
Use scene geometry for hit-testing.
grokys 213e3c8
Fix hit testing on tab strip items.
grokys afda993
Fix initial draw.
grokys 98f551c
Don't need the context.Render any more.
grokys 59ea52e
Clip affects rendering.
934e18c
Initial impl of incremental update to SceneGraph.
cef5ffe
Docs and tweaking.
73f44bb
Fix GeometryNode hit test.
a520789
Reset needsRender flag after rendering.
grokys da666b4
Make Shape render properly again.
grokys 349ba78
Fixed pointerover state.
grokys 3c189cb
Make SceneBuilder update dirty rects.
grokys 3422768
Render child visual nodes explicitly.
grokys 52c3dae
Initial implementation of dirty rect drawing.
grokys 9f0a85a
Move FPS drawing out of inner loop.
grokys 2d5a8f3
Removed unnecessary field.
grokys db26fe3
Special case for hit testing in unit tests.
grokys d9d5e8b
Prevent reentrancy in renderer.
grokys c9752d3
Fixed a few things.
grokys 43c9534
Fix non-compiling tests.
grokys df014bd
Use null _dirty as meaning "needs first update".
grokys 7dde754
Don't keep rendering when there's nothing to render.
grokys 8578cce
Simplification.
grokys 76ec613
Use correct bounds in VisualNode.
grokys c46ca88
Make IGeometryImpl immutable.
grokys 9ebfa5c
Make SharpDX dispose of its resources.
grokys 584cdbb
Make FormattedTextImpl immutable.
grokys 64287fe
Prevent out-of-bounds in DirtyRects.Coalesce.
grokys 6b6474b
Fix bounds clipping.
grokys 04fe4a0
Fix RectangleNode bounds.
grokys a6f5631
Fix geometry measure.
grokys 675b742
Remove unneeded cast.
grokys 1f985ab
Refactored VisualNode.
grokys d34c279
WIP: Adding render layers.
grokys e222e92
Add option to draw dirty rects.
grokys 97ea14d
More work on deferred renderer.
grokys ec29987
Store layers in Scene.
grokys 6d3ca92
WIP: Getting resizing working.
grokys bae15f3
Update dirty controls in order.
grokys 932f489
Use the Direct2D 1.1 render target initialization.
grokys 74c263e
Handle detached visuals in dirty list.
grokys a967c9b
Make DPI scaling work again.
eefc1d3
Initialize layer backgrounds to transparent.
grokys 1e4661d
Resize swap chain on window resize.
grokys e450c76
A bit of work on Cairo, Skia and Gtk backends.
grokys fc1110f
Don't clear canvas when creating drawing context.
grokys 560ed78
Make render tests pass again.
grokys 1480532
Removed RendererMixin.
grokys 40d42d2
Renamed Renderer -> ImmediateRenderer
grokys 136f86f
Fix failing tests.
grokys 5919343
Share FPS drawing between renderers.
grokys f6b344d
Fix immediate geometry rendering in D2D.
grokys e619e6c
Added skia ref to RenderTest.
grokys bfed639
Don't draw FPS to overlay.
grokys edb28bc
Don't clear GTK window on expose.
grokys 4e8e7f8
Added setting to save frames to disk.
dbeb424
Fix skia text rendering.
b5e93b6
Make Window.IsVisible track window visibility.
b51513b
Refactor render layers a bit.
3426a8d
Handle deleted layers.
cf17c07
Swallow exceptions in render loop.
62e629b
Merge branch 'master' into scenegraph
0a36466
Run render tests with deferred renderer.
99c1df0
Remove Rect.operator*
4ce2e09
Use widened bounds for GeometryNode.Bounds.
6bc683a
Don't call Paint for now on Win32.
f9f658c
Handle null event source.
7c5c889
Fix RenderLayer resize.
7ce58c9
Merge branch 'master' into scenegraph
grokys 558f98f
Remove refrences to "scene graph" in Visual.
grokys 63f5dfb
Added ncrunch 3 solution.
grokys e79a144
WIP: Working on getting VisualBrush working
grokys ab9cf03
WIP: Delegate back to render for VisualBrushes.
grokys 40c5337
Don't throw here.
grokys 24635ea
Added in-tree visual brush test.
grokys 5261ab3
WIP: More work on VisualBrush
grokys 6f07978
Updated test output.
grokys 051be91
WIP: Draw visual brush from DeferredRenderer.
grokys b3f9a84
Run deferred render tests on a background thread.
grokys d92fb01
Added IImageBrush and IVisualBrush
grokys 69bca2c
Got VisualBrushes working again.
grokys 4490b5f
Make scene nodes internal.
grokys 0ba8a15
Removed random class diagram.
grokys b20ced7
Refactored brushes.
grokys 252bc94
Make LinearGradientBrush work again.
grokys e4eaf72
Make RadialGradientBrush work
grokys c39fd38
Make OpacityMask work in deferred renderer.
grokys ff9654a
Merge branch 'master' into scenegraph
grokys b050edb
Use yellow background in geometry clip tests.
grokys c23e104
Added failing geometry clip hit-test.
grokys 9004e9b
Updated RenderTest.
grokys d1e322c
Added failing test.
grokys 53c0e96
Fix RenderTransforms in SceneBuilder.
grokys bfd8c04
Make geometry clips work.
grokys a849d7b
Fixed geometry clip hit testing.
grokys abe69ac
Moved some mocks into Avalonia.UnitTests.
grokys 5e4f5a6
Handle geometry clips on child layers.
grokys 468f965
Test turning geometry clipping on and off.
grokys 2823f9e
Merge branch 'master' into scenegraph
grokys 4fc75cb
Fixed failing tests.
grokys bf6b9c1
Merge branch 'master' into scenegraph
grokys 2a79137
Make cairo render tests pass.
grokys 4907841
Implement drawing opacity masked bitmap on skia.
grokys 4fddd18
Don't clear skia canvas when creating drawing ctx.
grokys dcb7c35
Run skia render tests under NCrunch.
grokys 8f4ef7f
Make a bunch of skia render tests pass.
grokys 5b62cef
Fix Skia stream geometry bounds calculation.
grokys 7e4f7cf
Merge branch 'master' into scenegraph
grokys 418effe
Merge branch 'master' into scenegraph
grokys 2b1d4e5
Fix failing test.
grokys ad73e7f
Send paint and resize notifications to renderer.
grokys 226fc6b
Tweak DeferredRenderer locking.
grokys 059b937
Set dirty rect when control removed/hidden.
grokys 071ec13
Added missing member to interface.
grokys 9029513
Merge branch 'master' into scenegraph
grokys daae9c0
Forgot to save before last commit.
grokys 6036bd5
Moved ncrunch files to their own dir.
grokys 371db68
Merge branch 'master' into scenegraph
grokys 2813144
Added doc comments for ImmediateRenderer.
grokys 289fa47
Reworked immediate renderer.
grokys faf150c
Make windowing subsystem select the renderer.
grokys 39c25fd
Allow selection of ImmediateRendering on Win32.
grokys a5f03f7
Don't need to pass visual brush renderer when creating render target.
grokys e0ef467
Merge remote-tracking branch 'origin/master' into scenegraph
grokys 910d17a
Removed unused code.
grokys 11fd0fb
Merge branch 'master' into scenegraph
grokys bd23c9e
Merge branch 'master' into scenegraph
grokys ef6486a
Removed unused member.
grokys 4520b2d
Merge branch 'master' into scenegraph
grokys 5cee534
Merge branch 'master' into scenegraph
grokys d0bb03e
Remove .vscode dir.
grokys 2aa912c
Merge remote-tracking branch 'origin/master' into scenegraph
grokys b7c83e7
Remove IsVisible changes from Window/Popup.
grokys a39d84b
Use correct namespace for IDrawingContextImpl.
grokys 376535b
Make IFormattedTextImpl immutable.
grokys be20562
Added some docs.
grokys e93e262
FormattedText spans can be null.
grokys ae7cf4a
Merge branch 'master' into scenegraph
grokys daa1ef9
Merge branch 'port-immediaterenderer' into scenegraph
grokys 1b51790
Fix merge errors.
grokys 19a8b8a
Moved hit testing tests.
grokys 7119464
Added ImmediateRenderer hit tests.
grokys cb3090e
Merge branch 'fixes/fix-getvisualroot' into scenegraph
grokys 96f316e
Removed some small diffs from master.
grokys b942eef
Added RenderScaling doc comment.
grokys 804d1b6
Always allow D2D for the moment.
grokys 7fd1adb
This needs to be settable.
grokys f0e3989
Made some classes internal and added docs.
grokys 20d44f2
Merge branch 'master' into scenegraph
grokys aec3c51
Merge remote-tracking branch 'origin/master' into scenegraph
grokys 80745a3
Expose Visuals internals to render tests.
grokys 1c42bbf
Added failing custom renderer test.
grokys 3ce2479
Implemented deferred opacity drawing.
grokys 7e1efb3
Added failing render test.
grokys d6342e9
Adjusted expected test output.
grokys 27ec199
Added failing custom render tests.
grokys 9121b4d
Implemented more deferred rendering.
grokys 51688fa
Removed duplicate using statement.
grokys 2fcafe1
Merge branch 'master' into scenegraph
grokys fb25645
Fixed expected skia output.
grokys 11a0100
Fix possible null reference exceptions.
grokys e5e5edd
Removed files deleted on master.
grokys 3d76a50
Port Direct2D code from master.
grokys 69c43cb
Fix DPI scaling with Skia.
grokys 2d0d265
Merge branch 'fixes/fix-interop-samples' into scenegraph
grokys 6a2d9e8
Merge branch 'fixes/fix-interop-samples' into scenegraph
grokys ddbc100
Make D3D interop sample work.
grokys 1ac08f3
Merge branch 'master' into scenegraph
danwalmsley 024573d
Removed bad project references.
grokys 0f81420
Don't remove root layer when hiding root.
grokys daf59b8
Start/stop the renderer on window show/hide.
grokys 1e2e3b3
Merge remote-tracking branch 'origin/master' into scenegraph
grokys becac6a
Set background on MenuItem and TreeViewItem
grokys 99efcfe
Make BoundsTracker work with deferred renderer.
grokys 1cb2e32
Set background for CheckBox and RadioButton
grokys dc20897
GeometryNode.Pen may be null.
grokys ec80b12
Check for null from Scene.FindNode.
grokys b28bc7c
Convert brushes to immutable brushes in FormattedTextImpl.
grokys 79a192a
Change cast to `as` operator.
grokys a451803
Merge branch 'master' into scenegraph
danwalmsley cb9e9a1
Don't try to create a framebuffer of size 0.
grokys 658a1d3
Fix scrollwheel scrolling in TreeView/ListBox.
grokys e7c8e8e
Merge branch 'master' into scenegraph
danwalmsley 18dd29e
Merge branch 'master' into scenegraph
danwalmsley fb8695c
Merge branch 'master' into scenegraph
danwalmsley dc966d4
Give background to DropDownItem and ListBoxItem.
grokys 104da0f
Fix ScrollViewer background.
grokys d7aa408
Fixed ScrollViewer background correctly.
grokys 2a748fe
Newly merged tests must be async.
grokys 64ef842
Merge remote-tracking branch 'origin/master' into scenegraph
grokys daafa39
Merge branch 'master' into scenegraph
danwalmsley 3f92d13
Merge branch 'master' into scenegraph
danwalmsley 2f5d8e2
Fix merge error.
grokys 2edcdb8
MouseDevice now exposed on TopLevel.
grokys 704452e
Added TODOs.
grokys aa1af7f
Removed unused file.
grokys bbf69b7
Use Vector for DPI.
grokys 7eec944
Add Brush/Pen.ToImmutable() extension method.
grokys aefc5c5
Scene.Id -> Scene.Generation.
grokys 3527c20
Throw NotSupportedException.
grokys d2eca39
Removed IRendererFactory.
grokys 7905a3e
Merge remote-tracking branch 'origin/master' into scenegraph
grokys 391efe3
Fix merge error.
grokys e3fde00
Remove IRenderFactory from mobile platforms.
grokys 2479f3e
Merge branch 'master' into scenegraph
grokys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ProjectConfiguration> | ||
<Settings> | ||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> | ||
</Settings> | ||
</ProjectConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ProjectConfiguration> | ||
<Settings> | ||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> | ||
</Settings> | ||
</ProjectConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ProjectConfiguration> | ||
<Settings> | ||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> | ||
</Settings> | ||
</ProjectConfiguration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
|
||
namespace Avalonia.Media | ||
{ | ||
/// <summary> | ||
/// Extension methods for brush classes. | ||
/// </summary> | ||
public static class BrushExtensions | ||
{ | ||
/// <summary> | ||
/// Converts a brush to an immutable brush. | ||
/// </summary> | ||
/// <param name="brush">The brush.</param> | ||
/// <returns> | ||
/// The result of calling <see cref="IMutableBrush.ToImmutable"/> if the brush is mutable, | ||
/// otherwise <paramref name="brush"/>. | ||
/// </returns> | ||
public static IBrush ToImmutable(this IBrush brush) | ||
{ | ||
Contract.Requires<ArgumentNullException>(brush != null); | ||
|
||
return (brush as IMutableBrush)?.ToImmutable() ?? brush; | ||
} | ||
|
||
/// <summary> | ||
/// Converts a pen to a pen with an immutable brush | ||
/// </summary> | ||
/// <param name="pen">The pen.</param> | ||
/// <returns> | ||
/// A copy of the pen with an immutable brush, or <paramref name="pen"/> if the pen's brush | ||
/// is already immutable or null. | ||
/// </returns> | ||
public static Pen ToImmutable(this Pen pen) | ||
{ | ||
Contract.Requires<ArgumentNullException>(pen != null); | ||
|
||
var brush = pen?.Brush?.ToImmutable(); | ||
return pen == null || ReferenceEquals(pen?.Brush, brush) ? | ||
pen : | ||
new Pen( | ||
brush, | ||
thickness: pen.Thickness, | ||
dashStyle: pen.DashStyle, | ||
dashCap: pen.DashCap, | ||
startLineCap: pen.StartLineCap, | ||
endLineCap: pen.EndLineCap, | ||
lineJoin: pen.LineJoin, | ||
miterLimit: pen.MiterLimit); | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[FUTURE] It's probably better to react to window state changes instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that we also need to react to
WindowState
changes, or that some other form of window state should replaceHide
?