Skip to content
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

Enhance rendering framework with new RenderNode architecture #1196

Merged
merged 36 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b390a16
feat: add RenderNode, RenderNodeContext, and RenderNodeOperation clas…
yuto-trd Dec 7, 2024
8bfccdd
feat: add various RenderNode implementations for enhanced rendering c…
yuto-trd Dec 7, 2024
a7ddf50
feat: implement IPopable interface and update PushedState to use it
yuto-trd Dec 7, 2024
75a4d76
feat: Implement GraphicsContext2D class for recording RenderNodes.
yuto-trd Dec 7, 2024
ed6ed55
feat: mark CombinedFilterEffect and MultiTransform as obsolete, sugge…
yuto-trd Dec 7, 2024
d60229b
feat: add OnUntracked callback and improve node disposal in GraphicsC…
yuto-trd Dec 7, 2024
98ffbb1
feat: add RenderNodeCache and RenderNodeProcessor for enhanced render…
yuto-trd Dec 7, 2024
02840bb
feat: add unit tests for GraphicsContext2D to validate rendering beha…
yuto-trd Dec 7, 2024
380f10e
feat: mark multiple rendering classes as obsolete to suggest alternat…
yuto-trd Dec 7, 2024
e3a298f
feat: update rendering methods to use GraphicsContext2D and mark Defe…
yuto-trd Dec 7, 2024
47c17ab
feat: mark DeferradCanvas as obsolete and comment out rendering logic
yuto-trd Dec 7, 2024
47bdf57
feat: refactor rendering cache to use RenderNodeCacheContext and upda…
yuto-trd Dec 7, 2024
fb733b1
feat: update RenderLayer to use DrawableRenderNode and GraphicsContex…
yuto-trd Dec 7, 2024
9007049
feat: update ImmediateCanvas to use RenderNodeCacheContext and commen…
yuto-trd Dec 7, 2024
f908a04
feat: refactor PlayerViewModel to use DrawableRenderNode and Graphics…
yuto-trd Dec 7, 2024
40c340e
fix: build error
yuto-trd Dec 7, 2024
54a2942
fix: Fixed possible memory leak code
yuto-trd Dec 7, 2024
54ef03c
feat: Add TODO for supporting multiple EffectTargets in TransformEffect
yuto-trd Dec 7, 2024
c0c5f48
feat: Implement DrawDrawable method in ImmediateCanvas
yuto-trd Dec 7, 2024
af96e69
refactor: Replace Render calls with DrawDrawable in unit tests
yuto-trd Dec 7, 2024
8e93486
refactor: Remove DeferradCanvasTests and update GraphicsContext2DTest…
yuto-trd Dec 7, 2024
9499210
fix: correct behavior of PushLayer
yuto-trd Dec 7, 2024
ae75457
feat: Add TODO to disable caching when context.IsCacheEnabled is fals…
yuto-trd Dec 7, 2024
c870404
refactor: Remove obsolete rendering nodes and interfaces
yuto-trd Dec 7, 2024
1d308d8
refactor: Remove obsolete Cache references and update rendering logic
yuto-trd Dec 7, 2024
a6d89f7
change: relocate files previously moved temporarily under Rendering.V2
yuto-trd Dec 7, 2024
46c9398
feat: implement logic for creating cache
yuto-trd Dec 7, 2024
ed6503e
change: move cache ownership from RenderNodeCacheContext to RenderNode
yuto-trd Dec 7, 2024
85e4e23
feat: add bounds calculation for RenderLayer
yuto-trd Dec 7, 2024
5c728dc
change: refactor HitTest implementation to use RenderNode
yuto-trd Dec 7, 2024
65696f5
test: reorganize rendering tests and add new test cases for render nodes
yuto-trd Dec 7, 2024
241b454
fix: correct processing in RenderNodeProcessor.Rasterize
yuto-trd Dec 7, 2024
4f8be4e
test: add unit tests for EllipseRenderNode, RectClipRenderNode, Recta…
yuto-trd Dec 8, 2024
35e9ab5
feat: simplify FilterEffectActivator
yuto-trd Dec 9, 2024
1fc4db9
fix: resolve exception occurring in RenderNode caching
yuto-trd Dec 9, 2024
1ccb01e
refactor: streamline FilterEffectActivator by removing unnecessary fi…
yuto-trd Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Implement DrawDrawable method in ImmediateCanvas
  • Loading branch information
yuto-trd committed Dec 7, 2024
commit c0c5f48337c230857f615f5b3e5b845f62ac9f21
14 changes: 12 additions & 2 deletions src/Beutl.Engine/Graphics/ImmediateCanvas.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Beutl.Graphics.Effects;
using Beutl.Graphics.Rendering;
using Beutl.Graphics.Rendering.Cache;
using Beutl.Graphics.Rendering.V2;
using Beutl.Graphics.Rendering.V2.Cache;
using Beutl.Media;
using Beutl.Media.Pixel;
Expand Down Expand Up @@ -176,8 +177,17 @@ public void DrawSurface(SKSurface surface, Point point)

public void DrawDrawable(Drawable drawable)
{
// TODO: DrawDrawableの実装
// drawable.Render(this);
using var node = new DrawableRenderNode(drawable);
using var context = new GraphicsContext2D(node, Size);
drawable.Render(context);
var processor = new RenderNodeProcessor(node, this, GetCacheContext());
processor.Render(this);
}

public void DrawNode(RenderNode node)
{
var processor = new RenderNodeProcessor(node, this, GetCacheContext());
processor.Render(this);
}

[Obsolete("Obsolete")]
Expand Down