Compositor: parallelize BlitContentRaw row loop (4 threads, BelowNormal intent) to speed scaled blits (Unit 5)

This commit is contained in:
2026-10-05 17:40:05 -07:00
parent dc1343896d
commit 623d77e531
+5 -3
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using ytLive.Helpers; using ytLive.Helpers;
using ytLive.Models; using ytLive.Models;
@@ -575,10 +576,11 @@ public sealed class SceneCompositor
sxLut[xi] = sxCanvas; sxLut[xi] = sxCanvas;
} }
for (var y = y0; y <= y1; y++) var parallelOpts = new ParallelOptions { MaxDegreeOfParallelism = 4 };
Parallel.For(y0, y1 + 1, parallelOpts, y =>
{ {
var py = y - ey; var py = y - ey;
if (py < oy || py > oy + drawnH) continue; if (py < oy || py > oy + drawnH) return;
// syNorm: normalized [0,1] position within the drawn content (vertically) // syNorm: normalized [0,1] position within the drawn content (vertically)
var syNorm = (py - oy) / drawnH; var syNorm = (py - oy) / drawnH;
@@ -656,7 +658,7 @@ public sealed class SceneCompositor
} }
} }
} }
} });
} }
/// <summary>Two-stage bilinear in 8.8 fixed point; result within ±1 of the /// <summary>Two-stage bilinear in 8.8 fixed point; result within ±1 of the