Forráskód Böngészése

apply filter node low dpi, raw output filterless

Krzysztof Krysiński 4 hónapja
szülő
commit
cd950fb78d

+ 4 - 10
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/FilterNodes/ApplyFilterNode.cs

@@ -24,19 +24,13 @@ public class ApplyFilterNode : RenderNode, IRenderInput
         Filter = CreateInput<Filter>("Filter", "FILTER", null);
         Output.FirstInChain = null;
         AllowHighDpiRendering = true;
-        Background.ConnectionChanged += OnConnectionChanged;
     }
 
-    private void OnConnectionChanged()
+
+    protected override void Paint(RenderContext context, DrawingSurface surface)
     {
-        if (Background.Connection == null)
-        {
-            AllowHighDpiRendering = true;
-        }
-        else
-        {
-            AllowHighDpiRendering = (Background.Connection.Node as RenderNode)?.AllowHighDpiRendering ?? true;
-        }
+        AllowHighDpiRendering = (Background.Connection.Node as RenderNode)?.AllowHighDpiRendering ?? true;
+        base.Paint(context, surface);
     }
 
     protected override void OnPaint(RenderContext context, DrawingSurface surface)

+ 4 - 2
src/PixiEditor.ChangeableDocument/Changeables/Graph/Nodes/LayerNode.cs

@@ -32,7 +32,7 @@ public abstract class LayerNode : StructureNode, IReadOnlyLayerNode, IClipSource
         blendPaint.BlendMode = Drawie.Backend.Core.Surfaces.BlendMode.SrcOver;
 
         RenderContent(sceneContext, sceneContext.RenderSurface,
-            sceneContext.TargetPropertyOutput != FilterlessOutput);
+            sceneContext.TargetPropertyOutput == Output);
     }
 
     private void RenderContent(SceneObjectRenderContext context, DrawingSurface renderOnto, bool useFilters)
@@ -53,7 +53,9 @@ public abstract class LayerNode : StructureNode, IReadOnlyLayerNode, IClipSource
                 using var tempSurface = Texture.ForProcessing(context.DocumentSize, context.ProcessingColorSpace);
                 DrawLayerOnTexture(context, tempSurface.DrawingSurface, useFilters);
 
-                renderOnto.Canvas.DrawSurface(tempSurface.DrawingSurface, 0, 0, blendPaint);
+                using var paint = new Paint();
+                paint.BlendMode = RenderContext.GetDrawingBlendMode(BlendMode.Value);
+                renderOnto.Canvas.DrawSurface(tempSurface.DrawingSurface, 0, 0, paint);
             }
 
             return;