Browse Source

Add sync rendering function

Equbuxu 2 years ago
parent
commit
9c9402eda7
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/PixiEditor/Models/Rendering/WriteableBitmapUpdater.cs

+ 9 - 0
src/PixiEditor/Models/Rendering/WriteableBitmapUpdater.cs

@@ -59,6 +59,15 @@ internal class WriteableBitmapUpdater
         return await Task.Run(() => Render(chunkGatherer, updateDelayed)).ConfigureAwait(true);
         return await Task.Run(() => Render(chunkGatherer, updateDelayed)).ConfigureAwait(true);
     }
     }
 
 
+    /// <summary>
+    /// Don't call this outside ActionAccumulator
+    /// </summary>
+    public List<IRenderInfo> UpdateGatheredChunksSync
+        (AffectedChunkGatherer chunkGatherer, bool updateDelayed)
+    {
+        return Render(chunkGatherer, updateDelayed);
+    }
+
     private Dictionary<ChunkResolution, HashSet<VecI>> FindGlobalChunksToRerender(AffectedChunkGatherer chunkGatherer, bool renderDelayed)
     private Dictionary<ChunkResolution, HashSet<VecI>> FindGlobalChunksToRerender(AffectedChunkGatherer chunkGatherer, bool renderDelayed)
     {
     {
         // add all affected chunks to postponed
         // add all affected chunks to postponed