Browse Source

Very unstable gamma correction works

flabbet 8 months ago
parent
commit
2ceb17e5b3

+ 1 - 1
src/ChunkyImageLib/Chunk.cs

@@ -54,7 +54,7 @@ public class Chunk : IDisposable
 
         Resolution = resolution;
         PixelSize = new(size, size);
-        internalSurface = new Surface(PixelSize);
+        internalSurface = Surface.ForProcessing(PixelSize);
     }
 
     /// <summary>

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 0c1d72f544e73128235d0a0112cd571bbb44858f
+Subproject commit 854d16f252074444ccc8705c3ff9bb52288d1bbf

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

@@ -90,7 +90,7 @@ public abstract class Node : IReadOnlyNode, IDisposable
             if (texture.Size != size || texture.IsDisposed)
             {
                 texture.Dispose();
-                texture = new Texture(size);
+                texture = Texture.ForProcessing(size);
                 _managedTextures[id] = texture;
                 return texture;
             }
@@ -103,7 +103,7 @@ public abstract class Node : IReadOnlyNode, IDisposable
             return texture;
         }
 
-        _managedTextures[id] = new Texture(size);
+        _managedTextures[id] = Texture.ForProcessing(size);
         return _managedTextures[id];
     }
 

+ 4 - 2
src/PixiEditor/Models/Rendering/SceneRenderer.cs

@@ -39,7 +39,7 @@ internal class SceneRenderer
         
         if (!HighResRendering || !HighDpiRenderNodePresent(Document.NodeGraph))
         {
-            texture = new(Document.Size);
+            texture = Texture.ForProcessing(Document.Size);
             renderTarget = texture.DrawingSurface;
         }
 
@@ -49,7 +49,9 @@ internal class SceneRenderer
         
         if(texture != null)
         {
-            target.Canvas.DrawSurface(texture.DrawingSurface, 0, 0);
+            using Texture srgbTexture = Texture.ForDisplay(Document.Size);
+            srgbTexture.DrawingSurface.Canvas.DrawSurface(texture.DrawingSurface, 0, 0);
+            target.Canvas.DrawSurface(srgbTexture.DrawingSurface, 0, 0);
             texture.Dispose();
         }
     }