浏览代码

Add sync rendering function

Equbuxu 2 年之前
父节点
当前提交
9c9402eda7
共有 1 个文件被更改,包括 9 次插入0 次删除
  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);
     }
 
+    /// <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)
     {
         // add all affected chunks to postponed